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 for NAS100, SPX500, US30, and XAU. Each timeframe was evaluated independently 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 four instruments around the clock: NAS100 (US Tech 100), SPX500 (S&P 500), US30 (Dow Jones), and XAU (Gold). On three timeframes — five minutes, fifteen minutes, and one hour — it watches for a specific structural pattern called a Break of Structure, then waits for price to retrace into a supply or demand zone before entering a trade.
A Break of Structure is the moment when price decisively closes through a recent confirmed swing high (bullish) or swing low (bearish). It signals that the prior range is broken and the prevailing direction has been re-confirmed by aggressive participation. The bot only acts on breaks that align with the daily candle direction — never counter-trend.
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 Break of Structure entry is built in six sequential stages. The bot does not enter on a hunch or a single signal — it enters only when each stage passes a specific check. Roughly 95 percent of evaluations are rejected somewhere along the chain, which is exactly the design intent. Quality over quantity.
Every live OANDA order in the current release is opened by the BOS path described below. The legacy H1 / H4 supply & demand strategy has been retired (it still scans in the background to feed the shadow journal, but it never fires a real order).
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".
A BOS on its own can fail. The bot reads the current daily candle direction and only trades BOS in the matching direction — bullish BOS on a bullish daily, bearish BOS on a bearish daily. A bullish BOS appearing on a heavy bearish daily is the classic countertrend trap — the bot ignores it. This single rule filters out a large class of losing setups.
After the structure breaks, price usually pulls back toward the broken level before continuing. The bot builds a small demand zone (for bullish BOS) or supply zone (for bearish BOS) inside the retrace area, then computes the planned entry, stop loss (just beyond the zone), and take profit (the broken swing level). If the reward-to-risk is below 2.0, the setup is silently dropped. Only setups with RRR ≥ 2.0 publish to the dashboard as 🎯 BOS PLANNED.
The plan sits patiently on the dashboard. The bot does not chase. If price retraces into the planned zone within the active window (M5: 6 hours, M15: 12 hours, H1: 24 hours), the setup becomes a live entry candidate. If the window expires without a touch, the BOS is discarded — no entry, no shadow row regret. The structure broke; the market moved on.
Even after the retrace touches the zone, the entry is not automatic. The bot runs a stack of checks: news block (FOMC / NFP windows), structure misalignment, account drawdown cap (-5% daily), per-direction daily loss cap (one direction can only lose a fixed amount per day), correlation group cap (indices and metals each have their own slot count), balance floor. Any failure shadow-journals the setup and rejects the order.
If all gates clear, a market order goes to OANDA with the pre-attached stop loss and take profit. From that moment the bot leaves the trade alone except for two safety nets: the time-stop (max hold M5: 3h, M15: 6h, H1: 8h) closes positions that have stalled, and the breakeven move runs at +1R after Stage 1 unlocks. Otherwise it's stop or target — whichever hits first.
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 operates on the four Tier A instruments identified by the backtest as positive across every evaluated timeframe. Additional instruments (XAG, EUR/USD, USD/JPY, GBP/USD, AUD/USD) run in scan-only mode — the bot records their detections and shadow trades for analytics but does not place real OANDA orders against them.
US Tech 100 (Nasdaq). The highest BOS frequency of the four. Live on M5 and M15 timeframes; H1 detection runs in scan-only mode pending demo-data review.
S&P 500 broad equity benchmark. Live on M5. M15 and H1 detection runs in scan-only mode — promotion to live tier follows the same data-driven gate as NAS.
Dow Jones Industrial Average. Live on M5 and M15. Differs from NAS / SPX in sector mix and reaction to interest-rate news — provides a small diversification benefit within the US Indices correlation group.
Gold. Live on M5 and M15. Independent driver set from indices (safe-haven vs risk-on divergence) — partial natural hedge against US equity exposure when both groups are open simultaneously.
Correlation group caps prevent overexposure: US Indices (NAS, SPX, US30) maximum one live position concurrently on real-money mode, two on demo. Metals (XAU) capped at one. 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.
Why three pre-entry alerts? A BOS develops in stages: structure breaks, then price retraces, then a planned trade publishes, then the retrace actually touches and confirms. Each stage is a chance to review and prepare. The bot fires one Telegram per stage so the operator never finds out about a live trade only when the order has already opened. From v1.13.4 onward the BOS path matches the legacy zone strategy's alert cadence.
— Why the BOS path now alerts in stagesA 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.
NAS100 · SPX500 · US30 · XAU — Break of Structure Trading Bot · v1.13.9