Double Up All Positions
Read this part before you download it. This script adds a second position alongside every position you already have. It doubles your exposure, doubles your loss per pip, and roughly halves the distance between where you are now and a margin call. Adding to positions that are already losing is the most reliable way there is to destroy a retail account, and this tool turns that into one click. It exists because scaling into a position that is working is a legitimate technique and doing it by hand across a book is slow and error-prone. It is not a martingale engine, it has no loop, and it should never be wired into one. With that said, here is what it does differently from the version people usually write. Volumes round DOWN, never up. The addition is your existing size multiplied by a factor, which makes it a risk-derived number, and rounding a risk-derived number up to the broker's step spends more risk than you authorised - quietly, and in the direction that hurts. When the addition floors below the broker's minimum the position is skipped and the journal says so. It is not topped up to the minimum. If you find that annoying, that annoyance is the feature: at a factor of 0.3 on a 0.01 lot position there is no honest answer other than "no". A stop that cannot be copied means the position is skipped, not opened bare. When InpCopyStops is on, the addition is sent with the original's stop and target so the enlarged block exits as one unit. If the original's stop has since drifted inside the broker's stop level - because price moved towards it, or because the level widened - the server would reject the order. The naive fix is to drop the stop and send the order anyway. This script refuses: it skips that position and tells you which one and why. Quietly turning a protected addition into an unprotected one is exactly the kind of helpful behaviour that empties accounts. The stop-level check itself is done against the correct side of the market. Both levels are measured against the price the position would CLOSE at - the Bid for a buy, the Ask for a sell - not the price it opens at. Getting that backwards produces a script that works fine in testing and throws error 130 the first time the spread widens. There is an optional per-symbol volume cap. When set, the script counts what is already open on that symbol plus everything this run has already planned for it, and trims or skips the addition to stay inside the cap. It is off by default because the right number is yours, not mine, but on a doubling script it is the input worth setting. The whole plan is resolved before a single order is sent, so the confirmation dialog shows the true numbers: how many additions will actually go out, how many lots that is, what the total will be afterwards, and how much further each pip will move your equity. Positions that will be skipped are already excluded from that total. Notes and limitations - It does not check margin before sending. A cap on volume is not a cap on risk, and a plan that fits inside your lot ceiling can still be refused for insufficient funds - or worse, accepted, and leave you one bad hour from a stop-out. Look at your free margin yourself. - It has no idea whether the positions are winning or losing. Doubling into a loser and doubling into a winner look identical to this script. They are not identical to your account. - The addition fills at the current market price, not at the original's entry. Your average entry moves, and on MQL5 netting the original entry price is literally overwritten by the average. - Copied stops are copied as price levels, not as distances. That is deliberate - the block then exits as one - but it does mean the addition's stop is a different number of pips away than the original's was. - Brokers with a maximum position count or a total volume limit per symbol will refuse additions that the script considers valid. Those come back as server retcodes and are reported, not retried into oblivion. - Partial fills are possible. The server accepting the request is what is reported; the Trade tab is the authority on the final size. - There is no undo. The Panic Button script (S016) is the closest thing.
Script · MT4 · v1.0 · Free
About Double Up All Positions
Double Up All Positions is an expert advisor (trading robot) for MetaTrader 4. It has 10 settings, such as Current symbol only, Magic filter and Volume factor. MQL source code included.
Files in the download: DoubleUpPositions.ex4, DoubleUpPositions.mq4, DoubleUpPositions.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 |
|---|---|---|
| Current symbol only | false | Restrict to this chart's symbol |
| Magic filter | -1 | Add only to this magic (-1 means every magic) |
| Volume factor | 1.0 | Addition size relative to the existing position |
| Max total lots per symbol | 0.0 | Refuse to exceed this per symbol (0 = no cap) |
| Copy stops | true | Copy the original's stop loss and take profit |
| New magic | 0 | Magic number written on the additions |
| Slippage pips | 3 | Slippage tolerance, in pips |
| Max retries | 5 | Attempts per addition before giving up |
| Retry wait ms | 500 | Pause between attempts, milliseconds |
| Confirm first | true | Ask for confirmation before adding |
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: Volume · MT4 Script · MQL4 Source Code