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 · MT4 · v1.0 · Free
About Scale In Manager
Scale In Manager is an expert advisor (trading robot) for MetaTrader 4. 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.ex4, ScaleInManager.mq4, ScaleInManager.txt.
Trading robots can lose money. Check every setting and test on a demo account before using real funds.
Settings
| Setting | Default | What it does |
|---|---|---|
| Magic number | 20260703 | Magic number identifying the base position and every add |
| Scale in step pips | 30 | Favourable move required since the last entry before adding again |
| Scale in lots | 0.01 | Lot size for EACH add - flat, never increasing with more adds |
| Max scale ins | 3 | Maximum number of adds beyond the original base position |
| Max total lots | 0.10 | Hard cap on combined lots across base + every add |
| Stop loss pips | 40 | Stop-loss attached to each add, in pips from that add's own entry |
| Take profit pips | 0 | Take-profit attached to each add, in pips (0 = none) |
| Move stops to breakeven on add | true | Tighten every open ticket in the group to no worse than the base's open price on each add |
| Slippage pips | 5 | Slippage tolerance on market entries |
| Max retries | 5 | Attempts per order action before giving up |
| Retry wait ms | 500 | Pause between attempts, milliseconds |
| Scan interval sec | 10 | Seconds between checks |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Experts.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
- Test it first on a demo account or in the Strategy Tester.
Tags: Trailing Stop & Break-even · Risk & Lot Size · Grid · News Trading · MT4 Expert Advisor · MQL4 Source Code