Stop Loosening Blocker
- 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
See it work before you trust it: load Stop Loosening Blocker into the Strategy Tester, switch on visual mode and watch a demo trade open with a stop-loss, then see the stop pushed 200 points further away on purpose and put straight back to its locked level a moment later.
A STOP-LOSS IS A PROMISE YOU MADE TO YOURSELF. THIS UTILITY MAKES SURE YOU KEEP IT.
Stop Loosening Blocker is a utility Expert Advisor for MetaTrader 5. It does not search for entries and it does not open trades for you. It remembers the tightest stop-loss each of your trades has ever had, its locked stop, and the moment that stop is moved further away from the price, or removed, it puts the locked stop back. A stop can always be tightened. It can never be loosened again. The most expensive habit in trading, "just a little more room", is simply taken off the table.
At a glance
• A locked stop for every position in scope: the tightest stop-loss the trade has ever had.
• Any move of the stop further away, or a removed stop, is reverted to the locked level within a second.
• Tightening is always allowed and becomes the new locked level automatically.
• A grace window after the trade opens, so you can place and adjust your first stop freely.
• A tolerance in points, so broker rounding or a one-point correction is never treated as loosening.
• Passed-stop exit: if price has already crossed the locked stop when a loosening is found, the trade is closed exactly as the original stop would have done.
• A fight limit, so the utility never enters an endless modify loop with another Expert Advisor.
• Lock memory: locked stops survive a terminal restart, a profile change or a chart switch.
• Alert only mode, a lock coverage meter and a live table with LOCKED, STOP, ROOM and STATE for every trade.
• Chart symbol only or every symbol of the account, 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 any chart, for example EURUSD H1, and make sure Algo Trading is on. Keep the defaults: a 60 second grace window after each trade opens, a tolerance of 2 points, removed stops restored, passed stops closed, a fight limit of 5 reverts per trade and lock memory on. Open a trade with a stop-loss, wait one minute, then try to drag the stop further away. It jumps back. Drag it closer to the price instead and it stays there, and that new level is now the one that is locked.
Why loosening a stop is the real danger
Most large losses do not come from a bad entry. They come from a good plan that was abandoned under pressure. The trade goes against you, the stop gets close, and the stop is dragged a little lower "to give it room". Then a little lower again. Then it is removed. A small planned loss turns into the loss that ruins the week or the account. Every trading book warns about it, every trader knows it, and almost everyone does it at least once. A normal stop-loss cannot protect you from this, because the person who can move it is you. Stop Loosening Blocker removes that option at the moment you are least able to judge it.
What is new and different here
Tighten only, by design. Other stop tools move your stop for you on a fixed rule. This one does not decide where your stop should be; you do. It only makes sure that whatever level you reach can never be undone in the wrong direction. Your trailing, your break-even moves, your manual adjustments all keep working; only the loosening is blocked.
Grace window. A brand new trade often needs a few seconds to get its stop right: a typo, a wrong click, a stop placed before the spread was checked. For the number of seconds you choose, the trade can be adjusted freely. After that the tightest stop is locked.
Passed-stop exit. If the stop was moved away and price has already travelled beyond the locked level, simply restoring the stop is impossible: the broker would reject a stop on the wrong side of price. Here the utility does what the original stop would have done and closes the trade. You can switch this off and receive an alert instead.
Fight limit. When a position is also managed by another Expert Advisor that insists on its own wider stop, two programs could modify the same order forever. After the number of reverts you allow, that single trade is switched to alert only, the conflict is reported in the journal, and every other trade stays fully protected.
Lock memory. Locked stops are stored in terminal global variables, keyed by account and ticket. Restart MetaTrader, change the chart or reload the utility and it continues with the same locks, instead of accepting a stop that was loosened while it was switched off.
Lock coverage meter. A progress bar shows how many of the trades in scope have a locked stop, together with the closest distance between price and a locked stop, and a warning banner counts trades that have no stop-loss at all.
How one trade is handled
1. Grace. A new position is listed as GRACE for the grace window. Its stop can be placed, moved or removed freely and nothing is locked.
2. Locking. After the grace window the current stop-loss becomes the locked stop and the state turns to LOCKED. A trade without any stop is listed as NO SL and is waited for; as soon as a stop is added it is locked.
3. Tightening. Every time the stop moves closer to the price, for example by your own trailing or a break-even move, the new level becomes the locked stop.
4. Detection. On every tick and every second the current stop is compared with the locked stop. A move further away by more than the tolerance, or a removed stop, is a loosening.
5. Revert. The locked stop is sent back to the broker, the take-profit is left exactly as it is, and the action is counted in TODAY and shown as LAST ACTION.
6. Passed stop. If price is already beyond the locked stop, the position is closed when the passed-stop exit is on, or an alert is sent when it is off.
7. Stops level. If the locked stop is still on the right side of price but inside the broker's stops or freeze level, the utility waits and tries again on the next pass instead of sending a request the server would reject.
8. Fight limit. After the allowed number of reverts on one trade, further loosening on that trade is only reported.
The panel
The panel opens in the top left corner and uses the same dark card style as the other tools of this seller. It measures its own text and scales its font and table rows to the chart, so nothing is cut off on a small screen, and nothing is placed on the right side of the chart where the price scale lives. Drag it with MOVE, fold it with the minus button.
• Header: product name, version, symbol and magic scope and a status pill: BLOCKING, WAITING, ALERT ONLY or PAUSED.
• LOCK COVERAGE: trades with a locked stop out of all trades in scope, plus the closest room in points between price and a locked stop.
• STOP DISCIPLINE: grace window, tolerance, action on loosening, removed stops, passed stops, fight limit, in-scope positions, lots and floating result, today's reverts, alerts, closes and tightenings, memory state and the last action.
• IN-SCOPE POSITIONS: side, lots, locked stop, current stop, room in points and state for each trade: GRACE, NO SL, WAIT, LOCKED or LOOSE.
• Banner: one line that tells you the situation at a glance, for example trades that still have no stop-loss.
• QUICK CONTROLS: ARMED or PAUSED, REVERT or ALERT ONLY, and RESET LOCKS with a second click to confirm, which makes the current stops the new reference.
Inputs explained
LOCK - WHEN A STOP IS LOCKED
InpGraceSec, default 60. Seconds after a trade opens during which its stop can be moved freely. Set 0 to lock the first stop at once.
InpTolerancePts, default 2. A loosening up to this many points is ignored. It absorbs broker rounding and tiny corrections. Set 0 for zero tolerance.
InpBlockRemoval, default true. When on, a stop that is deleted after it was locked is restored. When off, removing the stop is allowed and only moving it away is blocked.
ACTION - WHAT HAPPENS ON A LOOSENING
InpRevert, default true. When on, the locked stop is put back. When off, the utility only alerts and accepts the new stop as the reference, so you are warned once per loosening and not every second.
InpCloseIfPassed, default true. When price is already beyond the locked stop at the moment a loosening is found, close the trade as the original stop would have. When off, the trade is kept open and you receive an alert.
InpMaxReverts, default 5. The fight limit: after this many reverts on one trade, that trade is switched to alert only. Set 0 for no limit.
FILTER - WHICH TRADES ARE IN SCOPE
InpSymbolScope, default chart symbol only. Chart symbol only, or all symbols of the account from a single chart.
InpMagicFilter, default any magic. Any magic number including manual trades, only the magic number below, or only manual trades with magic 0.
InpMagic, default 0. The magic number used when the filter is set to only the magic number.
MEMORY
InpRememberLocks, default true. Keeps locked stops in terminal global variables so they survive a restart. They are removed automatically when the position closes. In the Strategy Tester memory is always session only.
ALERTS
InpAlertPopup, default true. Pop-up alert for every revert, close or alert-only event.
InpAlertPush, default false. Push notification to the MetaTrader app on your phone. Push must be set up in the terminal options.
InpAlertOnLock, default false. Also alert when a stop is locked for the first time.
PANEL
ShowPanel, default true. Shows or hides the panel. The protection works the same without it.
PanelX, default 12, and PanelY, default 15. Start position of the panel from the top left corner, in pixels.
PanelFontSize, default 9. Base font size. The panel reduces it on its own if the chart is too small.
MaxTableRows, default 6. Number of positions listed in the table. Extra positions are counted below the table.
STRATEGY TESTER DEMO
InpTesterDemo, default true. Works only in the Strategy Tester. When no position is in scope, a minimum lot demo position is opened with a stop-loss, and after the grace window plus ten minutes its stop is moved 200 points further away on purpose, so you can watch the utility restore it. On a live or demo account this input does nothing and the utility never opens a trade.
How to use it well
• Run one copy per chart symbol, or one copy with all symbols scope on a single chart. Do not run two copies on the same symbol.
• Trail your stop or move it to break-even as usual. Every tighter level is locked automatically, so the utility becomes a ratchet that only turns in your favour.
• If you work with an Expert Advisor that manages its own stops, use the magic filter so the utility protects only your manual trades, or keep the fight limit at a small number.
• If you really need to widen a stop for a planned reason, use PAUSED, adjust, then press RESET LOCKS and ARMED again. The extra steps are intentional: a decision that takes three clicks is a decision, not a reflex.
• Keep Algo Trading on. Without it the terminal does not allow the stop to be modified or the trade to be closed.
Safety and honesty
• It only touches positions in scope by symbol and magic filter. Pending orders are never touched.
• It never widens a stop, never opens a trade on a live or demo account, and never changes a take-profit.
• Every request respects the broker's stops level and freeze level.
• It does not guarantee results. A stop-loss is executed by your broker at the market price, and gaps or slippage can fill it at a worse price. The utility protects your discipline, not the market.
• Every action is written to the Experts journal with ticket, old and new level and the reason.
Try it in the Strategy Tester
Choose Stop Loosening Blocker in the Strategy Tester, pick any symbol, for example EURUSD on M15, switch on visual mode and start. With the demo input on you will see a trade open with a stop, see the stop pushed away on purpose, and see the utility put it back. Change the grace window, the tolerance or the passed-stop exit and run again to see how each input behaves before you attach it to a real chart.
Your review
If Stop Loosening Blocker helps you keep the stops you set, please leave an honest review on this page. Tell other traders what worked for you and what you would like to see improved. Every review is read and helps shape the next versions.
