Gold Box Breakout
- Experts
- Versione: 1.13
- Aggiornato: 15 agosto 2026
- Attivazioni: 5
Gold Box Breakout is an automated H1/M15 breakout strategy that now combines TWO independent breakout conditions in a single EA. Each condition builds its own daily "box" from H1 candle data and, when an M15 candle closes beyond its own box, opens its own trade. Each condition takes at most 1 trade per day, so the EA can open up to 2 trades per day in total — either, both, or neither may fire on a given day, entirely independently of each other.
Key Features
- Two independent breakout strategies in one EA
- Strategy A – Fixed Candle Box: the daily box is built from the High/Low of a chosen H1 candle of the day (by index, default: the 3rd candle).
- Strategy B – Color-Flip Box with Body Filter: starting from a chosen H1 candle, the EA scans forward for the first candle whose color flips (opposite) from the candle before it and whose body is larger than a configurable percentage of that previous candle's body (default: greater than 50%). This filters out weak/small reversal candles so only a decisive flip builds the box.
- Fully independent trade management per strategy – its own magic number, lot size, Risk:Reward ratio, and spread filter, so the two strategies never interfere with each other's "one trade per day" limit.
- GMT-based day start with auto offset detection – the day-start hour is set in GMT/UTC and shared by both strategies, so the same setting behaves consistently across different brokers/accounts.
- M15 breakout entry – each strategy waits for a confirmed M15 candle close beyond its own box, avoiding intrabar noise.
- Fixed Risk:Reward exit – Stop Loss is set at the opposite side of each strategy's own box; Take Profit is calculated from a configurable Risk:Reward ratio (set separately for each strategy).
- One trade per day, per strategy – after a strategy opens a trade (win, loss, or still running), that strategy will not open another position until the next trading day. The other strategy is unaffected and can still trade independently.
- Optional lot increase after consecutive stop-losses – after a configurable number of consecutive SL hits, lot size increases by a fixed step, up to a configurable maximum number of steps, then resets back to the base lot. Configured and tracked separately for each strategy. Disabled by default.
- NEW – Auto Trend Filter after a losing streak (per strategy) – by default, neither strategy filters by trend and every valid breakout is traded. If a strategy loses a configurable number of trades in a row by Stop Loss (default: 3 consecutive losses), that strategy automatically switches ON an H1 EMA(20/50) trend filter for its own signals only – Buys are only taken when EMA(20) is above EMA(50) on H1, Sells only when EMA(20) is below EMA(50). As soon as that strategy closes a trade that is not a stop-loss (a win), its losing streak resets and the trend filter automatically switches back OFF, returning to normal breakout trading. The other strategy's filter state is tracked completely separately.
- Spread filter – optionally skip trades when the current spread exceeds a configured limit (set separately for each strategy).
- On-chart visual tools – draws both boxes (each strategy in its own color), the candle High/Low levels, numbered labels on each H1 candle of the day so you can visually verify the candle-counting/flip logic for both strategies at a glance.
Inputs
General Setting
- InpDayStartHour – Day start hour (server time, 0–23), shared by both strategies.
- InpShowCandleLabels – Show number labels (0, 1, 2, ...) above each H1 candle of the day.
- InpDrawBox – Draw the box rectangles and level lines on the chart for both strategies.
Strategy A: Fixed Candle Box
- InpA_Enable – Enable/disable Strategy A entirely.
- InpA_CandleIndexOfDay – Which H1 candle of the day is used to build the box (0 = first candle of the day).
- InpA_Lot – Base lot size for Strategy A.
- InpA_RiskReward – Take Profit to Stop Loss ratio (e.g. 2.0 = 1:2).
- InpA_Magic – Magic number for Strategy A (must differ from Strategy B's).
- InpA_Deviation – Allowed slippage, in points.
- InpA_MaxSpreadPoints – Maximum allowed spread in points before skipping a Strategy A trade (0 = filter off).
- InpA_UseSLLotIncrease – Enable/disable the lot-increase-after-SL feature for Strategy A.
- InpA_SLHitsToIncrease – Number of consecutive Strategy A stop-losses required to trigger a lot increase.
- InpA_LotIncreaseStep – Lot added at each Strategy A increase step.
- InpA_MaxIncreaseSteps – Maximum number of increase steps for Strategy A before the lot resets to base.
Strategy B: Color-Flip Box
- InpB_Enable – Enable/disable Strategy B entirely.
- InpB_StartCandleIndex – H1 candle index of the day to start scanning for a color flip.
- InpB_MinBodyRatio – The flip candle's body must be greater than this ratio × the previous candle's body to qualify as the box candle (default 0.5 = must be >50%).
- InpB_Lot – Base lot size for Strategy B.
- InpB_RiskReward – Take Profit to Stop Loss ratio (e.g. 2.0 = 1:2).
- InpB_Magic – Magic number for Strategy B (must differ from Strategy A's).
- InpB_Deviation – Allowed slippage, in points.
- InpB_MaxSpreadPoints – Maximum allowed spread in points before skipping a Strategy B trade (0 = filter off).
- InpB_UseSLLotIncrease – Enable/disable the lot-increase-after-SL feature for Strategy B.
- InpB_SLHitsToIncrease – Number of consecutive Strategy B stop-losses required to trigger a lot increase.
- InpB_LotIncreaseStep – Lot added at each Strategy B increase step.
- InpB_MaxIncreaseSteps – Maximum number of increase steps for Strategy B before the lot resets to base.
Trend Filter (H1 EMA)
- InpUseTrendFilter – Base/manual trend-filter state. Normally left OFF (false) so both strategies trade every valid breakout; can be turned ON to always filter by trend.
- InpEMAFastPeriod – Fast EMA period on H1 (default 20).
- InpEMASlowPeriod – Slow EMA period on H1 (default 50).
- InpA_LossesToEnableTrendFilter – Number of consecutive Strategy A stop-losses that automatically switches the trend filter ON for Strategy A (default 3).
- InpB_LossesToEnableTrendFilter – Number of consecutive Strategy B stop-losses that automatically switches the trend filter ON for Strategy B (default 3).
Recommended Setup
- Minimum recommended capital: $1000, using a base lot size of 0.01 per strategy. Since up to 2 positions (one per strategy) can be open at the same time, size your capital and lots for the combined exposure of both strategies.
- Designed and tested for Gold (XAUUSD), but can be attached to other symbols.
- Can be attached to any chart timeframe (e.g. M15) – the EA reads H1 and M15 data internally regardless of the chart's own period, so it does not need to be attached to an H1 chart specifically.
- Always test on a demo account first and adjust the inputs to fit your broker's spread, StopsLevel, and trading hours before using on a live account.
Risk Warning
This EA runs two independent breakout strategies and can open up to two positions per day (one per strategy). Each strategy can optionally increase position size after consecutive stop-loss hits (a martingale-style money management option, disabled by default) and can optionally auto-enable an H1 trend filter after a losing streak – this changes trading behavior automatically but does not eliminate risk. The minimum capital and lot size above are a starting-point suggestion, not a guarantee against loss – position size should always be adjusted to your own risk tolerance and account size. Past performance and backtest results do not guarantee future results. Please understand the risks and test thoroughly before trading with real funds.
