At one point, the position was up roughly $1,500. Later, the same position was down roughly $1,500. A $3,000 round trip inside an FTMO trial account.

My first reaction was simple: something must have failed.

It hadn't. The engine had followed its instructions. The strategy owned the exit, and until that exit appeared, the position kept its original risk. There was no separate rule for protecting a large open gain.

The software behaved correctly. The behavior we had specified was incomplete. The uncomfortable diagnosis

An unrealized gain is still market risk. The difficult question is how much of it a systematic strategy should be allowed to return before risk control takes over.

Why we didn't add a universal trailing stop

The obvious fix was a trailing percentage. It was also the wrong abstraction.

A mean-reversion trade expects price to snap back and wobble. A trend trade needs room to survive ordinary pullbacks. Apply the same tight trail to both and you haven't added a neutral safety feature. You have quietly changed both strategies, usually for the worse.

So the new policy measures movement in the trade's original R, not dollars, percentages or instrument points.

One R is the trade's original risk.If an entry is 100 and its sizing stop is 98, one R is 2 points. A move to 102 is +1R, whether the position is gold, Bitcoin or an index.

That gives each strategy a common unit without pretending they need the same amount of breathing room.

Strategy shapeActivatesMinimum lockGiveback room
Intraday mean reversion+1.00R+0.10R1.25R
Daily mean reversion+1.50R+0.10R2.00R
Trend+4.00R+0.10R4.00R

The lock follows the best executable price seen. It can tighten a broker-held stop, but it can never loosen one.

The replay changed our first idea

Our instinct was to lock trend profits early too. Historical replay pushed back.

Measured before release
+0.082R → +0.090R Net expectancy for the chosen mean-reversion lock on the frozen 2004–2026 XAU M15 tape.
99.4% Of pooled trend expectancy retained by waiting until +4R across 1,686 replayed daily trades.

Historical replay is a design check, not a forecast. Costs, slippage and future market behavior can differ.

Tight trend locks looked comforting and clipped the edge. Waiting until +4R felt late, but it preserved almost all of the measured expectancy. That is exactly why this decision belongs in data rather than in the memory of watching one painful trade.

What happens between strategy runs

Profit locking now runs as a separate risk supervisor. The strategy still decides entries and normal exits. The supervisor only limits giveback after a position has travelled far enough.

  1. Watch executable prices.Bid for a long, ask for a short. Stale quotes do not count.
  2. Keep the high-water mark.The best price survives restarts and failed venue requests.
  3. Raise the venue stop atomically.The old protection stays in place unless its tighter replacement succeeds.
  4. Never move backward.A stop can tighten in the trade's favor. It cannot be relaxed later.

Small changes are ignored so the engine doesn't hammer the broker. Stops are also kept behind the current market with room for spread and venue minimum-distance rules.

The position the new code refuses to touch

There is an awkward part to this story. One older venue position predates the metadata the supervisor needs. Its original sizing stop and strategy ownership cannot be proven from the journal.

We could infer them from the symbol or borrow a nearby signal. We don't. Either choice would let software invent a risk model around a live position.

The supervisor records what it sees, skips that position and blocks new entries until the ambiguity is dealt with. That is frustrating operationally. It is also the right failure mode.

"I don't know" is a valid answer for software controlling live money. The rule we want to keep

Where we landed

Profit locking is not a new exit strategy. It is a risk overlay with a narrow job: after an unusually favorable move, stop the trade from returning all of that progress.

It will sometimes close a position that would have recovered and run further. There is no free version of this decision. We chose strategy-specific thresholds, tested the cost and made every stop change one-way.

Now we watch what happens in the trial. No victory lap yet.

If you run systematic strategies, when does open profit become risk you refuse to give back?