Stop Distance Advisor
A stop distance chosen from habit or a round pip number carries no information about whether it actually fits the symbol's current behaviour. Ten pips is generous on a quiet pair and reckless on a volatile one; the same number can be right on Monday and wrong by Friday if volatility has expanded. This indicator builds a distribution of adverse noise directly from price history: for every closed bar, it looks InpHorizonBars ahead and records the worst excursion a flat entry at that bar's close would have had to survive, in either direction, whichever was larger. That gives a direction-agnostic noise sample per bar, plotted as a histogram, drawn from the last InpSamplePeriod bars. InpStopPips is then ranked as a percentile inside that distribution: a stop smaller than most of the sampled noise sits at a low percentile and is graded SUICIDAL, because ordinary chop alone would likely have taken it out; a stop comfortably past most sampled noise is graded SURVIVABLE. This says nothing about whether the trade has positive expectancy - only whether the stop distance itself is a reasonable fit for how this symbol actually moves. Notes and limitations - The noise sample is direction-agnostic - it takes the worse of the up-excursion and down-excursion at each bar - so it grades the raw distance only, not whether a long or a short specifically would have survived. - InpHorizonBars is a fixed lookahead window, not a stop-hunting simulation; a trade held longer than InpHorizonBars can still be stopped out by noise this indicator did not sample. - The verdict recomputes once per closed bar, not per tick, so it reflects the noise distribution as of the last completed bar, not the current partially-formed one. - Grading is purely statistical, not predictive - a SURVIVABLE grade describes recent history, not a guarantee against an unusually large future move. - Needs InpHorizonBars + InpSamplePeriod + 2 bars of history before the histogram and verdict appear.
Indicator · MT4 · v1.0 · Free
About Stop Distance Advisor
Stop Distance Advisor is an indicator for MetaTrader 4. It has 5 settings, such as Stop pips, Horizon bars and Sample period. MQL source code included.
Files in the download: StopDistanceAdvisor.mq4, StopDistanceAdvisor.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Stop pips | 20.0 | Proposed stop distance to grade, in pips |
| Horizon bars | 10 | Bars ahead each noise sample looks for its worst excursion |
| Sample period | 500 | How many closed bars make up the noise distribution |
| Suicidal pct | 40.0 | Percentile at/below which the stop is graded SUICIDAL |
| Survivable pct | 70.0 | Percentile at/above which the stop is graded SURVIVABLE |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the indicator from the Navigator onto a chart and adjust the settings.
Tags: MT4 Indicator · MQL4 Source Code