Strategy · Pine Script v6 · On the chart

Minervini VCP + SmartMCDX Backtest

by kevinesk

This strategy identifies breakout setups using Mark Minervini volatility contraction patterns, trend templates, and volume surges.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code518
Settings40inputs
LicenceNone stated
Last update4 months ago12 Jun 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 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.

Details

Published by

kevinesk on GitHub

Type

Strategy, Pine Script v6

Draws

On the price chart

Category

Breakout, Trend, Volume, Moving averages

Markets

Stocks

Timeframes

H4 and above

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Require Full TPR (7/7) for Entrybooltruereq_tpr
Require VCP Squeeze for Entryboolfalsereq_vcp
Require Volume Surge on Breakoutbooltruereq_vol_surge
Volume Surge Multiplierfloat1.5vol_mult
[v7] Breakout Buffer % Above Linefloat0.3bo_buffer_pct
[v7] Use ATR-Based Stop Lossbooltrueuse_atr_stop
[v7] ATR Stop Multiplierfloat2.0atr_sl_mult
Fallback Hard Stop Loss %float4.5sl_pct
Take Partial Profit (Sell 50% at TP1)booltrueuse_partial_tp
TP1 Target %float5.0partial_tp_pct
[v7] Runner Limit at TP2booltrueuse_partial_tp2
[v7] TP2 Target %float10.0partial_tp2_pct
Show all 40 settings
SettingTypeDefaultVariable
Move Stop to Break-Evenbooltrueuse_breakeven
Break-Even Trigger %float4.0be_trigger_pct
Use 21-EMA Trailing Stop for Runnerbooltrueuse_trail
Activate Trail After % Profitfloat3.0trail_activation
[v7] Min Base Duration (Bars)int15min_base_bars
[v7] Require Min VCP Contractionsbooltruereq_contractions
[v7] Min Contractions in Baseint2min_contractions
Require Banker for Entryboolfalseuse_mcdx_entry
Min Banker % for Entryfloat0.0mcdx_entry_val
Smart Exit: Sell if Banker Dropsboolfalseuse_mcdx_exit
Exit Danger Threshold %float0.0mcdx_exit_val
[v7] Require Bull Market (SPY > 200 SMA)booltrueuse_mkt_regime
[v7] Require Stock Outperforms SPYbooltrueuse_rs_filter
[v7] RS Lookback Period (Bars)int63rs_period
Benchmark SymbolsymbolSPYbm_sym
21 EMA Lengthint21len_ema21
50 SMA Lengthint50len_sma50
150 SMA Lengthint150len_sma150
200 SMA Lengthint200len_sma200
21 EMA Colorcolorcolor.new(color.yellow, 50)c_ema21
50 SMA Colorcolorcolor.bluec_sma50
150 SMA Colorcolorcolor.orangec_sma150
200 SMA Colorcolorcolor.redc_sma200
Table PositionstringTop Righttable_pos_input
Table SizestringSmalltable_size_input
H1 Lookback (Bars)int21h1_lookback
Sub-High Left Barsint3h_pivot_left
Sub-High Right Barsint3h_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.

Similar Pine Scripts

2 stars

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

Strategy v5 BreakoutMoving averages
Updated 2 years ago · None stated GitHub repository of DegenerateChain Channel Breakout
257 stars

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

Strategy v6 TrendMoving averages Repaints
Updated 6 weeks ago · None stated GitHub repository of Best Chart 1m Strategy Candle Bar
218 stars

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

Strategy v6 TrendMoving averages
Updated 3 months ago · None stated GitHub repository of MA Cross Strategy Template

12/26-IT Strategy

by hasnocool
106 stars

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

Strategy v5 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 12/26-IT Strategy

均线突破交易系统

by tangly1024
76 stars

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

Strategy v5 TrendMoving averages
Updated 4 months ago · None stated GitHub repository of 均线突破交易系统

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers