What the strategy is trying to do
This is an open-source script published under the TradingView username Alex2542, titled “ADX + Volume Strategy.” The source header says © traderhub, which does not match the publication username; keep the header notice if you redistribute the file. It wants three things at once: ADX above a threshold, so the trend is strong enough; the relative position of +DI and −DI for direction; and volume above a multiple of its 20-bar average. All three must hold to enter, and the opposite set closes the current trade and reverses it. The author's chart is BYBIT:BTCUSDT.P on the 1-hour timeframe, so this entry is filed under BTC. The script does not hard-code a symbol and will load on other charts, but the guide and the image follow that publication chart.
The strategy declaration only sets overlay=true. It does not set position size or commission, so Pine's defaults apply: a fixed quantity of 1. On a bitcoin perpetual, one unit can be a large notional, so set size and fees in the strategy properties before you read the tester. There is also no separate take-profit or stop-loss; the only exit is an opposite signal.

How the indicators are calculated
- +DI, −DI, and ADX all come from ta.dmi(adxLength, adxLength). Both arguments use ADX Period, default 21, so the directional length and the ADX smoothing length are the same.
- The volume average is a 20-bar simple moving average of volume. That 20 is hard-coded and is not an input. The volume test is volume > avgVolume × Volume Multiplier, and the multiple defaults to 1.8.
- A long needs all of these: ADX above the threshold (default 26), +DI above −DI, and volume above the average times the multiple.
- A short flips the direction test: ADX still above the threshold, −DI above +DI, and the same volume condition.
- The source plots ADX on the main chart and adds a horizontal threshold. Because overlay is true, ADX lives on a 0–100 scale while bitcoin is priced in the tens of thousands, so the line sits along the bottom of the author's chart. That is display only and does not change the rules.
Entry rules
- Long (order name Long): ADX is above the threshold, +DI is above −DI, and volume is above the average times the multiple.
- Short (order name Short): ADX is above the threshold, −DI is above +DI, and volume is similarly expanded.
- These are state checks, not crosses. While all three remain true, each qualifying bar reaches the entry call. Whether that adds size depends on pyramiding. The source does not set it, so Pine's default of 0 applies and it will not add to an open trade in the same direction.
- The source does not wait for barstate.isconfirmed. On a 1-hour chart, ADX, the directional lines, and volume can still change before the bar ends.
Exits and position size
- Exit long: a long is open and the short condition is true. The source calls strategy.close("Long"), and if the short condition holds on that bar it also calls strategy.entry("Short").
- Exit short: a short is open and the long condition is true, which likewise closes and reverses.
- There is no take-profit and no stop-loss. If the trend fades without an opposite volume-confirmed signal, the trade stays open.
- Size defaults to one unit, not a fraction of equity. Set the quantity and commission in the properties before you run it on a bitcoin perpetual.
Inputs (source defaults)
| Input | Default | Role |
|---|---|---|
| ADX Period | 21 | Used for both the directional length and the ADX smoothing length in ta.dmi. |
| ADX Threshold | 26 | ADX must be above this value before an entry is allowed. |
| Volume Multiplier | 1.8 | Current volume must exceed the 20-bar volume average times this multiple. The average length itself cannot be changed. |
Things to know before using it
- There is no stop. After a trend ends, a delayed opposite volume signal can leave a large retracement in the open trade.
- The volume average length is fixed at 20; only the multiple is adjustable. On symbols where volume behaves differently, that confirmation can be too loose or too tight.
- The default size is one unit, and no commission is set. On a chart such as BYBIT:BTCUSDT.P, change both before you trade or test.
- ADX is plotted on the price chart, so it hugs the bottom of the pane. It is not a moving average around price.
- The source copyright is traderhub, while the publication username is Alex2542. Keep the header license and copyright notices if you redistribute the file.
Installing it on TradingView
- Download the .pine file from Coinpred (active membership required, see below), or check the original page for a newer version.
- Open the Pine Editor, create a blank script, paste the full source, and save.
- Click Add to chart. To match the author image, start with BYBIT:BTCUSDT.P on the 1-hour timeframe.
- Set the quantity and commission in the strategy properties, adjust the ADX threshold and volume multiple if you need to, then inspect fills in the Strategy Tester.
- Past tester results do not guarantee future returns.
About backtest figures
Source, license and version
- Source: https://www.tradingview.com/script/whPK8Qlh-ADX-Volume-Strategy/
- Author: Alex2542 (the source header is © traderhub). Source version 1.0 (Pine v5), scriptAccess=open_no_auth.
- License: Mozilla Public License 2.0. Redistribution must keep the copyright and license notices; modified files must remain under MPL 2.0. Coinpred ships the unmodified full source.
- Members can download the .pine file on this page to study the rules. Judge the risk yourself, and follow your venue's rules.



