EA LAB • TRADING STRATEGY #009 • BREAKOUT
Inside Bar Breakout Strategy
A completed mother candle defines the range. One to five completed inside candles compress inside it. An EMA chooses the permitted direction, then a stop order waits for a breakout.
Explore EA009 for MT5Read the manual
The idea: compression before a directional move
Inside bars describe a pause: the whole candle range fits within an earlier mother candle. EA009 turns that idea into explicit rules that can be tested. It does not predict that every compression will expand profitably. A breakout can fail immediately, drift sideways or trigger a stop before the target.
The strategy uses ordinary time-based OHLC candles. It does not generate Renko bricks. The supplied example runs on US100.pro H4, but the signal timeframe is configurable. Changing a timeframe changes the candles and the detected patterns.
BUY permission
The last closed signal candle closes above the EMA. A qualifying inside-bar pattern allows a BUY STOP beyond the mother high, including the configured offset.
SELL permission
The last closed signal candle closes below the EMA. A qualifying pattern allows a SELL STOP below the mother low. Equal close and EMA gives no directional permission.
Exact setup and execution rules
- Select the signal TF. M5, M15, M30, H1, H4, D1 or CURRENT. CURRENT follows the chart timeframe.
- Count closed inside candles. InpInsideBars accepts 1-5. The mother is excluded from that count and sits at shift N+1.
- Check the full range. Each of the N candle highs/lows must fit within the same mother range. Tolerance 0 is strict; positive point tolerance permits limited excursions. Equal boundaries are accepted.
- Apply directional permission and operating filters. EMA, long/short switches, broker server hours, weekday permissions, spacing, position capacity, volume, margin and licence state.
- Place the batch. The robot sends its configured number of separate stop tickets. An intrabar price breakout can fill them; a breakout candle close is not required for entry.
InpCounterMATrade bypasses EMA permission and allows both directions, but other filters remain active. With InpCancelOpposite enabled, opposite pending orders can be removed and an opposite batch may be blocked by today’s newest open position. It does not automatically close opposite open positions.
A developing range is a visual aid. It is not a trade signal before all required inside candles have closed. If price has just passed the planned stop level, an optional market fallback can catch it within a defined chase cap; it does not chase a move beyond that cap.
Stop, target and closed-candle trailing
The initial stop distance is the smaller of StopLoss and mother range × StopLossRange, expressed in broker points. StopLossRange=0 uses a fixed StopLoss distance. This measures risk from the planned entry; it is not necessarily the opposite mother edge.
TP is a multiple of the initial entry-to-SL distance after tick rounding. The example uses 2R. Once set, TP remains fixed even when SL is tightened. Fill slippage can change realised initial R/R.
A new inside candle freezes the existing SL. A later candle must CLOSE beyond that stored inside range in the trade direction to resume trailing; a wick alone is insufficient. At resumption, the anchor is the most recent stored inside candle. A profitable position at the time of evaluation does not guarantee that the new stop itself locks a profit.
Actual BUY: planned levels versus the fill

The planned stop entry was 21,832.4. Six 0.01-lot BUY tickets filled at 21,833.4 on 6 February at 16:12:32. Initial SL was 21,706.8 and TP 22,083.6. The 1.0 price-unit fill difference explains why actual fill-to-target R/R differs slightly from the planned 2R. These tickets later closed at 21,828.5 on 7 February via a moved SL.
Actual SELL: breakout to the fixed target

Entry: 3 March 2025, 15:55:38, SELL 20,884.4. Initial SL 21,134.4 and TP 20,384.4. All six 0.01-lot tickets reached TP at 21:28:28. The 250.0 initial risk and 500.0 target distance implement 2R.
Actual SELL: held across several days

Six 0.011-lot SELL tickets opened on 16 April at 16:00:14, price 18,513.1. SL was 18,763.1; TP 18,013.1. They exited at TP on 21 April at 15:59:17. AutoLot changed the per-ticket volume from the earlier 0.01. The holding period includes a weekend.
Actual BUY: an SL exit can be profitable

