Blog / Strategy
Strategy

Vidya Trend Pullback

Disclaimer: This article is for educational and informational purposes only. It does not constitute financial or investment advice. Trading forex and CFDs carries significant risk of loss. Past performance of any strategy — including backtests — does not guarantee future results. Never trade with money you cannot afford to lose.

What Is This Strategy?

The Vidya Trend Pullback strategy is a trend-following pullback system built around VIDYA — Tushar Chande's Variable Index Dynamic Average — a self-adapting moving average that changes how quickly it reacts to price depending on how one-sided recent momentum has been. Where a standard simple or exponential moving average smooths price with a fixed weight (and therefore lags in strong trends while whipsawing in flat markets), VIDYA scales its smoothing by the absolute value of the Chande Momentum Oscillator (CMO). In plain terms, when price drifts sideways and up-moves cancel down-moves, the line effectively freezes and refuses to chase noise; when a genuine directional drive appears, the line accelerates to hug price. A single adaptive line therefore encodes both a trend baseline and a built-in trend-versus-chop filter.

Rather than trading the moving-average cross — which would simply lag the market — the Vidya Trend Pullback strategy waits for an established, volatility-confirmed trend and then looks to enter on a retracement back to the adaptive line. This "buy the dip inside an uptrend, sell the rally inside a downtrend" logic is a classic attempt to capture the higher-quality, better reward-to-risk portion of a move, entering after a pause rather than chasing an extended candle.

As a learning tool, this strategy is well suited to traders who want to study how adaptive moving averages behave differently from fixed ones, and who want to understand how pullback entries, volatility-based stops (using the Average True Range, or ATR), and fixed reward-to-risk targets fit together in a single rules-based system. It is designed with liquid instruments and intraday-to-swing timeframes in mind, and it is best approached as an educational framework for studying trend-pullback mechanics — not as a shortcut to results.

How It Works

The strategy evaluates its rules once per newly closed bar on the chart's primary timeframe. It maintains its own rolling history of closed bars, recomputes the VIDYA line, and measures volatility with ATR before checking for a signal. All distances are expressed as fractions or multiples of ATR, so the logic automatically self-scales to each instrument's volatility.

The strategy signals a long (buy) entry when all of the following are true:

The strategy signals a short (sell) entry on the exact mirror image: VIDYA falling by at least the ATR-scaled threshold, a recent bar rallying back up to within touch distance of the line, and the just-closed bar closing below VIDYA with a bearish body while not being over-extended below it.

Exit, stop-loss, and take-profit logic:

VIDYA trend pullback MT5 EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
VidyaPeriod 16 5 60 VIDYA smoothing length; sets the base alpha = 2/(period+1). Larger = smoother, slower line.
CmoPeriod 9 3 30 Lookback for the Chande Momentum Oscillator that drives VIDYA's adaptivity.
SlopeLookback 3 1 12 Number of bars over which VIDYA's up/down slope is measured.
SlopeAtrFrac 0.12 0.0 1.0 VIDYA must move at least this × ATR over the lookback to count as trending.
PullbackBars 4 2 15 Window (in bars) within which a pullback touch of the line must have occurred.
TouchAtrFrac 0.30 0.0 1.5 How close (× ATR) a bar's low/high must come to VIDYA to count as a pullback touch.
MaxStretchAtr 1.20 0.3 3.0 Rejects reclaims whose close is farther than this × ATR from the line.
AtrPeriod 14 5 40 ATR lookback used as the volatility yardstick.
AtrStopMult 1.5 0.5 4.0 Stop-loss distance as a multiple of ATR.
RewardRisk 1.8 0.5 5.0 Take-profit distance as a multiple of the initial risk.
MaxSpreadPoints 80 5 300 Skip new entries when the current spread (in points) is wider than this.
Lots 0.10 0.01 1.0 Order volume in lots.
Magic 8241 0 9,999,999 Magic number identifying this EA's trades.
VIDYA trend pullback MT5 EA — MQL5 source code

Recommended Chart Settings

This strategy was designed with liquid instruments in mind — a major forex pair such as EURUSD or GBPUSD, or a major index such as US500 — on an M15 to H1 timeframe, where adaptive-average pullbacks tend to be clearest. The expert reads only the chart's primary timeframe, so it will run on whatever symbol and timeframe you attach it to. Because every distance is ATR-scaled, the logic adapts across instruments, but behavior will still vary considerably across different market conditions, and any parameter set should be studied on your specific instrument before use.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Strengths of the approach. The core idea — an adaptive moving average that flattens in chop and accelerates in trends — is an elegant way to combine a trend baseline with a regime filter in a single line. Requiring an ATR-significant slope, a genuine pullback touch, a same-direction reclaim, and a non-extended close means several independent conditions must align before a trade triggers, which historically tends to reduce low-quality entries compared with a bare moving-average cross. ATR-based stops and a fixed reward-to-risk target impose consistent, mechanical risk on every trade.

Known limitations. VIDYA, like all moving averages, is still a lagging construct: it reacts to price rather than predicting it. Pullback systems are structurally vulnerable to trends that reverse sharply without offering a clean retracement, and to "failed reclaims" where price touches the line, closes back inside the trend, and then rolls over anyway. Because the strategy only opens one position at a time and manages exits purely through the ATR stop and reward-to-risk target, it will sit through adverse excursions until one of those levels is hit — there is no early exit.

Where it may underperform. Choppy, range-bound markets can produce repeated marginal slope readings that generate whipsaw entries, and sharp news-driven spikes can blow through the ATR stop. Very quiet, low-volatility regimes may rarely satisfy the slope threshold at all, leaving long stretches with no trades. No single parameter set is optimal across all instruments or all market phases, and over-tuning to past data is a real risk.

Risk Management Tips

Risk Warning

Trading foreign exchange, CFDs, and other leveraged financial instruments involves substantial risk of loss and is not suitable for all investors. The strategies and tools discussed on this page are provided for educational purposes only and do not constitute financial advice, investment recommendations, or solicitation to trade. Always consult a qualified financial adviser before making trading decisions. Past backtest performance is not indicative of future results.

Downloads

← Back to Blog