FXTAA Русская версия

Spread indicator for MT4 and MT5

The spread is the only cost you pay on every single trade, and the terminal hides it in the Market Watch column you never look at. Putting it on the chart takes a dozen lines.

Updated: 2026-09-23

Spread is the gap between the price you can sell at and the price you can buy at. On a quiet EURUSD morning it might be half a pip; during a rate decision the same pair can show twenty. If your stop is fifteen pips, that difference is not a detail.

Two ways to read it, and they disagree

MetaTrader exposes the spread twice, and the values do not always match.

// 1. What the broker declares
double declared = MarketInfo(Symbol(), MODE_SPREAD);          // in points

// 2. What the current quote actually implies
double actual = (Ask - Bid) / Point;

On a fixed-spread account the first number is a constant and the second tracks it. On a variable-spread account MODE_SPREAD may lag or return a nominal value while the live quote has already moved. Trust Ask - Bid — it is what you will actually be filled at.

On five-digit brokers one pip is ten points. A spread of 12 points on EURUSD is 1.2 pips, not 12. Mixing the two is the most common reason a spread reading looks absurd.

A minimal chart display

// SpreadInfo.mq4 — live spread in the corner of the chart
#property indicator_chart_window

input int  CornerX = 10;
input int  CornerY = 18;
input color NormalColor = clrGray;
input color WideColor   = clrOrangeRed;
input double WideThresholdPips = 2.0;

string tag = "spreadinfo_label";

int OnInit()
{
   ObjectCreate(0, tag, OBJ_LABEL, 0, 0, 0);
   ObjectSetInteger(0, tag, OBJPROP_CORNER, CORNER_LEFT_UPPER);
   ObjectSetInteger(0, tag, OBJPROP_XDISTANCE, CornerX);
   ObjectSetInteger(0, tag, OBJPROP_YDISTANCE, CornerY);
   return(INIT_SUCCEEDED);
}

void OnDeinit(const int reason) { ObjectDelete(0, tag); }

int OnCalculate(const int rates_total, const int prev_calculated,
                const datetime &time[], const double &open[],
                const double &high[], const double &low[],
                const double &close[], const long &tick_volume[],
                const long &volume[], const int &spread[])
{
   double pts  = (Ask - Bid) / Point;
   double pips = (Digits == 3 || Digits == 5) ? pts / 10.0 : pts;

   ObjectSetString(0, tag, OBJPROP_TEXT, 0,
        StringFormat("spread %.1f pips (%.0f pts)", pips, pts));
   ObjectSetInteger(0, tag, OBJPROP_COLOR,
        pips >= WideThresholdPips ? WideColor : NormalColor);
   return(rates_total);
}

In MQL5 the same idea uses SymbolInfoInteger(_Symbol, SYMBOL_SPREAD) and SymbolInfoDouble for Ask and Bid, but the pip arithmetic is identical.

When spread blows out

Logging it is more useful than watching it

A label tells you the spread now. What you actually want to know is what it usually is at the hour you trade. Write the value to a file every minute for a fortnight, then look at the distribution by hour.

Most traders discover two things: their broker's typical spread is worse than the marketing figure, and the hour they like trading is not the hour with the best conditions.

A "zero spread" account is not free. The cost moved into commission, and sometimes it moved into a worse fill. Compare total cost per round turn, not the spread alone.

What to do with the number

Use it as a gate rather than a display. An expert advisor should refuse to open when the spread exceeds a threshold, and a discretionary trader should treat a red label as a reason to wait thirty seconds.

Spread behaviour differs enormously between brokers, and the marketing number rarely survives contact with a live account — which is why it is worth logging on a demo before committing. Platform-side details of one widely used option, including account types and conditions, are in this RoboForex review.