Entry Ladder Risk Calculator is a free expert advisor for MetaTrader 5 and MetaTrader 4 that sizes a manual trade from the share of your equity you are willing to lose, Max Risk %. You split the trade into up to 16 entries, all with the same lots and one shared Stop Loss. It works out those lots so that, if every entry fills and the price reaches the Stop Loss, the estimated loss stays within that risk budget. Lots round down, so the estimate is often a little under it. Then it places the orders when you click and confirm.
Video tutorial: https://youtu.be/f5TDH-WnRGU
It is free on the MQL5 Market:
- MetaTrader 5: https://www.mql5.com/en/market/product/212266
- MetaTrader 4: https://www.mql5.com/en/market/product/212267
In short
- What it is. A free trade panel for MetaTrader 5 and MetaTrader 4 that splits one manual trade into a ladder of up to 16 orders and sizes them from your risk.
- How it sizes. You set three numbers: Max Risk % (1 by default), Entries (5) and Entry Spacing % (0.25). Every entry gets the same lots, worked out so that if all of them fill and the price reaches the shared Stop Loss, the loss is about Max Risk % of your equity, never more by its own estimate.
- Two ways in. Market opens the first entry now and leaves the rest as limit orders that fill if the price pulls back. Planned places every entry as a pending order around a price you choose.
- You see the trade before you place it. The average price, the total lots, the loss at the Stop Loss, the win at the Take Profit and the margin level, all as if every entry filled, on the panel and on the chart.
- You adjust it by dragging. The gold line moves the whole Planned ladder, an entry line moves one entry, the Stop Loss resizes the lots, the Take Profit moves the target.
- It manages the basket. Every order carries the same Stop Loss and Take Profit. Move to Breakeven and Close Basket are one click each, and when the trade ends it cancels the entries that never filled.
- It never trades on its own on a live chart. Every basket starts with your click and a confirmation.
Quick start
- Attach it to a chart, tick Allow Algo Trading on the Common tab and turn on Algo Trading in the toolbar.
- Pick Long or Short and Market or Planned, then set Max Risk %, Entry Spacing % and Entries.
- Drag the lines until the preview shows the trade you want.
- Click the order button, check the confirmation and click Yes.
Why split a trade? If the price first moves against you, the later entries fill at better prices, so your average entry improves, and the loss at the Stop Loss stays inside the same budget. The cost is that the lots are sized as if every entry fills, so each entry is smaller than one full-size trade. If the price turns before the later entries fill, you hold a smaller trade than planned, and you make less than a single trade would have.
It never opens a trade on its own on a live chart: every basket (all the orders of one trade together) starts with your click and a confirmation. It does cancel or close the basket's own orders by itself in the cases in sections 8 and 9: a fill over the budget, the end of the trade and your soft stop-out. It does that only while the terminal runs with Algo Trading on. In the Strategy Tester it places one basket from the inputs by itself (section 11).
Settings at a glance
New to it? Start at section 1 and come back here when you need a setting.
The expert keeps its settings in a file per account, symbol and magic number. The first time you attach it, the first seven inputs below, Direction to Soft stop-out level, fill that file. After that the panel and its Settings window change the file, and the file wins over those inputs: changing one of them in the Inputs tab later does not change the panel or the margin levels. Only Reset reads Max Risk %, Entry Spacing % and Entries from the inputs again. The last three inputs, Hide terminal trade levels and history, Dedicated magic number and Log Level, are read at every start and are not in the file. Panel changes are saved as you make them, and the margin levels when you click Save in Settings. Prices you typed or dragged (entries, Stop Loss, Take Profit, the Planned ladder's place) are kept for that chart, so a restart on the same chart shows the same ladder.
Terminal inputs (the Inputs tab when you attach it; defaults in parentheses)
- Direction (Long). The side the panel starts on the first time, and the side the Strategy Tester trades.
- Entry Mode (Market). The mode the panel starts in the first time, and the one the Strategy Tester uses. Market opens the first entry at the current price. Planned places every entry as a pending order.
- Max Risk (% of equity) (1). The most the basket is sized to lose at its Stop Loss, as a percentage of equity. Above 0, up to 100.
- Entry Spacing (% per step) (0.25). The gap between neighbouring entries, as a percentage of the price. Above 0.
- Entries (5). How many orders the trade is split into, 1 to 16.
- Soft margin call level (%) (0). Your own margin call, as a margin level (equity divided by used margin). Brokers warn at their margin call and start closing positions at their stop-out. Your soft levels sit above theirs, so you hear and act first. The panel warns in red below this one. 0 is off.
- Soft stop-out level (%) (0). Your own stop-out, as a margin level. Below it the expert closes this basket before the broker's stop-out can. 0 is off, and only the broker's own stop-out applies.
- Hide terminal trade levels and history (true). Turns off MetaTrader's own trade lines and, on MT5, the trade history arrows on this chart while the expert runs, since the terminal draws them over every chart object, the panel included. The expert's lines replace them; removing the expert puts them back. The Strategy Tester chart keeps them.
- Dedicated magic number (4271). Marks the orders the expert owns. Use it for nothing else. It must be 1 or more (on MT4, up to 2147483647).
- Log Level (Warning). How much the expert writes to the Experts log.
The Strategy Tester always uses the inputs and never reads or writes the settings file. Each soft level that is on must be above the broker's matching hard level, and the soft margin call above the soft stop-out when both are on.
A bad input stops the start, and an Alert in the terminal begins with "inputs refused" and names the problem: a magic number of 0 or out of range, Max Risk % not above 0 or above 100, Entry Spacing % not above 0, Entries outside 1 to 16, a negative soft level, a soft level that is on but not above the broker's matching hard level, or a soft margin call not above the soft stop-out. Fix the input and attach the expert again.
Panel (it starts from the inputs: Long, Market, 1, 0.25, 5, and every price on Auto)
- Symbol line: the chart's symbol and the margin ratio the broker applies to it, such as "EURUSD 1:100".
- Direction: Long or Short. Switching sides mirrors any price you fixed to the other side of the Ladder Centre (Planned) or of the current price (Market). Auto prices are worked out again.
- Entry Mode: Market or Planned.
- Max Risk %, Entry Spacing %: type a value and press Enter. A point or a comma both work as the decimal mark (0.25 or 0,25).
- Entries: the - and + buttons, or type the number. At 1 entry, Entry Spacing % is greyed out, since there is no gap to set.
- Ladder Centre: Planned mode only, the price the ladder is built around. Type a price and press Enter, or drag the gold line. In Market mode the row is hidden.
- Stop Loss and Take Profit: one row under the risk settings, each label above its box. Both start on Auto. Type a price and press Enter, or drag the line, to fix it.
- Entry rows: each entry's order type, lots, tag and price. Auto follows the spacing, Fixed is a price you typed or dragged, Live is the market entry. More entries than fit the chart's height go on pages: Prev and Next turn them.
- The order button: Open Long Basket, Open Short Basket, or Place 5 Pending Orders (the number follows Entries).
- Reset Prices: every entry, the Stop Loss and the Take Profit back to Auto. Everything else stays.
- Reset: Reset Prices, plus Max Risk %, Entry Spacing % and Entries back to the input values, and a Planned ladder centred on the current price again. Direction and Entry Mode stay.
Settings, Margin Levels (the gear in the panel's title bar)
The tab's first line shows the broker's hard margin call and stop-out, such as "Broker (hard): margin call 100%, stop-out 40%". Your soft levels are off at 0, the default, and each one you set must be above the broker's matching hard level. Type a level or use - and + (steps of 10), then click Save. Cancel keeps the saved levels.
- Soft margin call level % (0, off). Your own margin call, a margin level like the broker's. Below it the margin level turns red and a red "Warning" line under it says what happens next.
- Soft stop-out level % (0, off). Your own stop-out, also a margin level. Below it the expert closes this basket only, cancels its pending orders and blocks new baskets until the margin level is back above it. When both are on, the soft margin call must be above the soft stop-out.
Contents
- Install and attach it
- The setup controls
- Reading the preview
- Moving the lines
- Reset Prices and Reset
- Placing a planned ladder
- Opening at the market
- Managing a basket
- Margin levels and the soft stop-out
- One basket per symbol
- The Strategy Tester
- MetaTrader 4
- Messages and what to do
1. Install and attach it
Install it from the MQL5 Market. In the terminal's Navigator it appears under Expert Advisors, then Market, as EntryLadderRiskCalculator. On the chart its panel is titled Entry Ladder.
- Open the chart of the symbol you want to trade. Any timeframe works.
- Drag the expert onto the chart, or double-click it.
- On the Common tab, tick Allow Algo Trading (Allow live trading on MT4). On the Inputs tab, check the magic number, a number the expert puts on its orders so it can tell them apart from yours. If another expert uses 4271 on this account, pick another number.
- Click OK, and turn on Algo Trading in the terminal's toolbar (AutoTrading on MT4).
The panel opens at the top left of the chart. Its title bar shows the name and four buttons. The gear opens Settings. The question mark opens a short Help guide. The four arrows move the panel: click them, move the pointer and click again to drop the panel there, and the chart remembers the place. The arrow folds the panel to its title bar and opens it again; the chart remembers that too, and the lines stay. Under the title bar the first line is the chart's symbol and the margin ratio the broker applies to it, such as 1:500, worked out from its margin.
If Algo Trading (AutoTrading on MT4) is off, the status line under the order button says so in red and the button stays disabled. That line is the panel's status line: every message and refusal shows there.
Try it on a demo account first. The expert places real orders when you click.
2. The setup controls
The top of the panel sets up the trade.
- Direction. Long buys, Short sells. The Stop Loss goes on the loss side: under the entries for a long, above them for a short. Switching sides mirrors any price you fixed to the other side of the Ladder Centre (Planned) or of the current price (Market).
- Entry Mode. Market opens entry 1 at the current price and places the other entries as limit orders on the pullback side, where the price goes if it moves back against you: below the price for a long, above it for a short. Planned places every entry as a pending order around a price you choose.
- Max Risk %. 1 means the whole basket is sized to lose up to 1% of your equity at its Stop Loss. With 10,000 USD of equity that is up to 100 USD. It is read from equity while you set up the trade, so profit or loss on your other trades changes it. Once you place the basket, the budget is fixed in money. It covers this basket only: your other trades and any daily loss limit are not part of it.
- Entry Spacing %. 0.25 puts each entry 0.25% of the price away from the next. On a symbol at 2,000 that is 5.00 between entries; on a currency pair at 1.0800 it is about 27 pips.
- Entries. 5 splits the trade into five orders with the same lots. 1 is a single trade.
The entries together, evenly spaced, are the ladder. Brokers also set a minimum distance between the current price and any pending order, Stop Loss or Take Profit. The expert keeps every price at least that far away.
The automatic Stop Loss sits one spacing step past the farthest entry (farther if the broker's minimum distance needs it), so widening the spacing widens the stop too. The lots shrink to keep the loss at the Stop Loss inside Max Risk %. Once you move an entry or the Stop Loss, the stop stays where it is until Reset Prices.
3. Reading the preview
Before you place anything, the panel and the chart show the whole trade.
On the panel, the Stop Loss and Take Profit share one row under the risk settings. Below them each entry has a row: its order type (Market for the entry that opens now, otherwise Buy Limit, Buy Stop or the Sell versions, numbered per type), its lots, its tag and its price in a box. The market entry's price is the live quote. Under the rows:
- Average, all filled: your average entry price if every entry fills, and the total lots.
- At Stop Loss, all filled: the estimated loss if every entry fills and the price reaches the Stop Loss, in the account currency and as a percentage of equity, such as "-98.40 USD (0.98%)".
- At Take Profit, all filled: what the basket makes if every entry fills and the price reaches the Take Profit, such as "+98.40 USD (0.98%)".
- Margin level, all filled: the margin level the account would have with every entry open, at today's prices and equity. The margin level is equity divided by used margin, and higher is safer. Next to it is your soft stop-out ("Soft stop-out 120%") or, with that off, the broker's ("Broker hard stop-out 40%"), where positions get closed. "No margin used" means nothing is open yet. By the time the last entry fills, the first ones are usually in loss, so the real level will be lower.
On the chart, every entry has its own line, named by its order type and number like its panel row, such as "↕ Buy Limit 2". The market entry is "Buy at ask", or "Sell at bid" for a short: the price it fills at. The gold line is the average if every entry fills. The Stop Loss line shows what you lose there, such as "↕ Stop Loss -98.40 USD (0.98%)", and the green Take Profit line what you make there and its share of equity, such as "↕ Take Profit +98.40 USD (0.98%)". Prices are on the price axis. Hover a label for the rest: an entry's lots and price, the money at the Stop Loss or Take Profit, and what dragging it does.
The Take Profit starts on Auto, as far past the average as the Stop Loss is on the other side, so if every entry fills the win there is about the loss at the Stop Loss. If that is too close to the farthest entry for the broker, it sits the broker's minimum distance past that entry instead. While it is Auto it moves with the average whenever you move an entry or the Stop Loss. Every order goes out with it, and its price is fixed when you place the orders. It does not follow the entries that actually fill. If only the first entries fill, they are much closer to the Take Profit than to the Stop Loss. In a Market basket of 5 entries with only the market entry filled, the Take Profit is about one spacing step above it and the Stop Loss about five steps below.
Lots round down to the broker's lot step (the smallest size change allowed, often 0.01). They also stop at the broker's maximum lot, so on a large account with a tight stop the loss can be well under your budget; the status line then says "Lots stop at the broker's maximum of 1000 per entry, so the loss at the Stop Loss is under Max Risk." with your broker's maximum. Because every entry gets the same lots, the loss shown is often a little under your budget. If even the broker's minimum lot would lose more than your budget, the status line shows the minimum lot's loss next to your budget, and the button stays disabled. Raise Max Risk %, lower Entries or move the Stop Loss closer.
The loss is an estimate. The price can jump past the stop, and commission, swap and slippage are not in it. Once orders fill, the expert does count the commission and swap charged so far (section 8). On an account with commission, a basket sized right up to its budget can go over it on the first fill. Then the expert cancels the entries still waiting, and in a Market basket the waiting entries can get smaller lots than the confirmation showed. To leave room, set Max Risk % a little under the most you want to lose.
4. Moving the lines
Every line you can move has a ↕ handle at the start of its label (MT4 shows the label without it). Press on the label, drag, and release. Hovering a label outlines it and holds the chart still while you drag. You can also click the label, move the pointer and click again. Or type a price in the panel's row and press Enter.
The market entry ("Buy at ask") follows the quote and has no handle. Once orders are placed, only the Stop Loss and Take Profit lines move, and they move the orders when you release. When labels crowd at nearby prices, they slide left so they do not overlap. A label that would run under the panel or off the chart is hidden and cannot be dragged, though its line stays. Scroll or zoom the chart, fold the panel, or type the price in the panel instead.
The gold line reads "↕ Average · drag moves ladder" in a Planned preview. Dragging it moves every entry, the Stop Loss and the Take Profit together, and the Ladder Centre follows. In Market mode, and once orders are placed, it only shows the average.
An entry line moves only that entry. Its tag turns Fixed, and so does the Stop Loss: it stays where it is, and so do the other entries, while the lots of every entry resize to keep the loss inside the budget. Drag it past another entry and, on release, the entries are numbered again in price order, each keeping its price. The ones that changed place turn Fixed.
The Stop Loss line moves the stop. Drag it further away and the lots shrink; closer and they grow.
The Take Profit line moves the target and turns it Fixed. The lots stay the same; the win on its label changes.
Fixed entries keep their price when the market moves. In Market mode, Auto entries move with the live price, one spacing step apart. In Planned mode they stay around the Ladder Centre until you move it.
Changing Entries after an entry has its own price keeps the entries you placed: + adds one a spacing step past the farthest entry (and moves the Stop Loss out if the new entry would reach it), - removes the farthest.
5. Reset Prices and Reset
- Reset Prices puts every entry, the Stop Loss and the Take Profit back to Auto. Max Risk %, Entry Spacing %, Entries and, in Planned mode, the ladder's position stay. The status line says "Every entry, the Stop Loss and the Take Profit are back on Auto."
- Reset also puts Max Risk %, Entry Spacing % and Entries back to the input values, and in Planned mode centres the ladder on the current price again. Direction and Entry Mode stay. The reset values are saved as your new settings. The status line says "Max Risk, Entry Spacing and Entries are back on the inputs, every price on Auto."
6. Placing a planned ladder
Choose Planned. The ladder centres on the current price. Centred there, a long ladder has stop orders above the price that buy as it rises and limit orders below it that buy as it falls, so you are in whichever way it breaks. Move the ladder with the gold line or by typing a Ladder Centre. Entries on the pullback side become limit orders and the others stop orders: for a long, Buy Limit below the price and Buy Stop above it; for a short, Sell Limit above and Sell Stop below. A limit order fills when the price comes back to it, a stop order when the price runs through it.
For a ladder of limit orders only, drag the gold line below the price for a long, above it for a short.
Click Place 5 Pending Orders. A confirmation lists each order with its type and price, the lots per entry, the Stop Loss, the Take Profit, the estimated loss and the estimated win, with the account currency. Click Yes and the orders go to the broker with the Stop Loss and Take Profit attached.
After Yes the expert checks the basket once more at the current quote. The pending prices, the lots, the Stop Loss and the Take Profit stay as you confirmed them; only a market entry takes the new price. If an order would change type, or the loss would now go over your budget, it places nothing and the status line says why. Check the new preview and click again.
If an entry is closer to the price than the broker allows, the ladder stays drawn and the status line says an entry is too close. Move the ladder or the nearest entry further from the price.
7. Opening at the market
Choose Market. Entry 1 is the live quote, tagged Live. The other entries wait as limit orders on the pullback side, each a spacing step further away. Drag one past the live quote and it becomes a stop order instead (Buy Stop above the price for a long, Sell Stop below it for a short).
Click Open Long Basket or Open Short Basket, check the confirmation and click Yes. Entry 1 fills at the market; the rest wait. Set Entries to 1 for a single market trade sized from your risk. Then Entry Spacing % sets the Stop Loss distance: the Auto Stop Loss sits one spacing step below the bid for a long (above the ask for a short), or drag it where you want it.
Switching from Market to Planned keeps the lines where they are. Each order's type then follows the price: the former market entry becomes a stop or a limit as the price moves away from it. Switching from Planned to Market puts every price back to Auto.
8. Managing a basket
Once orders are placed, the panel shows the live basket instead of the setup:
- One line with the direction, the entry mode and Max Risk %, such as "Long · Market · Max risk 1.00%".
- A table with two columns: Filled for the entries filled so far, and All filled for every entry filled, shown while orders still wait. Its rows are Lots (the lots, then the number of entries in brackets; "None yet" before the first fill), Average, At Stop Loss (what the basket loses if the price reaches the Stop Loss) and, while it has a Take Profit, At Take Profit (what it makes there), in money and as a percentage of equity. Before the first fill the Filled column shows "-" for the money rows.
- The losses include commission and swap charged so far and the net loss of the basket's closed positions. A closed winner offsets a closed loser, but a net profit is never counted against the open risk. Commission charged on closing is not in them.
- How many orders are pending and their total lots, such as "4 orders pending, 0.4 lots". Then the Stop Loss and Take Profit in price boxes on one row: type a price and press Enter to move it for every order of the basket.
- Open P/L: what the open positions make or lose right now, with swap and commission.
- With a Take Profit, Reward to risk, all filled: the All filled win at the Take Profit divided by the All filled loss at the Stop Loss, written such as "2.00 : 1", which means the win is twice the loss. The loss includes what the basket already lost on closed positions, the win does not include what it already made. After Move to Breakeven the loss is only the fees, so the ratio stops meaning much.
- The margin level now, next to your soft stop-out or, with that off, the broker's hard stop-out.
Without a Stop Loss the At Stop Loss row says "No Stop Loss" in red, and there is no Stop Loss line to drag: type a price in the Stop Loss box to set one.
The percentages in the live panel are of your equity now. With the basket in loss they can read a little above Max Risk % for the same money, because the budget was fixed in money when you placed it.
On the chart, while entries wait, the solid gold line is "Average filled" and a dashed violet line is "Average if all filled". Before the first fill only the violet one shows, and once all have filled the gold one reads "Average". While entries wait, the Stop Loss and Take Profit labels show both figures, filled then all filled: "↕ Stop Loss -39.36 / -98.40 USD (0.98%)" and "↕ Take Profit +39.36 / +216.48 USD (2.16%)". Before the first fill they show only the all-filled figure. A label too long for the chart keeps only the all-filled figure. Filled entries read "Filled 1", pending ones "Buy Limit 1", numbered within their order type.
Pending entries stay on the ladder. The lots were sized for each entry's price. The expert's entry lines cannot be dragged once the orders are placed. If you move a pending order some other way (the order's Modify dialog, or MetaTrader's own line with Hide terminal trade levels and history set to false), the expert puts it back and says so on the status line.
If a fill goes over budget. An order can fill at a worse price than its own (slippage), and swap and commission add up while you hold. So after each fill the expert checks the basket's risk again, with the real fill price, swap and commission. If the whole basket is now over the budget, it cancels the pending orders and you keep the open positions. If the open positions alone are over it, it closes the basket. When the market entry of a Market basket fills worse than planned, or its commission eats into the budget, the other entries are placed with smaller lots. If even the minimum lot does not fit, they are not placed and you keep the single position. If the market fill alone is over the budget, the expert closes it at once.
Take Profit. Every order goes out with the Take Profit you saw in the preview. Drag its line and on release every position and pending order of the basket moves to the new price, or type the price in the panel's Take Profit box. Editing the Take Profit or Stop Loss of any single order later moves them all the same way. A price an order cannot carry is put back. If you remove the Take Profit from any one order, the expert removes it from every order of the basket. A dotted green line labelled "↕ Take Profit · drag to set" then waits as far past the average as the Stop Loss is on the other side, or nearer if that is off the chart. Drag it to your target and release to set one again. You can also click it, move the pointer and click again. Dropping it back where it waited sets nothing.
Stop Loss. Drag the Stop Loss line, or type the price in the panel's Stop Loss box. The expert checks the new price against the basket's budget before it reaches the broker. If you edit the stop on an order some other way (with Hide terminal trade levels and history set to false, on MetaTrader's own line) and the new price breaks the budget, the expert puts the last approved price back. The basket always keeps a Stop Loss. If you remove it from an order, the expert puts it back and says "This basket needs a valid Stop Loss."
MetaTrader's own lines are hidden. While the expert runs it turns off the chart's trade levels (the lines of positions, pending orders, Stop Loss and Take Profit) and, on MT5, the trade history arrows. MetaTrader draws both over every object on the chart, so they would cross the panel and the labels. The expert's own lines show the entries, the fills, the Stop Loss and the Take Profit instead. Removing the expert puts the chart's settings back. Set the input Hide terminal trade levels and history to false (the expert's properties, F7, Inputs tab) to keep them.
Move to Breakeven appears once an entry has filled. It moves the Stop Loss to the average price of the filled entries, so if the price turns back, those positions close at about no loss. The average is rounded onto the tick grid on your side (up for a long, down for a short). The price must first be past the average by the broker's minimum distance; until then the status line says what it needs, such as "Breakeven needs the price above 1.08460 first." When it works, it says "Stop Loss moved to breakeven." If the Stop Loss is already at or past breakeven, nothing moves and it says "The Stop Loss is already at or past breakeven."
Pending entries on the wrong side of the new stop cannot carry it (for a long, the ones below the new stop; in a Market basket, that is every limit entry). The expert asks "Cancel the pending order that cannot carry the breakeven stop?" or, for several, "Cancel 4 pending orders that cannot carry the breakeven stop?" before it cancels them. Answer No and nothing changes: the status line says "Breakeven not applied. The pending orders stay." Commission, swap and slippage are not in the breakeven price, so the exit can still be a small loss.
Close Basket closes the basket's open positions and cancels its pending orders, after a confirmation. While no order has filled yet, it just cancels them. Entries that never fill stay pending while the positions that filled run to the shared Stop Loss or Take Profit. When the Stop Loss or Take Profit closes the trade, or you close every position by hand, the expert cancels the entries that did not fill. If you delete every pending order by hand before one fills, the basket ends and the setup comes back. If only some entries filled, you hold a smaller trade, with a smaller loss at the Stop Loss than the All filled figure, until its Stop Loss or Take Profit closes it.
While it can trade. The expert manages the basket only while the terminal runs with it attached and Algo Trading on. With Algo Trading off, the panel does not say why: Close Basket, Move to Breakeven and the price boxes are just greyed out. The expert then checks no fills, copies no edits, puts no moved order back, cancels no leftover entries and closes nothing, the soft stop-out included. The Stop Loss and Take Profit on each order keep working at the broker, also with the terminal closed. The entries that did not fill stay until the expert runs again. Turn Algo Trading back on to resume.
9. Margin levels and the soft stop-out
The margin level is equity divided by used margin, as a percentage, and higher is safer. Brokers warn at their margin call level and close positions at their stop-out level.
Both soft levels start off, so out of the box the broker's own hard margin call and stop-out are all that apply. Set them in Settings and the expert watches the account's margin level once a second, while Algo Trading is on, against a soft margin call and a soft stop-out: your own levels above the broker's hard ones. Below the soft margin call the panel shows the margin level in red with a red "Warning" line under it. Below the soft stop-out it closes this basket and cancels its pending orders, and it blocks new baskets until the margin level is back above the soft stop-out. It closes nothing else on the account. Because it watches the whole account, losses on your other trades can also make it close this basket. A fast move or a gap can still reach the broker's stop-out first.
Every chart with the expert guards its own basket. With baskets on several symbols, each one closes at its own soft stop-out. Below the soft margin call the panel shows a red line under the margin level, such as "Warning: The margin level is 140%, under your soft margin call of 150%. At your soft stop-out of 120% this basket closes and its pending orders are cancelled." With the soft stop-out off, the second sentence names the broker's hard stop-out instead: "Your soft stop-out is off; the broker's hard stop-out is 40%." In the preview it warns the same way when the margin level with every entry filled would be under the soft margin call: "Warning: With every entry filled the margin level would be 140%, under your soft margin call of 150%. ..." The preview warns only against the soft margin call. With only a soft stop-out set, compare Margin level, all filled with it yourself: a basket that would fill under it is placed anyway, and the expert closes it once the level gets there.
Open the gear for Settings, change Soft margin call level % or Soft stop-out level % and click Save. 0 turns a level off. A level that is on must be above the broker's matching hard level, and the soft margin call above the soft stop-out when both are on. If the margin level is already under the new soft stop-out, Save asks first, because saving may close the basket. The levels are saved for that symbol, so set them in the gear of each chart. If your broker states its levels in money instead of percent, the first line shows what they mean at the margin you use now, and 0% while nothing is open.
10. One basket per symbol
In one terminal, only one chart per account and symbol can run the expert's basket, whatever its magic number. A second chart with the expert on the same symbol says "Another chart owns this basket." and its gear does not open Settings. Close the other chart or remove the expert from it. The check works inside one terminal only, so do not run the same account and symbol in two terminals. The expert's settings and basket record are kept per account, symbol and magic number.
Give the expert its own magic number. Orders with that number on that symbol count as the basket's.
On an MT5 netting account the basket's fills merge into one position. The expert manages it only while every deal in it is its own. If a manual trade or another expert adds to that position, Entry Ladder Risk Calculator cancels its pending orders and leaves the combined position to you. The panel keeps showing the basket, and no new basket can start on that symbol until you close that position yourself. Close Basket does not close it. On a netting account the Filled column counts the merged position as one.
If the broker does not confirm a request in time, new baskets are blocked. Use Close Basket: it cancels or closes what it can verify and keeps checking for late orders after a restart. Once no order or position of the basket is left, it waits 10 seconds for a late order ("Waiting for the broker to confirm the last order.") and then frees the symbol for a new basket.
11. The Strategy Tester
In the Strategy Tester the expert uses the inputs and never writes its settings file. It places the basket the inputs describe once, on the first tick inside the symbol's trading session that allows it, as if you had clicked the order button and confirmed. From there the test shows the fills, the Stop Loss and the cancelled entries on past prices. Soft margin levels from the inputs apply there too, checked on every tick. MetaTrader's own trade lines stay on the tester chart. Past results do not predict future results.
12. MetaTrader 4
The MT4 version does the same. On MT4 the checkbox on the Common tab is Allow live trading and the toolbar button is AutoTrading, and the panel's messages use those names. MT4 has no netting accounts. MT4 chart labels cannot draw the ↕ handle, so the labels read without it, and the input Hide terminal trade levels and history hides the trade lines only, since MT4 has no history arrows on the chart.
On MT4 the money at the Stop Loss and the Take Profit is worked out from the symbol's tick value as it is now. When the symbol's profit currency is not your account currency, that value changes with the exchange rate, so the estimate can drift a little as that rate moves.
Keep the terminal's Account History tab on All History (right-click inside the tab, All History). MT4 only lets the expert read the closed orders that tab shows. It reads them to count the loss the basket's closed positions already took, which counts against Max Risk % for the entries still waiting, and to tell that the Stop Loss or Take Profit closed the basket. With a shorter period those orders can be missing, and no message warns you.
13. Messages and what to do
When the expert cannot preview, place or manage a basket, it says why in the status line under the panel. Every message it can show, with what to do about each one, is in Entry Ladder Risk Calculator: messages and what to do.
For questions, write in the product's Comments tab or send me a private message on MQL5.





























