How the system works
Position management
What happens after a trade opens: emergency exit, break-even, profit ratchet and partial close — the shipped defaults, and the two rules we ship disabled.
Last reviewed: 5 September 2026
Who owns a trade once it is open
Position management does, and it runs in the C++ trading core on every tick with no involvement from the AI, the console or the database. The model that proposed the trade has no say in when it closes.
This is the part of the system that keeps working when everything above it is down. It needs nothing but live prices.
The rules, in priority order
Evaluated in this order on every tick, so a protective rule always resolves before a profit-taking one:
| Priority | Rule | Shipped default | State |
|---|---|---|---|
| 1 | Emergency exit | Closes the position at 5% unrealized loss | On — and has no off switch |
| 2 | Profit lock | Arms at 1% profit, gives back 0.3% of equity | Off |
| 3 | Break-even | Moves the stop to entry at 0.3% profit | Off |
| 4 | Trailing stop | Arms at 0.5% profit, trails by a fixed price distance | Off |
| 5 | Profit ratchet | Arms at 5% profit, gives back 75% of the peak | Off |
| 6 | Partial close | Closes half the position at 0.8% profit | Off |
Emergency exit
A hard stop on unrealized loss, evaluated before every other rule, on each position independently. It cannot be outvoted by a strategy signal or a confident model, and it does not consult the AI layer — which is the point of running it first and separately.
Break-even and partial close
Break-even would move the resting stop to your entry once the trade is modestly ahead. Partial close would take half the position off at a configured profit, reducing the size at risk while leaving the remainder to run. Both are implemented, both are off, and the section below says why — they are described here so the rows in the table above mean something, not because either is protecting you today.
The profit ratchet
A resting broker-side stop that steps up behind peak profit. Also off by default — see below. Once armed it can never sit at a losing level, and it would arm at 5% profit and give back 75% of the peak — which sounds generous until you read it the other way round: it locks a quarter of the best the trade ever showed, and only starts doing so once the trade is substantially ahead.
Those two numbers were measured, not chosen
Everything except the emergency exit ships switched off
Read this before relying on any row above
Five of the six rules are disabled by default. The emergency exit is the only one running, and it is the only one with no switch at all. Every other line in that table describes something available to you, not something currently protecting your positions.
All five remain in the code and can be enabled. The reasons they are not are worth stating plainly rather than hiding behind a config file — and each one was switched off because of what it did to real or tested money, not on a hunch.
Break-even is off because its trigger is a percentage of ACCOUNT EQUITY, so what it means in price terms changes with the balance. On a small account 0.3% of equity was worth about 30 points on the instrument being traded, against a fixed spread of 40 — so the stop moved to entry before the trade had covered its own cost. The first three live positions all reached profit, all three had the stop moved up, ordinary noise retraced into it, and all three closed at entry minus the spread. Zero winners out of three, while the model's own stops sat 390 points away and were never approached.
Partial close is off for the same reason in a different costume: 0.8% of a small account was two spreads into a move the model had sized for far more, so half the position was banked before the trade had really started. Taking half off early caps the winners while leaving the losers whole, which is the wrong half of the distribution to cut.
The profit ratchet is off despite being the best-designed of them. Its stop rests at the broker, so it survives this service dying — but it still moves a stop the model placed, and a stop moved afterwards by a rule that knows nothing about why it was placed there is not the model's stop any more. It also re-tightened live stops several times a second on a moving position, which is what filled the event tables before anyone noticed.
Profit lock is off because the share of peak profit it surrenders shrinks as the peak grows — it gives back a fixed percentage of equity, not a proportion of the gain — and because it closes the position at market rather than moving a stop. Tested across ten symbols of history with costs applied, that combination lost money out of sample at every setting tried. The profit ratchet replaces it with a proportional, broker-side version.
Trailing stop is off because its distance is an absolute price distance, and no single value is correct across instruments. A distance that is a hair-trigger on an instrument priced in the thousands computes a stop below zero on one priced near 1.00 — a stop that can never tighten. The ratchet expresses the same idea in basis points, which is scale-independent.
Stops rest at the broker
Every level these rules set is placed on the broker's own order, not merely tracked in memory. That is what makes them survive a dropped connection — see Connecting MetaTrader 5.
A stop level is not a guaranteed fill
Changing the defaults
All of these are configurable per account, and every change is version-stamped into the record alongside the decisions made under it, so a trade from months ago can still be read against the policy that was actually in force — Audit trail covers how.