MT5 Strategy Lab

Gaussian Signal Processing + HMM Regime Detection + Multi-Strategy Portfolio

Gaussian IIR Filter Hidden Markov Model MACD Momentum ATR Risk Management MetaTrader 5 Python

Strategy Parameters

80
2.0x
5.0x
$30
Net Profit
Total Trades
Win Rate
Profit Factor
Max Drawdown
Sharpe Ratio

Price + Gaussian Filter

Equity Curve

HMM Regime Detection

Strong Bull Mild Bull Neutral Mild Bear Strong Bear

Trade Log (Last 20)

Gaussian IIR Filter — The Math

beta = (1 - cos(2*PI/period)) / (2^(1/poles) - 1)
alpha = -beta + sqrt(beta^2 + 2*beta)

// Applied recursively (4 poles):
for each pole:
  output[i] = alpha * input[i] + (1-alpha) * output[i-1]

John Ehlers' multi-pole recursive IIR filter approximates a true Gaussian distribution curve. 4-pole version provides maximum smoothing with minimal lag — significantly outperforms EMA/SMA for trend detection.

Why This Works

Traditional moving averages (EMA, SMA) introduce significant lag or noise. The Gaussian filter mathematically separates signal from noise by convolving price with a bell curve — heavy weight on recent bars, exponentially decaying on older bars. Combined with MACD momentum confirmation and ATR-based risk management, this creates a robust trend-following system.

Built by Vinukevin Diesel S P | GitHub Repository

Educational project — past backtest performance does not guarantee future results.