Message me if any issue or settings question. I am pleased to help!
Time-based Range Breakout EA – Version 2.00 (English Version)
Time-based Range Breakout EA (v2.00) is an intraday breakout strategy that defines a daily high/low zone based on a specified start time plus duration. Once the price breaks out of this zone, the EA automatically places Buy Stop / Sell Stop orders to capture potential continuation moves. In this version, multiple new calculation modes and logic have been added for Take Profit / Stop Loss (TP/SL), Trailing Stop (TSL), and Range Filter, making the strategy more adaptable to different trading preferences and market conditions.
Multiple TP/SL Calculation Methods
Range Factor (Range Size × Factor)
Distance Percent (relative to entry price)
Points (fixed number of points)
TSL / BE with Different Bases
Choose Points or Percent (relative to entry price) for TSL and Break Even calculations.
SL = 0 + Risk Percent
If you use a risk-based lot mode (non-fixed) and SL Value=0, then for Buy trades the EA treats SL as market price 0, and for Sell trades as current price × 2 for risk/lot calculation purposes.
Rounding Up to an Integer
If TSL or BE is set in Points, any decimal values are automatically rounded to the nearest integer.
Likewise, when using Points in the Range Filter, the EA will round Range Filter Min/Max decimals to the nearest integer.
Below are the input parameters grouped as in the code (Volume Settings, Order Settings, etc.), describing each one’s purpose and special behaviors.
Volume Mode
Description: Determines how the EA calculates lot size. Options:
Volume Fixed: A fixed lot size
Volume Fixed Per Account Balance: Fixed lots per account balance
Volume Risk By Base Balance Percent: Risk percentage using a custom Base Balance
Volume Risk By Account Balance Percent: Risk percentage using the current account balance
Volume Risk By Account Equity Percent: Risk percentage using the current account equity
Fixed Lots
Description: Used if Volume Mode = Volume Fixed (a strictly fixed lot size).
Fixed Lots Per Account Balance
Description: If Volume Mode = Volume Fixed Per Account Balance, defines how many lots to trade per a certain amount of account balance (e.g., 0.01 lots per $1000).
Risk Percentage of Base or Account Balance
Description: In any “Risk Percent” mode (Volume Risk...), sets the percentage risk per trade. The EA dynamically calculates lot size based on the SL distance.
Base Balance
Description: Used only in Volume Risk By Base Balance Percent mode to define a custom base balance for risk calculations.
Order Buffer Points
Description: How many points (pips) to add (or subtract) from the breakout level for buy/sell stop orders. 0 = no buffer.
TP Calculation Method
Description: The method for calculating Take Profit (TP). Options:
Calculation Method In Range Size x Factor: Range factor
Calculation Method In Distance Percent: Distance as a percent of entry price
Calculation Method In Points: A fixed number of points
Tp Value
Description: The parameter value corresponding to the chosen TP Calculation Method:
Range Factor => e.g., 1.0 = 1 × range size
Distance Percent => e.g., 1.0 = ±1% of entry price
Points => e.g., 50 = 50 points
0 = no TP.
SL Calculation Method
Description: The method for calculating Stop Loss (SL). Same categories:
Calculation Method In Range Size x Factor
Calculation Method In Distance Percent
Calculation Method In Points
SL Value
Description: The numerical value for SL, corresponding to the SL Calculation Method. 0 = no SL.
If the EA is using a risk-based lot mode (non-fixed) and SL Value=0, it will:
Buy => SL is treated as market price 0
Sell => SL is treated as current price × 2
This allows the EA to compute the risk-based lot size (though no actual SL is placed).
Range Start Hour / Range Start Minute
Description: The hour/minute that marks the start time for observing the day’s high/low zone.
Range Length Min from Start
Description: The duration (in minutes) for which the EA measures high/low from the start time (e.g., 90 minutes).
Delete Orders Hour / Delete Orders Minute
Description: The hour/minute to delete any unfilled pending orders.
Use Time Close
Description: Whether to close all positions at a specific time. If true, the following close time parameters are enabled.
Time Close Hour / Time Close Minute
Description: The hour/minute to force-close all open positions (requires Use Time Close = true).
BE Value Type
Description: The metric for BE calculations:
Calculation Value In Points: Uses points
Calculation Value In Distance Percentage: A percentage of entry price
BE Trigger Value
Description: The BE activation threshold. 0 = disabled.
BE Buffer Value
Description: Once BE is triggered, how many points or percent to add for a safety buffer (e.g., 0 = none).
TSL Value Type
Description: The metric for TSL calculations:
Calculation Value In Points: Uses points
Calculation Value In Distance Percentage: A percentage of entry price
TSL Trigger Value
Description: The threshold for activating TSL. 0 = disabled.
TSL Distance Value
Description: The initial distance of the TSL from the current price (points or percent).
TSL Step Value
Description: The step increment for TSL each time the price moves further in a favorable direction.
Rounding to an Integer
If TSL Value Type = Calculation Value In Points or BE Value Type = Calculation Value In Points, any decimal input is rounded up to the nearest integer. For example: 0.01 => 1, 1.4 => 1, 1.5 => 2, 2.6 => 3, etc.
Max Long Trades Per Day
Description: The max number of daily Buy (long) trades allowed.
Max Short Trades Per Day
Description: The max number of daily Sell (short) trades allowed.
Max Total Trades Per Day
Description: The max total daily trades (long + short).
Use Range Filter
Description: Whether to enable range filtering. If true, the EA checks if the daily range is within valid bounds.
Range Filter Value Type
Description: Whether the range size is measured in points or percent.
Range Filter Minimum Value / Range Filter Maximum Value
Description: The min/max threshold for the day’s range. If the range is smaller than Min or larger than Max, the EA does not place orders.
If Range Filter Value Type = Range Filter In Points, any decimals are rounded up to the nearest integer (e.g., 0.1 => 1, 2.4 => 2, 2.5 => 3).
Use MA Filter
Description: If true, trades must pass an MA condition before entry.
MA Timeframe
Description: The timeframe used for MA calculations (M5, M15, H1, CURRENT, etc.).
MA Method
Description: The type of MA (SMA, EMA, SMMA, LWMA).
MA Applied Price
Description: The price used in MA calculations (Close, Open, High, Low, etc.).
MA Period
Description: The MA period (e.g., 50 means a 50-bar average).
Magic
Description: A magic number used to identify the EA’s orders.
Show Comments
Description: Whether to display EA information (status, strategy name, etc.) on the chart.
Comments
Description: A text label shown on the chart for naming or additional remarks.
Enable Drawing Range
Description: Whether to draw horizontal lines representing the day’s high/low range.
Range Color
Description: The color used for drawing the range (defaults to clrYellowGreen).
Show More Logging
Description: If true, outputs additional debug logs for troubleshooting or strategy analysis.
Backtesting or Demo Testing
It is recommended to run tests in MT5 Strategy Tester (visual or non-visual) or on a demo account to ensure your parameter setup and strategy logic function properly before going live.
Broker Server Time
Different brokers may operate with different server time zones. Verify that Range Start Hour/Min align with your broker’s actual server time.
Risk Management
If using a risk-based mode (Risk Percentage), make sure your account balance/equity, leverage, and margin requirements can handle the chosen risk.
Chart Timeframe
Typically used on M5, M15, M30, or H1 for intraday trading. You may use higher timeframes for a more extended breakout but must adjust your StopLoss and range length accordingly.
Max Total Trades Per Day & Delete Orders
Once you reach Max Total Trades Per Day (or Max Long Trades Per Day, Max Short Trades Per Day), or once the delete-orders time has passed, no additional orders will be placed or existing pending orders may be removed.
Why are no orders being placed?
Possible reasons:
The time range has not started or has already ended (exceeding Range Length Min from Start).
The day’s range is outside Range Filter Minimum/Maximum Value.
The daily limit (Max Total Trades Per Day, Max Long Trades Per Day, Max Short Trades Per Day) has been reached.
MA Filter conditions (if enabled) are not met.
BE / TSL triggers have not been reached.
SL Value=0 + Risk Percent, yet it still places trades?
To calculate lot size, the EA assumes for Buy => SL=0, for Sell => SL=entry price × 2. This is only used to compute risk-based lots, not to actually place an SL.
How does TSL / BE handle decimals when set to Points?
The EA rounds the value to the nearest integer (e.g., 0.5 => 1, 1.5 => 2, 2. => 3, etc.).
What if Range Filter is set to Points and I enter decimals?
Those decimal values for Min/Max are also rounded to the nearest integer (e.g., 0.1 => 1, 2.4 => 2, 2.5 => 3).
Risk Percent lot size differs from my expectation?
Check the SL Calculation Method, SL Value, or potential fallback if SL=0. The EA finalizes the lot size based on the actual (or simulated) SL distance.
How to speed up backtesting?
Disable Show Comments, Enable Drawing Range, and set Show More Logging = false to reduce chart rendering and log output.
By defining the day’s high/low based on a time-based range and offering multiple StopLoss modes (Range Factor / Distance Percent / Points) plus TSL/BE customizations, the Time-based Range Breakout EA – Version 2.00 provides flexibility for various intraday breakout scenarios. The EA also handles SL=0 under risk-based mode (Buy=0, Sell=entry×2) and rounds decimal inputs for TSL/BE/Range Filter when using Points.
It is strongly recommended to thoroughly test different parameter combinations in backtests and demo environments to identify configurations that best suit your personal trading style and market conditions.
Disclaimer
Forex, CFDs, and other leveraged products carry significant risks. Users are responsible for evaluating their financial circumstances and risk tolerance before trading. All trading decisions and associated risks lie solely with the user; the author bears no liability for any resultant losses.
If for any reason you do not like the purchased program, you can request a refund within 30 days from the date of purchase. You can also make an exchange for any other product at an equal cost or by paying the difference.
Simply send a request for refund or exchange with your order number by email: support@fx-market.pro.
Refund requests received more than 30 days after purchase will be rejected.