1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.
Source Code
325 lines of Pine Script v6 from pinescript/volume_delta_strategy.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
Volume Delta Trend Reversal Long Only enters when buyers dominate by a set margin, price has stayed above a trend SMA for several bars, RSI is above a minimum and the session filter allows it, with a bear regime block. Exits follow sellers dominating for several bars, a trend crossunder or a trailing stop after a profit threshold, plus drawdown and portfolio halts.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
CVD rolling window (bars)
int
50
cvdPeriod
Entry: buy% must exceed sell% by X%
float
20.0
cvdThresholdPct
Exit: sellers must dominate for N bars
int
3
cvdExitBars
Exit: sell% must exceed buy% by X%
float
25.0
cvdExitPct
Reset CVD at session open each day
bool
false
useDailyReset
Minimum bars to hold before CVD exit
int
5
minHoldBars
Block entries in bear regime
bool
true
useBearFilter
Bear regime MA period
int
200
bearMAPeriod
Bars below bear MA to confirm bear
int
10
bearConsecBars
Bars above bear MA to exit regime
int
5
bearExitBars
Trend MA period (SMA)
int
200
trendMAPeriod
Min % above trend MA to enter
float
0.5
trendMABuffer
Show all 29 settings
Setting
Type
Default
Variable
Confirm bars above MA before entry
int
5
confirmBars
RSI momentum filter
bool
true
useRsiFilter
RSI period
int
14
rsiPeriod
Min RSI to allow entry
float
50.0
rsiMinLevel
Only trade during active session
bool
true
useSessionFilter
Active session (exchange time)
session
0800-1700
sessionStr
Exit when CVD sellers dominate
bool
true
useCvdExit
Exit on trend MA crossunder
bool
true
useTrendExit
Use trailing stop
bool
true
useTrailStop
Trail stop % from peak
float
4.0
trailPct
Activate trail after X% profit
float
6.0
trailActivate
Size as % of equity
bool
true
useEquityPct
Margin % of equity per trade
float
0.2
marginEquityPct
Fixed margin (when % mode OFF)
float
2000
marginAmt
Leverage (x)
int
1000
leverage
Emergency stop: X% loss of peak equity
float
50.0
portfolioStopPct
Halt entries if equity DD > X% from peak
float
20.0
equityDDPct
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
This strategy enters long when a faster moving average crosses above a slower one and short when it crosses below, unless long-only mode is on. An optional volume filter requires volume above a 20-bar average times a multiplier. Exits use a percentage stop los
This Pine Script strategy identifies potential Buy Today, Sell Tomorrow (BTST) opportunities based on price action and volume patterns. It calculates a 20-period simple moving average of volume and checks for three consecutive bullish candles with higher highs
This strategy combines Smart Money Concepts (BOS and CHoCH) with moving average trend filtering and volume spikes to generate trade signals. It checks for 20 EMA and 50 EMA alignment, along with volume 20% above its 20-period SMA. Long entries require a bullis
This strategy evaluates breakout and trend opportunities on the price chart using a weighted composite score of volume, trend, and candlestick structure. It tracks volume spikes, fast and slow EMAs, higher-timeframe EMA trend alignment, opening ranges, and ses
This strategy enters long or short when eight conditions align over the last two bars. It requires EMA 10 and EMA 55 alignment on the one-hour, four-hour and daily charts, a positive ADX slope, matching monitor direction, and price relative to a 400-bar point
This strategy plots on the price chart and looks for three-candle fair value gaps and inverse gaps on Bitcoin. It enters long when a wide enough bullish gap appears in an uptrend with RSI above 30 and volume above its average, and short on the opposite bearish