This post is about the two ends of a trade's life that are not about moving the stop. The first is the set of rules that decide whether a trade opens at all. The second is the recovery legs that can be added when a trade moves against it. Both changed between 24 September and 4 October.
First, two words we use
- A recovery leg is an extra position in the same direction, placed at a better price if the first trade moves against it. Recovery legs are planned from the start: their size and their distances are set in advance.
- A cluster is the first trade together with its recovery legs. Iris manages a cluster as one unit, with one stop for the whole group.
Before a trade opens
- A closed trade no longer blocks the next one (24 September). Once a cluster has closed, a new setup on the same instrument can trade the same day.
- Orders that have not filled cost nothing. A waiting entry order no longer counts against margin (since 24 September) or against the day's allowance (since 2 October).
- More room at the same risk (29 September). For gold and indices, recovery legs are spaced wider and the lot is smaller, so the amount at stake at the stop stays the same. FX keeps its spacing.
- Gold reversals need a confirmed trend read (2 October). A reversal is a gold trade that goes against the recent short-term direction. It is now allowed only when the higher-timeframe trend can actually be read, and only when the direction it is judged against has held for more than a passing moment. One component now decides gold entries, where two used to have a say.
- The second side of an FX range is not blocked by its twin (1 October). A range trade places a buy order above the range and a sell order below it. A short safety cooldown set by the first order used to block the second. Each order is now exempt from the cooldown its own twin sets.
- No new trades on Friday afternoons (29 September). New entries stop well before the weekly close, and entry orders that have not filled are removed soon after.
How deep a recovery ladder can go
Until 1 October, each family had its own fixed limit on the number of recovery legs. Since 1 October at 11:12 UTC, the same rule applies to every family, and the depth is decided for each cluster from Iris's reading of the market:
- Calm market: a shorter ladder.
- Deep market: a longer ladder.
- Volatile market: the longest ladder.
- Much of the family's share already in use: the ladder stays short, whatever the market.
Each leg is still checked at the moment it is placed. It has to fit inside the cluster's stop and within what is left of the day's allowance.
Four recovery fixes
A recovery leg is not removed while the trade is at risk
Since 25 September, a recovery leg can no longer be removed while its cluster can still lose money. A leg may only be removed once the cluster is locked in at break-even or better.
Keep the stop, re-add the leg
On 30 September, an S&P 500 cluster's stop was pulled in closer. The planned last recovery leg still fitted inside the new stop. But a second calculation measured the room from the current price instead of from the entry, and it quietly dropped the leg. Since 1 October at 04:31 UTC, the number of legs is set once, when the plan is fixed. A tighter stop is kept, and the planned leg is still placed as long as it fits inside the stop with room for the spread.
A break-even stop is never undone
Since 1 October at 05:19 UTC, a stop at break-even can no longer be moved back. If a stop loosens for any other reason, the cluster gets its recovery leg back. The trade that prompted this fix is described in How a stop moves on a winning trade.
FX orders come back
Iris avoids holding two FX positions that carry the same currency risk. On 29 September a euro-sterling trade filled, so the waiting euro-dollar, sterling-dollar and euro-yen orders were removed. The euro-sterling trade closed a few minutes later, but the other orders did not come back for the rest of the day. Since 1 October at 00:09 UTC, an order removed for overlapping exposure is recorded. Once the overlap has cleared, the order is placed again with fresh sizing. Separately, since 26 September a cluster's planned recovery survives a restart, so a restart no longer changes the plan.
FX range trades, redrawn
Since 4 October at 09:33 UTC, FX range trades work differently. A range trade places a buy order at the top of a price range and a sell order at the bottom. Now:
- A buy is stopped at the bottom of the range, exactly where the sell order sat. A sell is stopped at the top.
- The first recovery leg sits in the middle of the range. Any further legs are spaced in equal steps between the middle and the stop.
- If the range is too narrow for a sensible stop, the setup is skipped. The stop is never pushed wider to make it fit.
- The entry is sized on the stop and ladder that are actually placed: its family's share, or less if less of the allowance is left.
Before this change, FX stops were set from a typical-move distance and often sat well beyond the range, and no recovery leg was ever placed in the middle.
The checks as small programs
Three rules from this post, written out. They are simplified sketches, not the engine's source code.
Placing and removing a recovery leg
def can_place_leg(cluster, leg, day):
inside_stop = leg.price_is_inside(cluster.stop) # must fit inside the cluster's stop
within_room = leg.loss_at_stop <= day.left # checked at the moment it is placed
return inside_stop and within_room
def may_remove_leg(cluster):
return cluster.stop_is_break_even_or_better # never while the cluster can still lose
How deep the ladder goes
def ladder_depth(market_read, family_share_in_use):
if family_share_in_use == "much":
return "short" # stays short, whatever the market
return {"calm": "short", "deep": "longer", "volatile": "longest"}[market_read]
An FX range trade, redrawn
def fx_buy_range(top, bottom, legs):
"""Buy order at the top of the range, stop at the bottom."""
middle = (top + bottom) / 2
step = (middle - bottom) / legs # equal steps from the middle to the stop
return {
"entry": top,
"stop": bottom,
"recovery_legs": [middle - i * step for i in range(legs)], # first leg in the middle
}
A sell works the same way, mirrored: entry at the bottom, stop at the top. If the range is too narrow for a sensible stop, the setup is skipped and the stop is never pushed wider to make it fit.
What you need to do
Nothing. These rules apply on the engine for every account it trades.
Notes
- The examples name instruments so they can be followed. They show how a rule behaved, not a result.
- Internal change references: #388 (closed cluster), #407 and #474 (waiting orders), #447 (room per family), #488 (gold reversals), #487 (FX twin order), #466 (Friday), #435 and #475 (recovery depth), #439 (no removal while at risk), #486 (keep the stop, re-add the leg), #479 (break-even never undone), #485 (FX orders come back), #455 (plans survive a restart), #477 (FX range trades).