Join our fan page
PropSpread: time-weighted spread monitor with ATR context, alert and CSV log - expert for MetaTrader 5
- Published by:
-
Timon-pascal Krueger
Systematic index trader and MT5 developer from Germany.
I trade my own capital and funded accounts, including a live FTMO account, with time anchored breakout strategies on DAX, FTSE, Dow and Nasdaq. - Views:
- 12
- Published:
-
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance
Most spread tools average over ticks. That hides the numbers a trader actually pays, because quiet minutes produce few ticks and are underweighted, while the ugly spreads live exactly there: the rollover, the minutes before a cash open, thin nights. PropSpread samples the spread once per second on a timer instead, so every minute counts the same regardless of activity. It is a measurement tool for prop firm and funded accounts, where a large part of a daily loss is spread paid at the wrong hour.
The panel shows the live spread in broker points, as a raw price difference and in the symbol's natural unit. The unit is derived from the symbol's calculation mode and digits as reported by the broker: pips on Forex symbols (10 points on 3 and 5 digit quotes, 1 point otherwise), index points on CFD index symbols (10^Digits points), price units on everything else. The legend is always printed, for example "1 index pt = 10 pts" on a one digit index quote or "1 index pt = 100 pts" on a two digit quote, so you can verify the conversion instead of trusting it.

PropSpread on GER40 M5: spread in points and index points, rolling and session statistics, ATR context
What the panel shows
- Rolling statistics over a window you choose (default 60 minutes): minimum, average, median and maximum, plus the share of time the spread stayed above your alert threshold. The buffer holds one sample per second, capped at 24 hours.
- Session statistics since server midnight: count, average, minimum and maximum for the broker's current trading day, so you see how the night and the open behaved before you trade.
- Spread as percent of ATR for a configurable period and timeframe, taken from the last closed bar. A 12 point spread means something different on a 50 point day than on a 500 point day. If the ATR indicator is not available the panel says so and the utility keeps running.
- Alert when the spread stays above a threshold in points for longer than N seconds, with a cooldown so one bad minute produces one alert, not sixty. Popup and push notification are separate switches. Rows above twice the rolling average turn orange, rows above the threshold red.
- Optional CSV log, one row every N seconds into MQL5\Files\PropSpread\<symbol>_<yyyymm>.csv with server time, symbol, spread in points, spread as price difference, bid, ask, ATR and spread as percent of ATR. The file is opened, appended and closed per row, so a terminal crash never loses it; a new month starts a new file.
- Panel colours adapt to light and dark charts, any of the four corners, with X and Y offsets.
The alert is deliberately an absolute threshold with a hold time, not "above two times the average". Relative alerts fire constantly in quiet sessions where the average itself is tiny, which is exactly when a trader would switch them off. The colouring keeps the relative information visible without producing noise.

Alert on US30 M5 with a deliberately low threshold: the spread row turns red, the alert row counts the event, one journal line per alert
Input parameters
| Parameter | Default | Meaning |
| InpWindowMinutes | 60 | Rolling window in minutes, one sample per second, maximum 1440 |
| InpATRPeriod | 14 | ATR period for the spread to ATR ratio |
| InpATRTimeframe | current | ATR timeframe |
| InpAlertThreshold | 0 | Alert threshold in points, 0 switches the alert off |
| InpAlertHoldSec | 5 | The spread must stay above the threshold for this many seconds |
| InpAlertCooldownSec | 300 | Minimum seconds between two alerts |
| InpAlertPopup | true | Popup alert |
| InpAlertPush | false | Push notification, needs a MetaQuotes ID in the terminal |
| InpLogCSV | false | Write the CSV log |
| InpLogEverySec | 10 | Seconds between two CSV rows |
| InpPanelCorner | right upper | Panel corner |
| InpPanelX | 12 | Panel X offset in pixels |
| InpPanelY | 22 | Panel Y offset in pixels |
Symbol and timeframe
Any symbol works; the utility is most useful on index CFDs (GER40, US30, NAS100) and major FX pairs, where spread widening around the open and the rollover decides whether a stop is realistic. The timeframe only matters for the ATR context; M5 or M15 is a sensible default for intraday work. Attach it to one chart per symbol you trade.
Limitations
- Samples are snapshots once per second. Sub-second spikes during news are caught only if they coincide with a sample. This is a monitor, not a tick recorder.
- "Session" means the broker's server day, not a prop firm's reset time.
- Unit detection follows the symbol's calculation mode as reported by the broker. Exotic configurations may land in "price units"; the legend tells you what was detected.
- In the strategy tester popups and push notifications are suppressed and the CSV lands in the agent's files folder.
- Panel colours are chosen when the utility is attached; re-attach after changing the chart colour scheme.
Quick start
- Attach PropSpread to any chart and read the spread in your unit and the rolling statistics.
- Set InpAlertThreshold in points if you want alerts; the hold time and cooldown defaults are fine to start with.
- Switch on InpLogCSV if you want to build a spread profile of your broker by hour and session.
The code is the free companion of my prop firm utilities in the Market (PropGuardian, PropSizer). It works on its own and needs nothing else.
Asian Range Sweep Indicator with a Built-In Win Rate Scorecard
Marks the Asian session range, signals when London or New York sweeps one side of it and reverses, and keeps a scorecard of how every past signal ended in R, spread included. Non-repainting, with buffers ready for an Expert Advisor.
SMC Gold: Liquidity Sweep and Order Block EA for XAUUSD M15
An intraday Smart Money Concepts EA for gold. It waits for price to sweep a recent swing high or low, confirms the reversal with a close through the sweep candle's body, and trades only with the H1 trend. Backtested on XAUUSD M15 over 2025 and 2026 at 1% risk per trade.
Accelerator Oscillator (AC)
The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.
MACD Signals
Indicator edition for new platform.