Skip to content
All library documents

Online Logistic Regression for Adaptive Trade Signal Filtering

Article MQL5 articles

Summary

This article explains an MQL5 trade filter that uses online logistic regression to estimate whether a base signal will win. It constructs scaled features from RSI, EMA distance, relative ATR, candle shape, MACD, and volume, then scores an EMA crossover before allowing a trade. After closure, the EA labels the position using profit after swap and commission and applies one stochastic gradient update with L2 regularization. It also describes persisting model weights, ATR-based stops and sizing, and an indicator that plots estimates from saved weights.

Evidence is presented through synthetic experiments comparing online learning with frozen and retrained alternatives, alongside feature ablation and calibration diagnostics. These experiments are intended to demonstrate the update mechanism and compare adaptation policies under a simulated regime shift. They do not establish a durable trading edge: the article explicitly leaves real-market validation, costs and slippage stress, walk-forward evaluation, and multi-instrument robustness for future work. The compact linear model and starter feature set also omit interactions and some market context.

Key ideas

  • The model estimates the probability that a base trading signal will be profitable from scaled market features.
  • It updates its logistic-regression weights after each closed trade using the realized net outcome.
  • L2 regularization and optional learning-rate decay are intended to limit overreaction to noisy trades.
  • Synthetic tests compare online updates with frozen and periodically retrained models, but do not prove live-market profitability.
  • ATR-based stops and position sizing help adapt trade management to differing instrument volatility and tick values.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.