Introduction to Breakout Strategy
Breakout strategies are based on the principle that price often accelerates once it moves beyond a defined range of support/resistance or high/low. These breakout points typically represent a shift in market sentiment and are often accompanied by increased volume and volatility.
In practical terms, a breakout occurs when price closes above a resistance level or below a support level that has been holding for a period of time. Traders use these moments to enter the market, aiming to capitalize on the momentum that often follows such a move. Breakouts can initiate new trends, making them valuable entry points for both short-term and long-term traders.
Popularity of Breakout Strategy
Breakout trading is one of the most widely adopted strategies among professional and retail traders for several reasons:
- Clear Entry and Exit Rules
Breakout strategies rely on predefined price levels, reducing ambiguity in trading decisions. - Momentum Alignment
Trades are aligned with directional momentum, increasing the probability of follow-through. - Applicability Across Markets
Effective in forex, commodities, indices, and even crypto, breakout principles are market-agnostic. - Effective During Volatility Spikes
News releases, session openings, and macroeconomic events often trigger breakouts, making the strategy effective during key time windows.
Its combination of simplicity and statistical edge makes it a cornerstone of many trading systems and Expert Advisors.
Advantage of Using a Breakout Strategy EA
Using an Expert Advisor (EA) to automate breakout trading introduces several performance and convenience benefits:
- Speed and Precision
The EA places and manages orders at precise levels and times without human delay. - Eliminates Human Emotion
The system executes trades based purely on logic and rules, avoiding emotional errors. - Time-Based Management
This EA includes features like time-to-cancel for untriggered orders and time-based profit-taking, enhancing control. - Box Sizing and Dynamic SL
The stop loss is intelligently based on the size of the breakout box, adapting to market conditions. - Trailing Stop Integration
Users can enable or disable trailing stop features for locking in profits after breakout. - Dual Mode: RBO and OBO
Supports both range-based and session-opening breakouts with full flexibility.
This allows for efficient, disciplined, and around-the-clock operation without the need for constant chart monitoring.
What is and Strategy of Range Breakout (RBO)
Definition:
Range Breakout (RBO) strategy identifies a horizontal price range formed over a specified time window—typically when the market is quiet or consolidating. The high and low within this range define a “box.” Stop orders are placed just outside the box in anticipation of a breakout in either direction.
Strategy Overview:
- Time Window:
Define the start and end time for the range (e.g., 01:00 to 05:00), and the duration of the box is (5 to 7hours). - Box Formation:
Measure the high and low during this period. - Order Placement:
Place Buy Stop slightly above the high, and Sell Stop below the low. - Stop Loss:
Based on the box size (range height). - Order Expiration:
If no breakout occurs within a set duration, cancel pending orders. - Profit Exit:
Via trailing stop or time-based close.
Use Case:
Commonly used during the Asian session to trade the London breakout. Ideal for capturing momentum once price escapes the quiet hours.
Using ICMarkets broker as an example, the box (support/resistance) is set from 03:00hour to 10:00hour, (10:00 is the start of London Session) with stop loss at the other side of the box and close positions at 18:30hour.
What is and Strategy of Opening Breakout (OBO)
Definition:
Opening Breakout (OBO) strategy focuses on capturing the volatility surge that often follows a major market session open (e.g., London or New York). It defines a short opening range, then places orders outside that range to catch the immediate price movement.
Strategy Overview:
- Opening Time Box:
Set a short period after market open (5 to 60min). - Box Formation:
Define high and low of price during this time. - Breakout Orders:
Buy Stop above the high, Sell Stop below the low. - Stop Loss and Take Profit:
Based on box height or via trailing logic. - Cancel Time:
Untriggered orders expire after a user-defined time. - Exit Options:
Time close, trailing stop, or fixed profit levels.
Use Case:
Ideal for trading the first burst of movement during the London or New York opening bell. Capitalizes on the surge of liquidity and directional momentum that often follows.
Starting of box (highest/lowest) is at New York Session (10:00hour) and end of box is 35 minutes from start. Use close by time option at 18:00hour
Terminology
New Day (Grey Arrow)
Marks the beginning of a new trading day. The EA resets and starts tracking the new breakout box based on configured start time.
Box Range (Blue Rectangle)
Represents the defined Box Time Range, during which the EA measures the highest and lowest prices to form the breakout zone. An unfilled box indicates box range filter does not meet the criterial and thus no orders will be placed for that day.
Upper Box/Trade Boundary (Green Arrow)
Indicates the upper breakout level. If price breaks above this point, a Buy Stop order will be triggered (if conditions allow). This is box level plus offset.
Lower Box/Trade Boundary (Red Arrow)
Indicates the lower breakout level. If price breaks below this line, a Sell Stop order will be triggered (if conditions allow). This is box level minus offset.
Cancel Order (Orange Arrow)
Occurs after a pre-defined Cancel Order Duration following the end of Box Time. Any pending Buy/Sell Stop orders are cancelled if not triggered by this point.
Close Position by Time (Yellow Arrow)
Defines the forced close time for any remaining open positions. This occurs after the cancel time, and ensures no trades carry forward into uncertain market hours.
Factor and Percentage
Factor and Percentage is always with respect to another setting/parameter/value. The main difference between factors and percentages is that factors are whole numbers that divide another number exactly, while percentages are fractions of 100 that describe proportional relationships.
All-in-One EA can be found here:
https://www.mql5.com/en/market/product/134347
Settings
1. Money Management
These settings control how the EA manages position sizing and risk.
Money Management Type (MMType)
- Fixed Lot Size (MMByFixed): Use a fixed lot size for all trades.
Example: MMFixed = 0.2 → Result: All trades use 0.20 lots. - Equity Ratio (MMByEquityRatio): Calculate lot size based on a ratio of equity (based on 0.01 lot per $100 equity).
Example: MMEquityRatio = 100, Equity = $1,000 → (1000 / 100) × 0.01 = 0.10 lots. - Balance Ratio (MMByBalanceRatio): Calculate lot size based on a ratio of account balance. (based on 0.01 lot per $100 equity).
Example: MMBalanceRatio = 200, Balance = $5,000 → (5000 / 200) × 0.01 = 0.25 lots. - Risk Percentage (MMByRiskPC): Calculate lot size based on a percentage of equity risked per trade.
Example: MMRiskPC = 2, Equity = $10,000, SL = 50 points, 1 point = $1 → $200 / 50 = 4.00 lots. For this setting, the loss is $200 which is 2% of $10000. - Fix Dollar Loss (MMByFixedDollar): Calculate lot size based on a fixed dollar amount risked per trade. This option is good for controlling the amount of loss.
Example: MMFixedDollar = 125, and the account balance is 25000, the loss each time is 0.5%. With the loss amount fixed, it is easy to control the drawdown.
2. Box Time
This section defines the specific time window used to draw the breakout box. The EA calculates the high and low (or close-to-close) within this window to determine breakout boundaries. The box can be anchored from either the start time or the end time, depending on your trading logic.
This flexibility allows the user to define the range either forward from a known starting point, or backward from a known ending point, by specifying a duration.
Parameters
- Box Timeframe (TimeframeRange)
Timeframe used to calculate the candles forming the box.
Example: TimeframeRange = PERIOD_M5 → Box uses 5-minute candles. - Box Type (BoxType)
- High/Low (HighLow): Uses the highest high and lowest low within the box window.
- Support/Resistance (HighLowClosed): Uses the highest close and lowest close within the box window.
- Box Anchor Time (BoxAnchor)
Defines the time reference for calculating the box range. - Range Start (RangeStart): The box starts at the specified time, and ends after a defined duration.
- Range End (RangeEnd): The box ends at the specified time, and its start is calculated by subtracting the duration.
- Box Start Time (RangeStartHour, RangeStartMinute, RangeStartSecond)
If BoxAnchor = RangeStart, this defines the exact time the box begins.
Example: RangeStart = 02:00:00. - Box End Time (RangeEndHour, RangeEndMinute, RangeEndSecond)
If BoxAnchor = RangeEnd, this defines the exact time the box ends.
Example: RangeEnd = 07:30:00. - Box Duration (when BoxAnchor = RangeStart or RangeEnd)
The second set of time inputs (i.e., RangeEnd or RangeStart) is interpreted as the duration.
Example 1: BoxAnchor = RangeStart, Start = 02:00, Duration = 5h30m → Box starts at 02:00 and ends at 07:30.
Example 2: BoxAnchor = RangeEnd, End = 07:30, Duration = 4h00m → Box starts at 04:30 and ends at 07:30. - Randomise Box Time (RandomRange)
Enables or disables bounded randomisation of the box window to reduce predictability. - Randomised Range Time (RangeSecondDelta)
Maximum number of seconds to randomly shift both the start and end times.
Example: RangeSecondDelta = 180 → Start and/or end time may shift by ±180 seconds (3 minutes).
2.1 Box Method
This section defines how the box (range) is calculated using volatility-based indicators such as Average True Range (ATR) and Average Daily Range (ADR).
- ATR Timeframe (ATRTF): Timeframe used to calculate the ATR value (e.g., ATRTF = H1).
- ATR Period (ATRPeriod): Number of candles used to calculate the ATR value.
- Example: ATRPeriod = 14 → ATR is calculated from the last 14 candles of the selected timeframe.
- Average ADR Period (ADRPeriod): Number of days used to calculate the Average Daily Range.
- Example: ADRPeriod = 20 → ADR is calculated from the past 20 daily candles.
2.2 Box Offset
The offset add on or minus to the time based form box to form Upper Box Boundary and Lower Box Boundary. These are the levels the trades will be placed
Box Offset Type (OffsetType)
- Offset Off (OffsetOff): No offset.
- Fixed Point (OffsetByFixedPoint): Offset by a fixed number of points.
Example: OffsetFixedPoint = 20 → Entry price is adjusted by +20 points.
Example: OffsetFixedPoint = -13 → Entry price is adjusted by -13 points. - Fixed Percentage (OffsetByFixedPC): Offset by a percentage of the box size.
Example: Box size = 100 points, OffsetFixedPC = 10 → Offset = 10% of 100 = 10 points.
Example: Box size = 100 points, OffsetFixedPC = -5 → Offset = -5% of 100 = 5 points. - ATR (OffsetByATR): Offset by a percentage of the ATR.
Example: ATR = 50 points, OffsetATR = 20 → Offset = 20% of 50 = 10 points.
Example: ATR = 50 points, OffsetATR = -10 → Offset = -10% of 50 = 5 points. - ADR (OffsetByADR): Offset by a percentage of the ADR.
Example: ADR = 120 points, OffsetADR = 25 → Offset = 25% of 120 = 30 points.
Example: ADR = 120 points, OffsetADR = -5 → Offset = -5% of 120 = -6 points. - Price (OffsetByPrice): Offset by a percentage of the current price.
Random Offset Type (RandomOffset)
- Random Offset Off (RandomOffsetByOff): No random offset.
- Random by Point (RandomOffsetByPoint): Random offset by fixed points.
Example: RandomOffsetPoint = 15 → A random number between -15 and 15 points is added to the offset. - Random by Percentage (RandomOffsetByPC): Random offset by percentage.
Example: Box size = 100 points: - RandomOffsetPC = 5 → offset is randomized between -5 and +5 points.
- RandomOffsetPC = 10 → offset is randomized between -10 and +10 points.
- RandomOffsetPC = 15 → offset is randomized between -15 and +15 points.
2.3 Box Range Filter
This filter restricts trading to only when the breakout box size is within a desired range. It helps avoid trading during periods of either too little or too much volatility, improving trade quality and consistency.
Range Filter Type (RangeType)
- Off (RangeByOff): No filter applied.
- Fixed Point (RangeByFixedPoint): Filter based on a fixed point range.
Example: MinRangePoint = 40, MaxRangePoint = 100 → Trades are only taken if the box size is between 40 and 100 points. - ATR (RangeByATR): Filter based on a percentage of ATR.
Example: ATR = 80 points, MinRangeATR = 50, MaxRangeATR = 150 → Trades allowed if box size is between 40 and 120 points (50%-150% of ATR). - ADR (RangeByADR): Filter based on a percentage of ADR.
Example: ADR = 120 points, MinRangeADR = 20, MaxRangeADR = 80 → Box must be between 24 and 96 points. - Price (RangeByPrice): Filter based on a percentage of price.
Example: Price = 1.3000, MinRangePrice = 0.05, MaxRangePrice = 0.1 → Allowed box size: 65 to 130 points (0.05%-0.1% of price).
3. Cancel Orders
These settings control when pending orders are cancelled, if not triggered by this time.
This defines the duration after which pending orders are canceled, measured from the Box End Time (not from the Box Start).
- Cancel Order Duration (CancelOrdersHour, CancelOrdersMinute, CancelOrdersSecond): Duration added to the Box End Time after which pending orders are canceled.
- Randomise Cancel Order (RandomCancelOrder): Enable or disable bounded randomization of cancel order time.
- Randomised Cancel Time (CancelOrderSecondDelta): Maximum seconds to randomize the cancel time.
Example:
- RangeStartHour = 2, RangeStartMinute = 0
- RangeEndHour = 5, RangeEndMinute = 30
→ Box ends at 07:30 - CancelOrdersHour = 6, CancelOrdersMinute = 0
→ Cancel Time = 07:30 + 6:00 = 13:30 - If RandomCancelOrder = true, CancelOrderSecondDelta = 180
→ Cancel time may vary between 13:27:00 and 13:33:00
4. Close Positions
This defines the duration after which positions are force-closed, measured from the Cancel Orders Time. This is useful to avoid holding trades beyond specific hours or market sessions and close before the day ends.
- Close Type (CloseType):
- CloseByTime: Close trades strictly at the close time.
- ClosebyTP: Close trades only when take profit is hit.
- CloseByTP_Time: Close by either take profit OR forced close time, whichever comes first.
- Close Positions Duration (ClosePositionsHour, ClosePositionsMinute, ClosePositionsSecond): Duration after cancel time to close open trades.
- Randomise Close Time (RandomClosePosition): Enables/disables randomisation of position close time.
- Close Time Random Delta (ClosePositionSecondDelta): Max number of seconds to randomly shift the close time.
Example:
- Box End = 07:30, CancelOrdersHour = 6:00 → Cancel time = 13:30
- ClosePositionsHour = 2, ClosePositionsMinute = 0 → Close time = 13:30 + 2:00 = 15:30
- If RandomClosePosition = true, ClosePositionSecondDelta = 180 → Final close may happen between 15:27 and 15:33
5. Stop Loss
These settings define how the stop loss (SL) is calculated for each trade. You can choose from various calculation methods including a fixed number of points, range-based factors, or dynamic volatility indicators like ATR and ADR.
Stop Loss Type (SLType):
- Box Factor (SLByFactor): Stop loss is set as a multiple (factor) of the box size.
Example:
o If box size = 100 points, and SLFactor = 1.5 → SL = 100 × 1.5 = 150 points
o If box size = 100 points, and SLFactor = 0.5 → SL = 100 × 0.5 = 150 points, this is good to close a trade with smaller stop loss if a breakout is not successful.
- Fixed Point (SLByPoint): Stop loss is set as a fixed number of points.
Example: SLPoint = 80 → SL = 80 points - ATR-Based (SLByATR): Stop loss is calculated as a percentage of the ATR value.
Example: ATR = 50 points, SLATR = 120 → SL = 50 × 1.2 = 60 points - ADR-Based (SLByADR): Stop loss is calculated as a percentage of the ADR value.
Example: ADR = 100 points, SLADR = 70 → SL = 100 × 0.7 = 70 points - Price Factor (SLByPrice): Stop loss is calculated as a percentage-based factor of the current price.
Example: Price = 1.10000, SLPrice = 0.1 → SL = 0.1% of price = 1.10000 × 0.001 = 11 points - Off (SLOff): No stop loss will be applied. This is highly risky and not recommended for most use cases.
Random Stop Loss Type (RandomSL):
Randomization introduces controlled variation to make your SL levels less predictable, which can help in prop firm environments or reduce predictability by brokers.
- Random SL Off (RandomSLByOff): No randomization is applied to stop loss.
- Random by Point (RandomSLByPoint): SL is randomized by a number of points above or below the base SL.
Example: RandomSLPoint = 15 → Final SL = Base SL ± random value between -15 and +15 points - Random by Percentage (RandomSLByPC): SL is randomized by a percentage factor of the base SL.
Examples: - RandomSLPC = 5 → SL fluctuates within ±5% range of base SL
- RandomSLPC = 10 → ±10% range
- RandomSLPC = 15 → ±15% range
If base SL = 100 points and RandomSLPC = 10 → SL will vary between 90 and 110 points
6. Take Profit
These settings control how the Take Profit (TP) level is calculated for each trade. You can define TP based on a fixed distance, or dynamically using indicators like ATR, ADR, or current price levels. TP placement is crucial for controlling reward-to-risk ratios and exit behavior.
Take Profit Type (TPType):
- Stop Loss Factor (TPByFactor): TP is set as a multiple of the stop loss. This is the setting for traditional risk-to-reward ratio.
Example: If SL = 80 points, and TPFactor = 2 → TP = 80 × 2 = 160 points, a RRR of 2. - Fixed Point (TPByPoint): TP is set at a fixed number of points from the entry.
Example: TPPoint = 100 → TP = 100 points - ATR-Based (TPByATR): TP is calculated as a percentage of the ATR value.
Example: ATR = 60 points, TPATR = 150 → TP = 60 × 1.5 = 90 points - ADR-Based (TPByADR): TP is calculated as a percentage of the ADR value.
Example: ADR = 120 points, TPADR = 80 → TP = 120 × 0.8 = 96 points - Price Factor (TPByPrice): TP is based on a percentage of the current market price.
Example: Price = 1.10000, TPPrice = 0.15 → TP = 1.10000 × 0.0015 = 16.5 points - Off (TPOff): No Take Profit level will be applied. Trades can close only by stop loss or manual intervention.
Random Take Profit Type (RandomTP):
To increase trade robustness and reduce system predictability, TP levels can be slightly varied around their calculated value.
- Random TP Off (RandomTPByOff): No randomization is applied to Take Profit.
- Random by Point (RandomTPByPoint): Randomize TP level by a number of points.
Example: RandomTPPoint = 20 → TP = Base TP ± random number from -20 to +20 points - Random by Percentage (RandomTPByPC****): Randomize TP level by a percentage of the base TP.
Examples: - RandomTPPC = 5 → TP varies within ±5% of calculated value
- RandomTPPC = 10 → ±10% range
- RandomTPPC = 15 → ±15% range
If base TP = 100 points and RandomTPPC = 10 → TP will vary between 90 and 110 points
7. Trailing Stop
This section defines how the EA adjusts the Stop Loss (SL) as the price moves in your favor. Trailing Stops help lock in profits while keeping positions open during favourable trends. You can choose from different trailing methods and optionally randomize them to reduce system predictability.
Trailing Stop Switch (Trailing_Stop_Switch)
- Enables or disables trailing stop functionality.
Trailing Stop Type (TSType)
- By Stop Loss Percentage (TSBySL): Trailing Stop is calculated as a percentage of the original SL.
Example: If SL = 100 points, TSSL = 33.33 → Trailing Stop = 33.33 points - Fixed Point (TSByFixedPoint): Trailing Stop is set to a fixed number of points.
Example: TSPoint = 333 → Trailing Stop = 333 points - ATR-Based (TSByATR): Trailing Stop is based on a percentage of the ATR value.
Example: ATR = 60 points, TSATR = 5 → Trailing Stop = 60 × 0.05 = 3 points - ADR-Based (TSByADR): Trailing Stop is based on a percentage of the ADR.
Example: ADR = 150 points, TSADR = 1 → Trailing Stop = 150 × 0.01 = 1.5 points - Price Percentage (TSByPrice): Trailing Stop is calculated as a percentage of the current price.
Example: Price = 1.20000, TSPrice = 0.1 → Trailing Stop = 1.20000 × 0.001 = 12 points
Trail Point Percentage (Trail)
Defines how much of the calculated Trailing Stop is used as the trigger to move SL.
Example:
- If TSPoint = 333 and Trail = 50 → SL trails when price moves by 333 × 0.5 = 166.5 points
Trail Above Break-Even Switch (Trail_Above_Switch)
- Enables or disables additional control that triggers trailing only when the price goes further above breakeven.
Trail Above Factor (Trail_Above)
- Defines how far the price must move beyond breakeven before the trailing logic starts.
Example: - Trail_Above = 0.25 and TSPoint = 333 → Trail begins after 333 × 0.25 = 83.25 points above breakeven
Random Trailing Stop Type (RandomTS)
Randomization helps add variability to trailing stop levels to reduce the chance of system exploitation or overfitting.
- Random Off (RandomTSByOff): No random variation applied to trailing stop.
- Random by Point (RandomTSByPoint): Adds or subtracts random points from trailing stop.
Example: RandomTSPoint = 5 → Trailing Stop may vary between ±5 points - Random by Percentage (RandomTSByPC): Applies random variation as a percentage.
Examples: - RandomTSPC = 5 → ±5% of base trailing stop
- RandomTSPC = 10 → ±10%
- RandomTSPC = 15 → ±15%
8. Trades
These settings control trade behavior.
Cancel Opposite Order (COO_Switch): Cancel opposite pending orders when a trade is opened.
Buy and/or Sell Trades (BorS):
- Buy and Sell (BuyandSell): Allow both buy and sell trades.
- Buy Only (BuyOnly): Allow only buy trades.
- Sell Only (SellOnly): Allow only sell trades.
- Buy and Sell Off (BuyandSellOff): Disable trading entirely.
Max Long Trades (MaxLongTrades):
Defines the maximum number of buy trades per day.
Example: MaxLongTrades = 2 → Only two buy orders can be placed per day.
Max Short Trades (MaxShortTrades):
Defines the maximum number of sell trades per day.
Example: MaxShortTrades = 3 → Up to three sell orders can be placed per day.
Max Total Trades (MaxTotalTrades):
Defines the maximum total number of trades per day (buy + sell).
Example: MaxTotalTrades = 5 → A maximum of 5 trades (combined buy and sell) will be executed in a single day.
9. Day to Trade
These settings control which days of the week the EA is allowed to place trades. You can selectively enable or disable trading for each day.
- Trade Monday (TradeMonday):
true – EA will open trades on Mondays.
false – EA will not open trades on Mondays. - Trade Tuesday (TradeTuesday):
true – EA will open trades on Tuesdays.
false – EA will not open trades on Tuesdays. - Trade Wednesday (TradeWednesday):
true – EA will open trades on Wednesdays.
false – EA will not open trades on Wednesdays. - Trade Thursday (TradeThursday):
true – EA will open trades on Thursdays.
false – EA will not open trades on Thursdays. - Trade Friday (TradeFriday):
true – EA will open trades on Fridays.
false – EA will not open trades on Fridays. - Trade Saturday (TradeSaturday):
true – EA will open trades on Saturdays (rarely used unless trading crypto).
false – EA will not open trades on Saturdays. - Trade Sunday (TradeSunday):
true – EA will open trades on Sundays (rarely used unless trading crypto).
false – EA will not open trades on Sundays.
10. Confluence
These settings add additional filters for trade entry, enabling stronger confirmation based on trend and volatility confluence. Use of confluence on some instruments, can improve winrate and drawdown.
3 Moving Averages Filter
- Enable 3 MA Filter (CMASwitch): Enable or disable using three moving averages for trend confirmation.
- MA Timeframe (MAATF): Timeframe used for calculating the moving averages (e.g., PERIOD_H1).
- MA Method (MAMethod): The method used for calculating the moving average (e.g., SMA, EMA).
- Fast MA Period (CMA1Period): Period for the fast moving average.
- Medium MA Period (CMA2Period): Period for the medium moving average.
- Slow MA Period (CMA3Period): Period for the slow moving average.
Example: If CMA1 = 21, CMA2 = 50, CMA3 = 200, then:
- Entry allowed only if: MA21 > MA50 > MA200 (uptrend), or MA21 < MA50 < MA200 (downtrend).
ADI (Average Directional Index) Filter
- Enable ADI Filter (CADISwitch): Enable or disable the ADI confluence filter.
- ADI Timeframe (CADITF): Timeframe used for calculating ADX.
- ADI Period (CADIPeriod): Period used for ADX calculation.
- ADX Threshold (CADIMainLevel): Minimum required ADX value for trend confirmation.
- Minimal DI+ / DI− Level (CADILevel): Required minimal strength of DI+ vs DI− for Buy/Sell signals. DI+ confirms Buy and DI− confirms Sell.
- DI Factor (CADIDiff****): Minimum difference between DI+ and DI− to confirm directional trend.
Logic:
- Buy Signal = DI+ > DI− × CADIDiff AND DI+ > CADILevel AND ADX > CADIMainLevel
- Sell Signal = DI− > DI+ × CADIDiff AND DI− > CADILevel AND ADX > CADIMainLevel
Examples (assuming CADILevel = 40, CADIDiff = 3):
- DI+ = 46, DI− = 15, ADX = 42
→ This setup produces a Buy signal because:
46 > 15×3 = 45, 46 > 40, and ADX = 42 > 30 - DI+ = 12, DI− = 43, ADX = 38
→ This setup produces a Sell signal because:
43 > 12×3 = 36, 43 > 40, and ADX = 38 > 30 - DI+ = 36, DI− = 11, ADX = 35
→ No entry signal because:
Although 36 > 11×3 = 33, the DI+ value 36 is not greater than the threshold CADILevel = 40
ADR Filter
- Enable ADR Filter (CADRSwitch): Enables or disables filtering based on the Average Daily Range (ADR).
- ADR Timeframe (CADRTF): The timeframe used to calculate ADR (e.g., PERIOD_D1).
- ADR Period (CADRPeriod): The number of days over which the ADR is averaged.
- Minimum ADR Level (CADRLevelMin): The minimum ADR value required for a trade to be valid.
- Maximum ADR Level (CADRLevelMax): The maximum ADR value allowed for a trade to be valid.
Purpose:
This filter ensures trades are only taken when the current market volatility (as measured by ADR) is within a defined range. It avoids signals during overly quiet or excessively volatile market conditions.
Example:
- CADRPeriod = 14, CADRLevelMin = 50, CADRLevelMax = 150
- The EA calculates the average of the last 14 daily candle ranges and determines it is 85 points.
- Trade is allowed because 85 is within the 50–150 point range.
- If ADR = 40 → trade is skipped (insufficient volatility).
- If ADR = 200 → trade is skipped (volatility exceeds the upper threshold, possibly due to news or abnormal market conditions).
Bollinger Bands Confluence
- Enable Bollinger Bands Filter (CBBSwitch): Enables or disables the use of Bollinger Bands as a confluence filter.
- Bollinger Bands Timeframe (CBBRTF): Timeframe used for calculating the Bollinger Bands (e.g., PERIOD_D1).
- Bands Period (CBBPeriod): Number of periods used to calculate the bands.
- Standard Deviation (CBBDev): Deviation multiplier for upper and lower bands.
- Minimum Band Range (CBBLevelMin): Minimum allowed range between upper and lower Bollinger Bands (used as a volatility filter).
- Maximum Band Range (CBBLevelMax): Maximum allowed range between bands (used to exclude overly volatile conditions).
How It Works:
This filter measures the distance between the upper and lower bands on the selected timeframe. If the band width falls within the specified min/max thresholds, then the breakout signal is considered valid.
Example:
- CBBPeriod = 20, CBBDev = 2.0, CBBLevelMin = 30, CBBLevelMax = 120
- If Bollinger Band width = 85 pips → passes the filter
- If Bollinger Band width = 15 pips or 150 pips → filtered out
This ensures breakouts are only considered when volatility is within a healthy range — not too compressed (low volatility) or too expanded (high risk of mean-reversion).
The above indicator can be found in MT4/MT5 Terminal. To better understand how the above standard indicators function, you can add them directly to your chart in MT4 or MT5. This allows you to visually observe how the EA's confluence logic interacts with Moving Averages, ADX, Bollinger Bands and ADR in real time for your to formulate your own setting.
11. General Settings
These settings control the general behavior and logging of the EA.
- Magic Number (MagicNumber):
Unique identifier assigned to the EA’s trades. This ensures the EA only manages its own trades and avoids conflicts with other EAs.
Example: MagicNumber = 1970 → All trades from this EA will carry this magic number. - EA Comment (EaOrderComment):
A custom comment attached to each order placed by the EA. This can help in identifying trades in the terminal or during journal/debug review.
Example: EaOrderComment = "AIO Breakout" → All trades will include this comment. - Chart Comment Switch (ChartComment):
true – The EA displays dynamic trade or strategy-related comments on the chart.
false – Disables chart comments. - Debug Message Switch (DebugSwitch):
true – Enables detailed logs in the Experts and Journal tabs for debugging or analysis.
false – Disables extra debug messages to reduce clutter.
12. Visual Settings
These settings control how the EA appears on the chart during trading or backtesting. Use these settings to enhance the visibility and clarity of chart annotations. This built-in indicator does not affect the box/range setting.
- Box Color (RangeColor): Defines the visual color of the main range box. Note that if Box Range Filter is turn on and the box range/size does not meet the filter criteria, the box appears as boadered, not filled.
- Stop Trades Color (StopColor): The color of the horizontal line that shows where trades stop.
- Cancel Pending Color (CancelColor): The color used to display the cancel pending orders line.
- Day Open Color (DayOpenColor): The line color marking the day’s open price.
- Upper Box Color (UpperBoxColor): Color of the upper line of the breakout box.
- Lower Box Color (LowerBoxColor): Color of the lower line of the breakout box.
- Show Info (ShowInfo): Show or hide the EA's status and details on the chart.
- Text Size (TextSize): Sets the size of the displayed font on the chart.
- Text Color (TextColor): Defines the font color of displayed information.
- Box Color (BoxColor): Background color of the information box.
13. Trade Sessions Indicator
These settings allow the EA to display visual markers on the chart that indicate the start of key trading sessions. This helps traders recognize optimal breakout windows and periods of low or high volatility based on session timing.
• Enable Trade Sessions Indicator (TradeSessionsIndicatorSwitch): Turns on or off the display of trading session markers. If enabled (true), session labels will appear on the chart.
• Tokyo Session Start Hour (JP_Start_Hour): Sets the start time (hour) for the Tokyo session, often associated with lower volatility and commonly used to form the breakout range (RBO strategy).
• London Session Start Hour (LD_Start_Hour): Sets the hour when the London trading session begins. This is a common opening point for breakout opportunities, especially in OBO.
• New York Session Start Hour (NY_Start_Hour): Sets the hour of the New York session start. It’s often linked to high volatility and overlaps with London.
• Text Spacing (Spacing): Adjusts the vertical spacing between session label texts. Useful for keeping chart display clean and readable when multiple sessions are shown.
Thick line denotes starting of a session and thin line denotes ending of a session.
Settings for brokers with server timezone in GMT+2/3, for example ICMarkets is:
Tokyo Trading Session Starting Hour = 2
London Trading Session Starting Hour = 10
New York Trading Session Starting Hour = 15
Some brokers are using UTC as trading server timezone and some can be others. You have to find out your broker server timezone and set the necessary above values.
14. Backtest
These settings control the behavior of backtests. Use these options to speed up tests or reduce execution time while maintaining logical behavior.
- Fast Backtest (FastBacktest):
- T-Type: Use T-type fast backtesting logic.
- S-Type: Use S-type fast backtesting logic.
- Fast Backtest Off: Disable fast backtest optimizations.
- T-type Interval (TInt): Specifies the interval between test events during T-type testing, from 3 and above. Bigger number of this produce faster backtest even with every real ticks.