Exotic pairs have wildly variable spreads depending on the session and market conditions. Instead of guessing when liquidity is good, let's
By Coder•June 25, 2026
Exotic pairs have wildly variable spreads depending on the session and market conditions. Instead of guessing when liquidity is good, let's automate it. In this guide, you'll build a custom MT5 indicator that tracks real-time spread, plots a rolling average, and color-codes the chart background green/yellow/red.Indicator StructureThe core logic uses SymbolInfoInteger and SymbolInfoDouble to fetch SYMBOLSPREAD on every tick. Store the last N spread values in a ring buffer, calculate the rolling mean and standard deviation, and classify: green (spread 2σ). Draw rectangles on the chart background.MQL5 Skeletonint OnCalculate(...) { double spread = SymbolInfoDouble(Symbol, SYMBOLSPREAD); ArrayFill(spreadBuffer, 0, 1, spread); double...
0 Comments
Refreshing...
