Blog / Strategy
Strategy

Andean Oscillator Trend Shift

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 Andean Oscillator Trend Shift is a trend-following trading system for MetaTrader 5 built around the Andean Oscillator, a relatively uncommon indicator introduced by Alex Grover in 2021. Unlike the moving-average, RSI, or Bollinger-band tools that dominate most trading libraries, the Andean Oscillator measures trend strength in a genuinely different way — by tracking the dispersion of price swings on the upside and downside separately. This makes it a useful study for anyone wanting to look beyond the standard toolkit.

At its heart, the indicator maintains running upper and lower envelopes of both the price and the price squared. Because statistical variance can be expressed as the average of the squared values minus the square of the average, combining these envelopes produces an online (bar-by-bar) estimate of the standard deviation of up-moves and down-moves. The strategy calls these two readings the bull and bear components. When a market trends higher, the bull component inflates; when it trends lower, the bear component grows. A smoothed signal line (an exponential moving average of the dominant component) then acts as the trigger for fresh conviction.

This system is designed as a learning tool for traders who already understand basic order execution and want to explore how a variance-based oscillator can define market regime and time entries. It is best suited to those studying trend-following mechanics on liquid instruments, and it is not a shortcut or a hands-off solution. Treat it as a framework for understanding how trend conviction can be quantified and acted upon.

How It Works

The strategy processes each newly closed bar, folds it into the Andean envelopes, recomputes the bull and bear components, and refreshes the EMA signal line. It then checks for a fresh expansion of conviction.

Entry conditions:

Stop-and-reverse logic:

Stop-loss and take-profit logic:

Because the ATR scales the exit distances automatically, the same parameter set can be studied across different volatility environments without manual recalibration.

Andean Oscillator MT5 EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
AndeanLength 25 8 80 Envelope length for the Andean Oscillator. Larger values create slower, smoother bull/bear components and fewer signals.
SignalPeriod 9 3 40 EMA length applied to the larger of the bull/bear components to form the signal (trigger) line.
AtrPeriod 14 5 40 Lookback period for the ATR used to size the stop-loss and take-profit distances.
AtrStopMult 2.0 0.5 6.0 Stop-loss distance expressed as a multiple of ATR.
AtrTpMult 3.0 0.5 10.0 Take-profit distance expressed as a multiple of ATR.
Lots 0.10 0.01 1.00 Order volume (position size) in lots.
Magic 5731 0 9,999,999 Unique identifier so the EA manages only its own trades.

Adjusting AndeanLength and SignalPeriod changes how sensitive the system is: shorter values react faster but produce more noise, while longer values filter for larger, more established moves. The ATR multipliers let you widen or tighten the risk framework independently of the entry logic.

Andean Oscillator MT5 EA — MQL5 source code

Recommended Chart Settings

The Andean Oscillator Trend Shift was designed to be timeframe-agnostic — it reads the primary symbol and timeframe from whatever chart you attach it to, rather than hard-coding a specific setting. In development and testing it was oriented toward trending FX majors or metals such as EURUSD or XAUUSD on the H1 or H4 timeframes, where directional swings tend to be clean enough for a variance-based oscillator to distinguish trend from chop.

That said, results will vary considerably across different market conditions, symbols, and timeframes. A setting that behaves well on a trending metal during one period may perform very differently on a range-bound currency pair in another. Always test any configuration on your own broker's data before drawing conclusions, since spreads, swap, and data feed differences all affect outcomes.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Every strategy has strengths and blind spots, and understanding both is part of using any tool responsibly.

Strengths of this approach:

Known limitations:

The most productive way to use this EA is as a case study in how a variance-based oscillator defines regime and times entries — not as a set-and-forget product. Observe how it behaves in different conditions and note where its assumptions break down.

Risk Management Tips

Sound risk management matters more than any single indicator. Whatever strategy you study, these general principles apply:

Approaching automated trading with discipline, realistic expectations, and continuous learning is far more valuable than chasing any specific setup.

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