Loading…

Stop Level To Spread Census

A stop level of five points sounds tiny on an index and enormous on a tight major FX pair - comparing raw point counts across instruments tells a trader almost nothing. What actually matters is how that stop level, plus the spread that has to be crossed on top of it, compares to how far the symbol typically moves in a day. A symbol where stop level plus spread eats forty percent of the average daily range leaves very little room to work with; one where it eats half a percent barely constrains anything. This script computes exactly that ratio for every symbol currently in Market Watch (or a supplied list): the minimum stop distance (MODE_STOPLEVEL) plus the current spread (MODE_SPREAD), expressed as a percentage of the previous completed trading day's high-low range, both measured in points so the comparison is unit-consistent regardless of each symbol's own digit count. Symbols are then ranked from most to least restrictive by that percentage, so the worst offenders in a Market Watch list surface immediately instead of requiring a manual pass symbol by symbol. Symbols with no usable daily history yet - freshly added to Market Watch, or a market that has not printed a completed day - are reported separately rather than silently dropped from the list or scored with a fabricated range, since a missing range is a genuinely different situation from a symbol that is simply not restrictive. Notes and limitations - Restrictiveness is measured against the PREVIOUS completed trading day's range where available, falling back to the current in-progress day only when a completed day is not yet in history - a symbol censused very early in its first trading day may show a range that is still growing. - Stop level and spread are read at the moment the script runs; spread in particular varies through the trading session, so the ranking is a snapshot, not an all-day average. - Symbols with no usable daily range (insufficient D1 history) are listed separately at the bottom of the report and excluded from the ranking rather than scored. - This is a one-shot census, not a live sampler - it does not watch for changes after it finishes. Re-run it to refresh the ranking.

Script · MT5 · v1.0 · Free

About Stop Level To Spread Census

Stop Level To Spread Census is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 2 settings, such as Symbol list and Save csv. MQL source code included.

Files in the download: StopLevelSpreadCensus.ex5, StopLevelSpreadCensus.mq5, StopLevelSpreadCensus.txt.

Settings

SettingDefaultWhat it does
Symbol listComma-separated symbols ("" = everything in Market Watch)
Save csvtrueWrite the full ranked table to a CSV

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Scripts.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the script onto a chart to run it once.

Download the PDF guide

Tags: Alerts · MT5 Script · MQL5 Source Code

MQL4 & MQL5 scripts · PolyMaria