Automated Break of Structure Trading System
A rules-based intraday strategy that detects structural breaks across M5, M15, and H1 timeframes on US indices and gold, validated through systematic historical backtesting.
The Break of Structure (BOS) strategy was systematically backtested against historical M5, M15, and H1 candle data. Three instruments — NAS100_USD, US30_USD, XAU_USD — are currently promoted to live MOMENTUM entries on M5 + M15 (H1 remains scan-only across all three; see tier matrix section). SPX500 was demoted to fully scan-only at v1.14.70 after shadow WR sat below breakeven; XAG_USD carries the H4 relaxation for shadow-data accrual but is not live-promoted. Each backtest sample was evaluated with strict look-ahead protection, 2:1 minimum risk-reward, and production-grade stop-loss buffers.
Production expectancy is anticipated to land 5–10% lower than backtest due to real-world friction (spreads, slippage, partial fills). The strategy retains substantial margin against that degradation while remaining institutionally robust.
Live demo performance is tracked against these baselines via the Analytics dashboard. Any sustained deviation greater than 15 percentage points triggers an automated drift alert.
The bot monitors the full instrument set on three timeframes (M5, M15, H1) but places live orders only on the three currently promoted instruments — NAS100_USD, US30_USD, XAU_USD. When a decisive candle closes through a recent confirmed swing high (bullish BOS) or swing low (bearish BOS), the classifier evaluates two magnitude gates: is the break strong enough (departure_r above the per-symbol threshold), and does the higher-timeframe context (H4) support it? If both clear, the bot places a market order at the current price. No retrace wait, no PLANNED row publication on live signals.
A Break of Structure is the moment when price decisively closes through a recent confirmed swing high or swing low. It signals that the prior range is broken and the prevailing direction has been re-confirmed by aggressive participation. Live MOMENTUM entries take these signals only when the H4 backdrop supports them (or on the four instruments whose H4 rule is relaxed for data-collection reasons; see the H4 regime filter section in the Trade Playbook).
A structural break followed by a clean retrace into a fresh supply or demand zone is the closest thing financial markets offer to a high-probability setup — the entry point where institutional participation has just shown its hand. The bot does this calculation across four instruments on three timeframes simultaneously, every minute.
— Why this worksEvery trade carries a fixed risk-to-reward floor of 2:1. Every entry includes a structurally placed stop loss with a buffer. Every position has a time limit. Every loss is categorised by the AI loss-analysis layer and learned from. No discretionary entries, no revenge trades, no overtrading.
A live MOMENTUM entry is built in six sequential stages. The bot enters only when each stage passes a specific check. The legacy H1 / H4 supply & demand strategy was retired at v1.14.0; the RETRACE limit-order path was demoted to shadow-only at v1.14.79. Every live OANDA order today comes from the MOMENTUM path described below.
Every loop, on three timeframes (M5, M15, H1), the bot looks for the most recent significant swing high and swing low and asks: has a candle just closed beyond it? A wick poking through doesn't count. The candle's body must clear the structure level. A bullish BOS = strong close above a prior swing high. A bearish BOS = strong close below a prior swing low. This is the trigger that says "something has changed".
Two per-symbol gates decide the class: departure_r (how strong the break candle is, measured in ATR multiples) and H4 regime (higher-timeframe context). MOMENTUM = strong departure AND H4 aligned (or H4=RANGE on the four relaxed instruments). RETRACE = moderate departure, or strong-but-unaligned on non-relaxed syms. WEAK = below the moderate threshold. Only MOMENTUM-classed BOSes advance to a live entry attempt; RETRACE and WEAK write to the shadow journal.
A MOMENTUM classification still has to line up with the daily candle direction — bullish BOS on a bullish daily, bearish on a bearish daily. Counter-trend BOSes are refused regardless of the H4 verdict. The bot also checks that price hasn't already run too far past the break-close (a staleness guard — no chasing setups the market has already moved beyond).
SL is placed distal-anchored (beyond the recent structure) with a per-instrument ATR floor. TP is placed at the pre-climb swing beyond entry (or a per-symbol clamp if that swing overshoots). If the resulting reward-to-risk is below 2.0, the setup is silently shadow-journaled and rejected. Every live entry clears the 2.0 floor before it reaches OANDA.
Even a clean MOMENTUM setup is not automatic. The bot runs a stack of checks: news block (FOMC / NFP windows), account drawdown cap (-5% daily), per-direction daily loss cap, per-instrument single-position cap, correlation group cap (indices max 1 live in real-money, metals max 1), balance floor, entry-pause flag, tier-matrix (sym, tf) status. Any failure shadow-journals the setup and rejects the order.
If all gates clear, a market order goes to OANDA at current price with pre-attached stop loss and take profit. From that moment the bot manages the trade with two safety nets: the time-stop (max hold M5: 3h, M15: 6h, H1: 8h — H1 not live-promoted today) closes stalled positions, and the breakeven move runs at +1R after Stage 1 unlocks. Otherwise it's stop or target — whichever hits first. Post-fill slippage is monitored (v1.16.0); trades filling with adverse slippage above a per-symbol threshold are resized to preserve the £-risk envelope.
A clean break of structure looks completely different to a messy chop-through. The bot only acts on the clean ones. Here are the six criteria it checks before a BOS becomes a live setup — in plain English.
The broken swing high or swing low must be a recognised structural pivot — at least a handful of candles forming on each side, not a single random spike. The bot uses a swing-detection routine with a fixed lookback (the swing-k constant) so the structure being broken is always meaningful, never noise.
The candle that breaks structure must close beyond the level, not wick through and pull back. A wick-only poke is a fake break and is rejected. A solid body clearing the level is what gets a BOS persisted.
Bullish BOS only trades on a bullish daily candle; bearish BOS only on a bearish daily. The strategy never takes a countertrend break — those are statistically the lowest-quality entries on any timeframe.
The retrace zone the bot builds must have a width inside a regime-adaptive band. In HIGH volatility regimes the band widens so noise doesn't disqualify good setups; in LOW regimes it tightens. Zones outside the band are rejected — too narrow means retrace will overshoot, too wide means the R:R is poor.
From the planned entry (zone proximal line) to the planned target (the broken swing level), the reward must be at least 2× the risk to stop. If RRR is below 2.0 the BOS is silently shadow-journaled but never publishes a planned trade. The 2:1 floor is non-negotiable.
Each timeframe has its own life span on a BOS: M5 expires after 6 hours, M15 after 12 hours, H1 after 24 hours. After the window passes the BOS no longer counts toward an entry. Stale breaks are not chased.
Think of the six criteria like a pilot's pre-flight checklist. Each item is a single binary check, but every one has to pass before the plane takes off. The bot's BOS pipeline works the same way — fail any one criterion and the flight is grounded. The pilot doesn't override and neither does the bot.
— Why every criterion is binaryInstitutions think about price in terms of ranges. When Gold is near the bottom of a recent trading range, it is in discount — relatively cheap. When it is near the top of a recent range, it is in premium — relatively expensive. The bot's job is to buy cheap and sell expensive. A buy zone sitting in the discount half of the range is aligned with how institutions think. A buy zone in the premium half is working against it.
Price sits in the bottom half of the current range — institutions accumulate at discounted prices. A BOS that retraces back from a discount typically has cleaner continuation behaviour because it's not fighting the institutional flow.
Price sits near the midpoint of the range — neither cheap nor expensive. The BOS trade decision comes down to the structural quality and RRR alone.
Price sits in the top half of the range. Buying a BULLISH BOS at premium means buying where institutions tend to distribute — historically a harder continuation. Worth knowing, even if BOS doesn't gate on it.
Important caveat: the BOS strategy does not filter or score on discount/premium directly — it gates only on structural quality, daily alignment, RRR ≥ 2.0, and the 17 pre-entry checks. This page kept the cheap-vs-expensive concept because it remains useful market context for operators reading a chart, but the bot itself does not act on it. Calibration may add an explicit P/D filter to BOS in a later version if the journal data shows a strong outcome difference.
The BOS strategy currently places live orders on three instruments — NAS100_USD, US30_USD, XAU_USD — on the M5 and M15 timeframes. H1 across all three is scan-only per the tier matrix (v1.16.1 enforcement). SPX500, XAG, EUR/USD, USD/JPY, GBP/USD, and AUD/USD run in scan-only mode across every timeframe; their detections write to the shadow journal but no OANDA orders are placed.
US Tech 100 (Nasdaq). Highest BOS frequency of the three. Live on M5 and M15; H1 is scan-only (overnight-gap + wider-swing risk). Departure_r threshold: 0.3 (indices bucket).
Dow Jones Industrial Average. Live on M5 and M15; H1 scan-only. Same 0.3 departure_r threshold as NAS100. Different sector mix from NAS provides small within-group diversification, though the correlation-group cap still limits to one live position at a time.
Gold. Live on M5 and M15; H1 scan-only. Departure_r threshold: 0.7 (metals bucket). Independent driver set from indices (safe-haven vs risk-on divergence) — natural partial hedge against US equity exposure when both groups are open simultaneously.
Six other instruments run in scan-only mode: AUD_USD, EUR_USD, GBP_USD, SPX500_USD, USD_JPY, XAG_USD. Their BOSes classify into MOMENTUM / RETRACE / WEAK the same way, but never reach the live entry path — every eligibility check refuses with TIER_NOT_LIVE. Promotion follows the shadow-data rule described in the tier matrix section.
Correlation group caps prevent overexposure: US Indices (NAS, SPX, US30) maximum one live position concurrently on real-money mode, two on demo. Metals (XAU + XAG) capped at one. FX and USD_JPY have their own caps (currently unreachable — all scan-only). The bot never opens correlated positions on the same macro thesis — that is concentration, not diversification.
This is the part that matters most. The strategy could be perfect and still lose money without strict risk rules. Every rule below is hardcoded — the bot cannot override them, cannot talk itself into an exception, and does not have bad days where it ignores them.
The maximum we can lose on any single trade is 1% of the account. On a £10,000 account that is £100. Position size is calculated automatically to enforce this every time.
The bot will not enter a trade unless the potential profit is at least twice the potential loss. If there is no target that far away, it skips the trade entirely.
If the account drops 5% in a single day, the bot stops trading for the rest of that day. A bad day cannot become a catastrophic day.
Up to two trades per session — two in London, two in New York. Each session is independent. A bad London morning does not cancel the NY afternoon.
After two losses in a single session the bot stops for that session. This prevents a bad run from compounding. The next session starts fresh.
If total losses in a session reach -1.5R — one and a half times the original risk — trading stops for that session even if fewer than two trades have been taken. Protects against a single large loss eating the session budget.
There is also a sophisticated news filter. Before major economic announcements — FOMC, CPI, NFP, interest rate decisions — the bot enters a hard block and will not trade. The moment the announcement releases, it switches to watch mode and looks for high-quality zone retests, requiring a stronger setup than normal.
As the account grows, the bot automatically adjusts how much it risks per trade and which instruments it trades. Bigger accounts can afford to risk a smaller percentage on each trade (still meaningful in pound terms) and unlock the more expensive instruments. The bot detects the right tier at each session open and applies it without you having to do anything.
All four Tier A instruments active. Higher percentage compensates for the smaller balance — at £500 risking 1% per trade is £5, which is too small to make the system mathematically worthwhile.
Risk percentage drops as the account grows. Positions on NAS100, SPX500, US30, XAU are now large enough to capture meaningful R-multiples on each trade.
Risk continues to scale down. Bigger account → smaller percentage per trade. Real pounds at risk per trade keep climbing, but as a proportion of the account they get smaller.
Institutional-grade risk percentage. At this size, 1% per trade is real money — discipline matters more than aggression. This is the level the strategy is ultimately designed for.
Promotion and demotion are automatic. When the balance crosses a threshold up or down, the bot sends a Telegram message explaining what changed. There is no manual configuration. A demotion (after drawdown) is not a crisis — the bot just adjusts the risk down to match the new account size and continues. The same four Tier A instruments trade at every tier — only the risk percentage changes.
Once a trade has moved in our favour by the amount we were willing to risk, the bot tightens the stop loss so the trade can no longer become a full loss. The worst outcome from that point is a tiny loss equal to the buffer — never the full 1% the trade started with. The trade can still hit its target and produce a winner.
Why not move the stop to exactly the entry price? Because then a tiny retracement — completely normal market noise — would kick us out of trades that were about to continue running. So the bot moves the stop to entry plus a small instrument-specific buffer. The size of the buffer adapts to current volatility: it's clamped between a static per-instrument floor and 20% of the H4 ATR, so a quiet day uses the floor and a volatile day uses a larger absorption. Small enough to limit loss, big enough to absorb normal noise.
When does this activate? Only after the 50 paper trades are complete (the gate). Before that, every trade runs to its full stop or target — that is intentional to collect uncontaminated performance data. After the gate, breakeven turns on automatically.
Once a session — London or New York — has produced enough profit in R-multiples, the bot stops opening NEW trades for the rest of that session. Existing trades keep running to their targets or stops. This prevents the bot from giving back a profitable morning by overtrading into the afternoon. The next session starts fresh.
Why does this work with breakeven, not instead of? Breakeven protects each individual trade once it is profitable. Session target protects the session as a whole once enough trades have been profitable. Without breakeven, the session target could fire only to watch open trades reverse and turn red. Without the session target, breakeven trades could compound into overtrading on a good day. They are the position-level and session-level versions of the same idea: keep what you have won, do not give it back.
When does this activate? Both protections activate together after the 50-trade gate AND once we have calibrated the target from real journal data (typically average winning session R × 0.8). One without the other is half a solution. Until then, this protection is dormant — zero impact on trading.
NAS100, SPX500 and US30 move together more than 90% of the time — they are the same US-equity story told three ways. If we took a NAS100 trade AND an SPX500 trade at the same moment, we would not really be diversified — we would be tripling down on the same equity-indices move. The bot enforces a strict rule: maximum one open trade per correlation group at a time.
Maximum one position open. If NAS100 fires first and an SPX500 BOS planned trade appears, the bot skips SPX500. Not a missed trade — a protected trade.
Effectively standalone in the current Tier A list — Silver is scan-only so the metals group never blocks XAU. If Silver is later promoted to live, the group cap activates automatically.
Why this is honest about risk. An earlier version of the bot allowed correlated instruments to trade at the same time at a reduced position size (0.7% each instead of 1%). The maths looked clean — 0.7% + 0.7% = 1.4% — but it was a disguise. If indices sold off, both stops hit together: real risk was 1.4%, not 1%. The current strict rule fixes that. One indices trade. Full risk on that one trade. No mathematical illusion of diversification.
Cross-group is fine. NAS100 open and XAU open at the same time is allowed — US indices and metals are independent. The rule only blocks within the same group. So a peak market morning could see two simultaneous trades — one from each group — and that is the design.
When anything significant happens, a Telegram message arrives. Here is what each one means so nothing ever looks confusing.
How live-entry alerts land today. A MOMENTUM entry fires on BOS candle close — there is no PLANNED / RETRACE-CONFIRMED sequence for live orders under the current policy. The 🎯 BOS PLANNED and ✅ BOS RETRACE CONFIRMED messages listed below still fire, but only for RETRACE-classified BOSes that are being tracked in the shadow simulator — no live order results from them. The ⚡ BOS FIRED and close-outcome messages are what actually correspond to a live position.
— Alert flow post-v1.14.79A new break of structure has just formed. The message shows the broken swing price and the candle close that confirmed it. No plan published yet, no order placed. This is the earliest possible heads-up that a setup is developing.
A qualifying retrace zone has been identified and the planned trade is now on the dashboard. The message shows entry, stop loss, target, RRR, and zone score. Bot is waiting for price to come back into the zone. You can preview the setup and decide whether to mirror manually if you want a head-start.
Price has retraced into the planned zone, all 17 pre-entry gates have cleared, and the bot is about to place the order. Last chance to override manually. The message tells you how many positions (1 or 2 — aggressive mode) and the exact entry price.
Order placed at OANDA. Entry, stop loss, target, RRR, and the exact GBP risk are confirmed. If you are mirroring it, do it now — though the planned alert above gives you a head-start.
Price moved in our favour by the full risk amount (1:1). The stop loss has been moved to the entry price. This trade is now risk-free — the worst outcome is zero profit. Only fires after Stage 1 unlocks.
Trade closed at profit. The R number shows how many times the risk was returned. +2.3R on a £100 risk = £230 profit. Exit price + reason (TARGET_HIT / BE_SAVE / TIME_STOP) appear in the message.
Trade closed at a loss. Maximum loss is always 1R — the 1% agreed in advance. Claude immediately categorises the loss (RETRACE_MISS, TRENDLINE_INVALIDATE, IMPULSE_TOO_EARLY, AGGRESSION_TIMEOUT, etc.) so patterns become visible over time.
The trade was held for the maximum hold window (M5: 3h, M15: 6h, H1: 8h) without hitting target or stop. If breakeven was already secured, the bot force-closes at BE. If not, this is an alert-only message — the original stop continues to manage exit.
v1.13.6 addition. You opened a trade directly in OANDA (bypassing the bot). The bot has noticed and journaled it to manual_trades.csv. It will not manage it — no breakeven, no partial, no trail. The P&L still counts toward the daily DD cap because that comes from the account balance directly.
A loss is not a failure — it is the cost of doing business. Even the best professional traders lose 40–50% of their trades. What matters is that wins are larger than losses. A 40% win rate with a 2:1 minimum reward ratio means you grow your account even on a losing week.
The bot is designed to improve over time. Every trade is recorded in full — the structural break, the timeframe (M5 / M15 / H1), the retrace zone, the volatility regime, the day-type, the outcome, the R multiple, how far it went in profit before closing. After every loss an AI categorises the failure (RETRACE_MISS, TRENDLINE_INVALIDATE, IMPULSE_TOO_EARLY, AGGRESSION_TIMEOUT, …). Every 10 losses it produces a pattern report. Every Sunday it runs a correlation analysis across all trades.
There are three stages, and we move through them deliberately:
The first 50 trades run on a practice account. The bot operates exactly as it would with real money — same signals, same sizing, same rules — but nothing real is at stake. We are building the evidence that the strategy works before we commit capital. This is where we are right now.
After 50 trades with a win rate above 40%, average reward above 2:1, and 90% of trades following all rules — the bot passes its quality gate. Stage 1 activates: once a trade reaches 1:1 profit, the stop loss automatically moves to the entry price. The trade becomes risk-free.
After 80 trades with proven performance, full management activates — half the position is closed at 1:1 to lock profits, the remaining half trails with a stop that follows the price. Maximum capital protection with maximum upside on strong moves. This is when real capital enters.
We will not deploy real capital until the numbers prove the strategy works. The gate requires a 40% win rate, 2:1 average reward, and 90% rule compliance across 50 trades. That is not caution — that is how you build something that lasts.
Carefully. With rules. Without rushing. One trade at a time.
XAU · NAS100 · US30 (live-promoted) — Break of Structure Trading Bot · v1.16.15