Loading…

Momentum Death Scratch Manager

This is a trade manager, not a signal generator - it opens no positions, only manages ones already open. A trade is normally entered because momentum favoured one direction at the time. If that momentum has plainly failed to appear within a reasonable window after entry, continuing to hold the position is really just hoping the original reason for entry reasserts itself, not acting on what the market has actually done since. For each managed position, this EA measures the favourable price move achieved by InpEvalBars closed bars after the entry bar, expressed as a multiple of the ATR reading AT THE TIME OF ENTRY (not the current ATR, which would let the threshold drift as volatility changes while the trade is held). If that favourable move has not reached InpMinFavorableAtr by the deadline, the position is closed at market immediately - a scratch, not a target hit and not necessarily a stop-out, simply an acknowledgement that the setup did not do what it was expected to do in the time it was given. This is deliberately independent of the position's actual protective stop: a wide stop set for a different reason (structure, volatility) can sit far enough away that price never gets close to it even while the setup itself has clearly stalled, and this EA is the mechanism that catches that specific case rather than accepting the wide stop's distance by default. Notes and limitations - This EA never opens a position, only closes ones already open, and only for the single reason described above - it does nothing else to the position's stop or target. - The scratch is a market close at whatever price is current when the deadline passes; it is not guaranteed to be exactly breakeven, and can occasionally realise a small loss (if price is momentarily slightly unfavourable at that instant) or a small gain. - Entry-time ATR is read via iBarShift against the order's open time, which assumes the open time still maps to a bar in the currently loaded history - on a freshly attached chart with limited history this can occasionally under-evaluate a very old position. - Only evaluates each position once per closed bar; a position that clears the favourable-move requirement by even one point is left alone regardless of what happens afterwards.

Expert advisor · MT5 · v1.0 · Free

About Momentum Death Scratch Manager

Momentum Death Scratch Manager is an expert advisor (trading robot) for MetaTrader 5 based on ATR. It has 7 settings, such as Atr period, Eval bars and Min favorable atr. MQL source code included.

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

Trading robots can lose money. Check every setting and test on a demo account before using real funds.

Settings

SettingDefaultWhat it does
Atr period14ATR period used to measure the favourable-move threshold
Eval bars6Closed bars after entry by which momentum must have proven itself
Min favorable atr0.5Minimum favourable move required by InpEvalBars, as a multiple of entry-time ATR
Magic number-1Magic number to manage; -1 manages every position on this symbol
Max retries5Order action attempts before giving up
Retry wait ms500Pause between retry attempts, milliseconds
Slippage pips3Slippage tolerance for the scratch close, in pips

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 → Experts.
  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 expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
  6. Test it first on a demo account or in the Strategy Tester.

Download the PDF guide

Tags: ATR · Momentum · Buy/Sell Arrows · MT5 Expert Advisor · MQL5 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria