RobotFX curates the best open-source MetaTrader code to inspire your trading automation.
Stop managing 11 separate iMA/iATR/iRSI handles with 50+ lines of boilerplate. ASQ Indicator Manager wraps 11 built-in indicators into one class with automatic handle creation, bar-based caching, trend voting, market regime classification, and clean getter methods. Three lines replace your entire indicator setup.

FEATURES:
- 11 managed indicators — 3 Moving Averages (EMA fast/med, SMA slow), 3 ATRs (fast 7, standard 14, slow 50), RSI, Stochastic K/D, CCI, MACD (main/signal/histogram), ADX (+DI/-DI)
- Bar-based caching — Update() only copies buffers when a new bar forms. Cached values returned instantly between bars. ForceUpdate() for tick-level precision
- Automatic handle creation and release — CreateHandles() on init, ReleaseHandles() on deinit, no leaks
- Configurable periods for all indicators — SetMAPeriods(), SetRSIPeriod(), SetATRPeriod(), SetADXPeriod(), SetStochSettings(), SetCCIPeriod()
- Trend direction voting — MA alignment + DI crossover + MACD histogram. 2+ votes = confirmed direction (+1/-1/0)
- Market regime classification — 5 regimes: Trending Up, Trending Down, Ranging, Volatile (ATR ratio > 1.5x), Quiet (< 0.5x)
- Overbought/oversold detection — RSI > 70 or StochK > 80 = overbought, RSI < 30 or StochK < 20 = oversold
- Volatility ratio — ATR fast / ATR slow for regime detection
- Trend strength — ADX value, IsTrending() (ADX > 25), IsRanging() (ADX < 20)
- Shift support — all getters accept shift parameter for historical lookback
DEMO INDICATOR INCLUDED:
Drop on any chart to see a live dashboard showing all 11 indicator values organized by category (MAs, Oscillators, ADX/ATR), plus trend direction, market regime, OB/OS status, volatility ratio, and trending/ranging mode.
Protect profits effectively with the smart Trailing Stop Expert Advisor. Advanced trailing options for MT4/MT5. See it in action.

USAGE:
#include "ASQ_IndicatorManager.mqh"
CASQIndicatorManager ind;
ind.SetMAPeriods(8, 21, 50);
ind.Initialize(_Symbol, PERIOD_M5);
ind.Update(); // Call on every tick
double rsi = ind.GetRSI();
int trend = ind.GetTrendDirection(); // +1, -1, or 0
if(ind.IsOverbought()) { /* caution */ }
Place both files in the same folder — compiles instantly, no subfolder setup needed.
This is the open-source indicator engine behind Quant Cristina on the MQL5 Market. Same logic, same accuracy.
FILES:
- ASQ_IndicatorManager.mqh — Library (325 lines)
- ASQ_IndicatorManager_Demo.mq5 — Demo indicator (238 lines)
MetaTrader 5, all brokers, all instruments, all timeframes.
Free and open-source. 563 lines of production MQL5.
AlgoSphere Quant — Precision before profit.
Level up your trading with professional RobotFX expert advisors and indicators. Visit www.robotfx.org for proven MT4/MT5 tools.
71495