Adaptive stop calculator
A stop-width multiplier from 1.0 to 3.0 that widens on price-spread spikes and tightens on strong momentum.
AdaptiveStopCalculator returns a multiplier, not a price, meant to scale a stop distance. It starts at 2.0 and multiplies by 1.3 when the spread of closes is above 1.5 times its window average, by 1.15 above 1.2 times, or by 0.85 below 0.8 times. It then multiplies by 0.9 when the ROC input is above 0.02 in size, or by 1.1 when it is below 0.005, and clamps the result to 1.0 to 3.0; the possible products span only 1.53 to 2.86, so the clamp never acts.
How to read it
- The line sits in its own pane below the price. On the sample it stayed between 1.53 and 2.34.
- 2.0 is the neutral base. Below it the stop is tighter than base; above it the stop is wider.
- Above 2.0 means the price spread is running above 1.2 times its recent average, or momentum is weak.
- It does not follow price (correlation near zero on the sample), so read regime changes, not direction.
What it outputs
- Stop multiplier
- Multiplier from 1.0 to 3.0 to scale a stop distance. 2.0 is neutral. It is not a price level.
Settings
- window
- Bars used for both the price-spread measure and its baseline average. Shorter windows make the ratio react within minutes and swing more, so the multiplier jumps between regimes. Longer windows give a steadier baseline and move slowly.
Pitfalls
- The spread is the standard deviation of raw close prices, not of returns, so a steady drift counts as spread even when every bar is calm.
- The ATR input is only checked for readiness and never changes the value. Warm-up bars return a flat 2.0, which looks like a real reading.
- The sample median of 1.8 equals 2.0 x 1.0 x 0.9, so on the typical bar the ROC input was above 0.02 in size. Check the ROC input's window and units before trusting the momentum part.