SL identifies the exit mechanism, not whether the trade lost money. A tightened BUY stop can sit above entry. The February example also shows the other outcome: a moved stop can still close slightly below entry. We have not inferred exact prices, timestamps or P/L for the path in this screenshot.
Historical evidence: profit and drawdown together
5,000.00 initial deposit → 10,025.06 final balance.
2,461.92 USD at the reported drawdown peak.

| Symbol / signal timeframe | US100.pro / H4 |
|---|---|
| Period / data source | 2025-01-01 to 2026-10-01 / OANDA TMS Brokers S.A., OANDATMS-MT5 |
| Deposit / leverage | 5,000 USD / 1:100 |
| Profit factor / win rate | 3.14 / 72.00% of completed ticket trades |
| Count | 150 completed ticket trades, 300 trade deals; 25 six-ticket exit batches. Tickets within each setup are correlated. |
| Balance drawdown | Maximum relative 13.85% (1,537.74 USD) |
| Test configuration | 1 inside bar; EMA 90; SL range multiplier 2, cap 2500 points; TP 2R; closed-candle trailing shift 2, buffer 50 points; AutoLot, recovery and profit-funded loss reduction ON. |
| Quality / costs | Reported quality 100%; 323,352,053 ticks. Deal commission and swap totals 0.00. Explicit modelling selection and spread schedule are not specified. |
Historical simulation, not a live-account result or forecast. The balance ledger reconciles to every reported running balance and to 10,025.06 USD at the end. The report identifies the EA filename, while source and screenshot panels identify v1.28; binary equivalence was not independently certified. No untouched out-of-sample or forward result was supplied.
The inputs that change this strategy most
| Input | Effect | Supplied example |
|---|---|---|
| InpInsideBars | Required completed compression candles, excluding mother | 1 |
| ma1Period | EMA direction filter speed | 90 |
| StopLossRange / StopLoss | Range-dependent stop distance and absolute cap | 2 / 2500 points |
| InpTPRiskReward | Fixed initial R/R target | 2 |
| InpTrailCandleShift / buffer | Closed candle reference and stop spacing | 2 / 50 points |
| initialVolume / InpOrdersNr | Per-ticket lot and correlated batch size | 0.01 / 6 |
Exposure is part of the strategy
The default batch is six tickets, not one independent trade. AutoLot scales volume by current balance divided by balance at EA start; it is not fixed-percentage risk sizing. Recovery multiplies ticket volume by recovery level × factor when enabled. It derives the level from remaining open ticket count at a daily update, not simply from the last losing trade.
Optional profit-funded loss reduction uses net realised profit from its rolling window to close eligible older losers; it does not open a hedge order. It can produce exits before SL or TP. Both recovery and loss reduction are enabled in the supplied report, although disabled in factory defaults. Those results therefore describe the complete configured system.
How to test without confusing the result
- Use a hedging account, the exact broker symbol and correct point/contract units.
- Compare signal and exit settings with exposure held fixed. Test optional recovery modules separately.
- Use 1-minute OHLC only for preliminary screening; validate candidates on real ticks with realistic costs.
- Choose Custom max: SMOOTH EQUITY ranks return, equity linearity and weekly progress while penalising stagnation and drawdown. The 40-trade and 35% relative equity DD gates count ticket trades.
- Reserve an untouched chronological validation period, check neighbouring settings and run a demo forward test.
False breakouts, gaps, spread, slippage and correlated exposure remain material. Server-time filters do not translate automatically into your local timezone. Restarting changes in-memory recovery state and the AutoLot balance baseline. Broker-side stop execution does not guarantee the specified price.
Frequently asked questions
Does hiding the EMA disable its filter?
No. InpShowEMA changes the drawing only.
Does the entry wait for a breakout close?
No. Setup candles must be closed, but the pending stop can fill intrabar. A close-confirmation rule is used by the inside-bar trailing unlock.
Can it run on a netting account?
No. This build explicitly requires hedging to preserve independent batch tickets.
Are the example settings a live recommendation?
No. They document one historical test. Broker settings, costs and exposure must be assessed independently.
Educational explanation of supplied software. Historical results do not guarantee future performance.
