Volatility Spike Stop Tightener
- Utilities
-
AL MOOSAWI ABDULLAH JAFFER BAQER
To trade successfully we need to go through the proven path that others had gone and reached!
Here are 17 quotes from such successful investors:
1- Limit your size in any position so that fear does not become the prevailing instinct guiding your judgment.
Joe Vidich - Version: 1.0
- Activations: 5
Watch it before you rely on it: load Volatility Spike Stop Tightener into the Strategy Tester, switch on visual mode and watch the volatility meter fill, the spike trigger fire and the stop-loss of the demo position jump closer to price the moment the market turns violent.
WHEN THE MARKET EXPLODES, YOUR STOPS MOVE IN BEFORE THE PROFIT MOVES OUT.
Volatility Spike Stop Tightener is a utility Expert Advisor for MetaTrader 5. It does not look for entries and it does not trade for you. It has one job: it measures how wild the market is right now compared with its normal ATR, and when a bar or a fast burst of ticks becomes a multiple of that normal range, it pulls the stop-loss of the positions you put in scope closer to price. Stops are only ever tightened, never loosened, never removed.
At a glance
• Spike detection by the forming bar range and by a Fast Move window of a few seconds, both measured against the ATR of closed bars.
• Three ways to place the new stop: an ATR distance from price, a percent of the open profit locked in, or the tighter of the two.
• Spike-scaled distance: the stronger the spike, the closer the stop.
• Optional break-even floor so a winner that is tightened can no longer turn into a loser.
• Winners-only mode with a minimum profit in points, or protection for every position.
• An early warning level, a cooldown between passes, a spread filter and a two-click Tighten Now.
• Works on the chart symbol, with any magic, one magic number or manual trades only.
• Not a grid, no martingale, no averaging, no DLLs, no extra files.
QUICK START
Attach it to the chart of the symbol you trade, for example EURUSD H1. Leave the defaults: ATR 14 on the chart timeframe, spike trigger 2.0 times ATR, warning at 1.4 times ATR, Fast Move window 60 seconds, method "the tighter of ATR distance and profit lock", winners only above 50 points. Make sure Algo Trading is switched on in the terminal. Read the VOLATILITY METER bar and the ON SPIKE column of the panel: that column shows the exact stop each position would receive if a spike happened right now. That is all it needs.
Why spikes are where profits disappear
Most traders set a stop when they open a trade and then forget it. That stop was chosen for a normal market. Then a central bank speaks, a data release lands, liquidity vanishes for a minute, and price travels in ten seconds what it usually travels in an hour. A trade that was fifty points in profit is back at its entry before you have even seen the candle, or it runs straight through to the original stop. The analysis was fine. The stop was simply too far away for the moment the market was in. Volatility Spike Stop Tightener watches that moment for you and reacts within the same second.
What is new and different here
Most trailing tools follow price at a fixed distance and do not care whether the market is calm or on fire. This utility only acts when volatility is abnormal, and it acts in proportion to how abnormal it is.
Fast Move Detector. A one-hour candle can look ordinary for the first twenty minutes and still hide a violent burst inside it. The utility keeps a rolling window of ticks (60 seconds by default) and measures the high-low distance inside it. A spike is detected when either the forming bar range or this fast move reaches your trigger, so a sudden burst is caught before the bar itself looks unusual.
Spike-scaled distance. With scaling on, the ATR distance is divided by how far the ratio is above the trigger. A spike at exactly 2.0 times ATR uses your full distance; a spike at 4.0 times ATR uses half of it. Bigger shock, tighter stop.
Preview column. The panel table shows, for every in-scope position, the current stop and the stop a spike would set right now, or HOLD when no change would be made. You always know what will happen before it happens.
How one spike is handled
1. Measuring. Every tick and every second, the utility reads the ATR of the last closed bars, the range of the forming bar and the fast move inside the window, and computes the spike ratio: the larger of the two ranges divided by ATR.
2. Warning. When the ratio reaches the warning level, a pop-up and, if enabled, a push message tell you that volatility is rising. It is sent once per bar.
3. Trigger. When the ratio reaches the spike trigger and no cooldown is running, a tighten pass begins.
4. The new stop. For each position in scope the utility calculates the candidate stop with your method, applies the break-even floor if you allowed it, keeps it outside the broker's stops level and freeze level, and rounds it to the symbol tick size.
5. Only better. The stop is moved only if it is closer to price than the current one by at least your minimum step. A stop is never moved backwards, and the take-profit is left exactly where it was.
6. Cooldown. After a pass, the utility waits for the cooldown seconds before it may tighten again. If the spike continues, the next pass follows price further; if the market calms down, the tightened stops simply stay where they are.
7. The panel and the journal record the time, the ratio and how many stops were moved.
The panel
The panel sits in the top-left corner and leaves the right side of the chart and the price scale clear. Its header carries the product name, the version, the symbol, the ATR timeframe and the magic scope, and a status pill: CALM, RISING, SPIKE, COOLDOWN or PAUSED. The VOLATILITY METER is a progress bar that fills from left to right as the spike ratio approaches the trigger, green when calm, amber above the warning mark, red at the trigger; a thin amber marker shows where the warning level sits. The SPIKE WATCH block shows the spike ratio, the ATR in price and points, the bar range, the fast move, the tighten method, which positions it applies to, the positions in scope with their lots and net result, today's number of spikes with the peak ratio, and the last pass. The IN-SCOPE POSITIONS table lists side, lots, net, current stop and the ON SPIKE preview. A coloured banner states the situation in one line. Three buttons give you ARMED / PAUSED, WINNERS ONLY / ALL POSITIONS and TIGHTEN NOW (press twice within six seconds to confirm). The panel can be dragged with MOVE and minimised with the small button, it measures its own text and shrinks to fit smaller screens, and it is not drawn at all in a non-visual backtest, so tests and optimisations run at full speed.
Safety in your hands
It only touches what you put in scope: positions on the chart symbol that pass the magic filter. Other symbols are never touched; run one copy per chart if you want several symbols protected.
It only ever moves a stop-loss closer to price. It never widens a stop, never removes one, never changes a take-profit, never closes or opens a position on a live or demo account.
In the Strategy Tester only, an optional small demo position is opened once a day so a tighten can be watched; switch that off if you test it together with your own EA.
PAUSED stops all tightening at once. WINNERS ONLY keeps losing trades untouched.
Every modification is written to the Experts journal with the ticket, the old stop, the new stop and the reason.
Every setting explained
Detection - what counts as a spike
ATR and bar range timeframe (InpAtrTF) - the timeframe used for the ATR and for the forming bar range. Current means the chart timeframe.
ATR period (InpAtrPeriod) - number of closed bars in the ATR (14). The ATR of closed bars is used, so the spike itself does not inflate the yardstick.
Spike trigger (InpSpikeMult) - a tighten pass starts when range divided by ATR is at or above this value (2.0).
Early warning (InpWarnMult) - an alert level below the trigger (1.4); 0 switches it off.
Measure the forming bar range (InpUseBarRange) - include the high-low range of the current bar in the spike ratio (on).
Fast move window (InpFastWindowSec) - length of the rolling tick window in seconds (60); the high-low distance inside it counts as a fast move. 0 switches it off.
Tighten - where the new stop goes
Tighten method (InpMode) - ATR distance from price, Lock a percent of the open profit, or The tighter of both (default).
ATR distance (InpTrailAtr) - how many ATR behind the current price the new stop is placed (0.8).
Stronger spike = closer stop (InpScaleBySpike) - divides the ATR distance by how far the ratio exceeds the trigger (on).
Profit lock percent (InpLockPercent) - percent of the open profit, measured from the entry, that the stop protects (50).
Break-even floor (InpBreakevenFloor) - for winners, the new stop is at least at the entry plus the offset (on).
Break-even offset (InpBEOffsetPoints) - points beyond the entry for the floor, to cover costs (10).
Only tighten winners (InpProfitOnly) - losing positions are left alone (on). Switch off to also pull in the stop of losing trades and cut the damage of a spike against you.
Minimum profit (InpMinProfitPoints) - a winner must be at least this many points in profit before it is tightened (50).
Minimum step (InpMinStepPoints) - a stop is moved only if the new one is better by at least this many points (5), which avoids flooding the broker with tiny changes.
Filter - which trades are in scope
Magic filter (InpMagicFilter) - any magic (manual and EA trades), only the magic number below, or manual trades only.
Magic number (InpMagic) - the magic used by the "only the magic number" filter.
Timing
Cooldown (InpCooldownSec) - seconds between two tighten passes (120).
Max spread (InpMaxSpread) - a pass is skipped while the spread is above this many points; 0 never skips.
Alerts
Pop-up alert (InpAlertPopup) - terminal alert window for warnings and tightens (on).
Push notification (InpAlertPush) - message to the MetaTrader app on your phone (off; set up notifications in the terminal options first).
Alert at the warning level (InpAlertOnWarn) - also alert when the early warning level is reached (on).
Panel
Show the panel (ShowPanel) - on or off.
Panel X / Panel Y (PanelX, PanelY) - distance from the left and top edge in pixels.
Base font size (PanelFontSize) - 9 by default; the panel shrinks itself further when the chart is small.
Rows in the table (MaxTableRows) - how many positions are listed (6).
Strategy Tester demo
Demo position (InpTesterDemo) - in the Strategy Tester only, opens one minimum-lot position per day, alternating buy and sell, when none is in scope, so the tightening can be watched. It has no effect on a live or demo account.
How to use it well
Swing and position traders: keep the defaults on H1 or H4; a spike of twice the normal hourly range is rare and almost always news-driven.
Scalpers: use M5 or M15 as the ATR timeframe, a shorter fast window such as 20 seconds, and a trigger of 2.5 to avoid normal session-open noise.
Traders using EAs: set the magic filter to your EA's magic number, so manual trades are left alone, and keep WINNERS ONLY on so the EA's own risk management is not changed for losing trades.
News traders: lower the cooldown to 30 seconds so the stop follows a running spike more closely.
Prop firm accounts: switch off WINNERS ONLY and use the ATR method, so even a position against you gets a closer stop when the market goes wild, which protects the daily loss limit.
Test it in the Strategy Tester
Open the Strategy Tester, choose Volatility Spike Stop Tightener, any symbol such as EURUSD, H1, "1 minute OHLC" or "Every tick", and switch on visual mode. Keep the tester demo on. You will see a small position open, the volatility meter react to each bar, and the ON SPIKE preview change as profit grows. When a strong candle arrives, the stop line jumps closer to price and the Experts journal shows the old and the new stop. Try different triggers and methods; it costs nothing and shows you exactly how it behaves on your symbol before you attach it to a live chart.
Your honest review helps
If the utility protected a trade for you, or if you feel something could be better, please leave an honest review on the product page. Every review is read and helps shape the next version for every user.
Not a grid, no martingale, no averaging. Trading carries risk; a tightened stop can be reached by normal price movement after a spike, and gaps can jump over any stop.
