Loading…

Scale In Manager

RISK WARNING: this EA opens additional live market positions automatically as price moves. It never increases the lot size of an add and never adds to a position that has moved against it, but a group that later gives back its favourable move can still lose more than a single position would. Confirm every input on a demo account before running it live. This only ever adds to a position once price has moved further in its favour since the last entry - it never adds to a loser. That is a deliberate anti-martingale choice: scaling into strength compounds a position that has already proved the idea right, while scaling into weakness compounds a mistake, and this EA refuses to do the latter. The base position is not opened by this EA - it is adopted. Open a position by hand, or with any other EA, tagged with InpMagicNumber, and this manager picks it up on its next scan and starts watching it. Every add uses the same flat lot size, not a multiplier, so exposure grows linearly with each stage, not exponentially, and InpMaxTotalLots is a hard ceiling the manager will not exceed regardless of how far price has moved. Before each add is sent, every currently open ticket in the group - the base and any earlier adds - has its stop-loss tightened to no worse than the base position's own open price, provided the broker's minimum stop distance allows it. The group only ever risks giving back the ground it has already earned since the base opened, not the ground gained by the add that is about to be placed. Notes and limitations - If adds already exist under InpMagicNumber when this EA is first attached (for example after a terminal restart), they are counted toward InpMaxScaleIns and InpMaxTotalLots on adoption rather than ignored, so the caps still hold going forward. - The breakeven tighten only ever moves a stop closer to price, never further away, and is skipped (with a log entry) on any ticket where the broker's minimum stop distance would reject it. - This EA only manages one base position per magic number per symbol at a time. Running two unrelated positions under the same magic number on the same symbol will confuse which one it treats as the base. - It never closes the group itself - only stop-losses, take-profits, and the trader's own decisions end the trade.

Expert advisor · MT5 · v1.0 · Free

About Scale In Manager

Scale In Manager is an expert advisor (trading robot) for MetaTrader 5. It opens a grid of orders at fixed price steps, moves the stop loss behind price (trailing stop / break-even) and has a news filter. It has 12 settings, such as Magic number, Scale in step pips and Scale in lots. MQL source code included.

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

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

Settings

SettingDefaultWhat it does
Magic number20260703Magic number identifying the base position and every add
Scale in step pips30Favourable move required since the last entry before adding again
Scale in lots0.01Lot size for EACH add - flat, never increasing with more adds
Max scale ins3Maximum number of adds beyond the original base position
Max total lots0.10Hard cap on combined lots across base + every add
Stop loss pips40Stop-loss attached to each add, in pips from that add's own entry
Take profit pips0Take-profit attached to each add, in pips (0 = none)
Move stops to breakeven on addtrueTighten every open ticket in the group to no worse than the base's open price on each add
Slippage pips5Slippage tolerance on market entries
Max retries5Attempts per order action before giving up
Retry wait ms500Pause between attempts, milliseconds
Scan interval sec10Seconds between checks

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: Trailing Stop & Break-even · Risk & Lot Size · Grid · News Trading · MT5 Expert Advisor · MQL5 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria