1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
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
The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.
Overview
Minervini VCP + SmartMCDX Backtest enters long positions when price breaks above base resistance under favorable benchmark regime and relative strength conditions. Risk management incorporates an ATR-based stop loss, break-even adjustments, two tiered take-profit targets, and a 21-period exponential moving average trailing stop. User settings configure contraction thresholds, volume multipliers, and benchmark filters. The script draws directly on the price chart and depends on benchmark data feeds.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Require Full TPR (7/7) for Entry
bool
true
req_tpr
Require VCP Squeeze for Entry
bool
false
req_vcp
Require Volume Surge on Breakout
bool
true
req_vol_surge
Volume Surge Multiplier
float
1.5
vol_mult
[v7] Breakout Buffer % Above Line
float
0.3
bo_buffer_pct
[v7] Use ATR-Based Stop Loss
bool
true
use_atr_stop
[v7] ATR Stop Multiplier
float
2.0
atr_sl_mult
Fallback Hard Stop Loss %
float
4.5
sl_pct
Take Partial Profit (Sell 50% at TP1)
bool
true
use_partial_tp
TP1 Target %
float
5.0
partial_tp_pct
[v7] Runner Limit at TP2
bool
true
use_partial_tp2
[v7] TP2 Target %
float
10.0
partial_tp2_pct
Show all 40 settings
Setting
Type
Default
Variable
Move Stop to Break-Even
bool
true
use_breakeven
Break-Even Trigger %
float
4.0
be_trigger_pct
Use 21-EMA Trailing Stop for Runner
bool
true
use_trail
Activate Trail After % Profit
float
3.0
trail_activation
[v7] Min Base Duration (Bars)
int
15
min_base_bars
[v7] Require Min VCP Contractions
bool
true
req_contractions
[v7] Min Contractions in Base
int
2
min_contractions
Require Banker for Entry
bool
false
use_mcdx_entry
Min Banker % for Entry
float
0.0
mcdx_entry_val
Smart Exit: Sell if Banker Drops
bool
false
use_mcdx_exit
Exit Danger Threshold %
float
0.0
mcdx_exit_val
[v7] Require Bull Market (SPY > 200 SMA)
bool
true
use_mkt_regime
[v7] Require Stock Outperforms SPY
bool
true
use_rs_filter
[v7] RS Lookback Period (Bars)
int
63
rs_period
Benchmark Symbol
symbol
SPY
bm_sym
21 EMA Length
int
21
len_ema21
50 SMA Length
int
50
len_sma50
150 SMA Length
int
150
len_sma150
200 SMA Length
int
200
len_sma200
21 EMA Color
color
color.new(color.yellow, 50)
c_ema21
50 SMA Color
color
color.blue
c_sma50
150 SMA Color
color
color.orange
c_sma150
200 SMA Color
color
color.red
c_sma200
Table Position
string
Top Right
table_pos_input
Table Size
string
Small
table_size_input
H1 Lookback (Bars)
int
21
h1_lookback
Sub-High Left Bars
int
3
h_pivot_left
Sub-High Right Bars
int
3
h_pivot_right
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 price closes above the prior channel high and a longer EMA filter, the bar is bullish, volume rises versus the previous bar, and average volume and turnover clear set thresholds. It exits the long when price closes below a shorte
This strategy plots a comparative relative strength line against a benchmark symbol in a separate pane. It calculates price and volume simple moving averages alongside a multi-period highest high. Long trades enter using full equity when price exceeds its movi
This strategy plots running pivot highs as red R circles and pivot lows as blue S circles directly on the price chart. It computes an EMA 3 and a Cto trend line from close prices, then generates long signals on upward EMA-Cto crossovers combined with price pos
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 strategy executes trades based on crossovers between a 12-period and a 26-period exponential moving average (EMA). Long positions can be filtered by pivot resistance breakouts and RSI boundary ranges. For trade management, it provides two configurable par
This strategy trades long breakouts of a fast and a slow moving average on the price chart. It opens a long position when price crosses above either average, using a percentage of equity as size. It reduces the position by a set share when the high reaches the