XAU channel breakout
- Experts
- Version: 5.5
- Updated: 6 October 2026
- Activations: 20
XAU channel breakout —Expert Advisor based on price channel breakouts with multi-layer signal filtering.
Short Description
ChannelTrader v5.5 is a fully automated trading system that builds a price channel around the current price and trades breakouts of its boundaries. Every signal passes through four independent filters (MA, ZigZag, TrendLine, and time filter), which helps to filter out false breakouts and trade only in the direction of the prevailing movement.
The EA operates on a "channel + confirmation" principle:
-
A channel with a specified width (in percent) is built around the current price.
-
When the upper or lower boundary is broken, a BUY or SELL signal is generated.
-
The signal passes through MA, TrendLine, and ZigZag filters.
-
Only when all conditions align, a position is opened with automatic lot, SL, and TP calculation.
-
The channel is automatically rebuilt when it becomes outdated or when price moves too far away.
Strategy
Core logic:
-
Upper channel boundary breakout → potential BUY.
-
Lower channel boundary breakout → potential SELL.
-
SL is set at the opposite channel boundary.
-
TP is calculated as a percentage of the entry price.
-
Lot size is calculated using the recovery principle after a loss.
Filters (checked in priority order):
-
MA Filter — if price is above MA, only BUY is allowed; if below — only SELL.
-
TrendLine Filter — determines trend direction via linear regression on pivots. In flat market, trading is blocked.
-
ZigZag Filter — checks the current wave length against the median. Waves that are too short or too long are rejected.
-
Trading Hours — trading is allowed only within a specified time window.
Input Parameters
💰 Money Management and Lot Sizing
| Parameter | Type | Default | Description |
|---|---|---|---|
| Initial_Lots | double | 0.01 | Initial lot size for the first trade |
| Max_Lots | double | 0.5 | Maximum allowed lot size |
| Target_Profit_Percent | double | 0.1 | Target profit in % of balance per trade |
| Recovery_Distance_Percent | double | 5.5 | Recovery distance in % of price (for lot calculation) |
| Reset_On_Max_Lot | bool | true | Reset accumulated loss when max lot is reached |
📊 Channel
| Parameter | Type | Default | Description |
|---|---|---|---|
| Channel_Width_Percent | double | 0.1 | Channel width in % of current price |
| Channel_Max_Age_Minutes | int | 60 | Maximum channel age in minutes before rebuild |
| Channel_Reset_Distance_Pct | double | 0.3 | Rebuild channel if price moves N% away from its center |
| Channel_Up_Color | color | clrBlue | Upper channel boundary color |
| Channel_Down_Color | color | clrRed | Lower channel boundary color |
| Line_Width | int | 1 | Channel line thickness |
🎯 Position Management
| Parameter | Type | Default | Description |
|---|---|---|---|
| Take_Profit_Percent | double | 0.1 | Take Profit in % of entry price |
| Max_Slippage | int | 30 | Maximum slippage in points |
| Magic_Number | int | 123456 | Unique EA identifier |
🛡️ Drawdown Protection
| Parameter | Type | Default | Description |
|---|---|---|---|
| Max_Drawdown_Percent | double | 20.0 | Maximum drawdown in % before trading stops |
| Max_Consecutive_Losses | int | 50 | Maximum number of consecutive losing trades |
🕐 Time Filter
| Parameter | Type | Default | Description |
|---|---|---|---|
| Check_Trading_Hours | bool | true | Enable trading hours check |
| Start_Hour | int | 0 | Trading start hour |
| Start_Minute | int | 10 | Trading start minute |
| End_Hour | int | 23 | Trading end hour |
| End_Minute | int | 50 | Trading end minute |
📈 Moving Average Filter
| Parameter | Type | Default | Description |
|---|---|---|---|
| Use_MA_Filter | bool | true | Enable Moving Average filter |
| MA_Period | int | 50 | MA period |
| MA_Method | enum | MODE_SMA | MA method (SMA/EMA/SMMA/LWMA) |
| MA_Applied_Price | enum | PRICE_CLOSE | Applied price |
| MA_Shift | int | 0 | MA shift |
| MA_DrawLine | bool | true | Draw MA on chart |
| MA_Up_Color | color | clrDodgerBlue | MA color when price is above |
| MA_Down_Color | color | clrCrimson | MA color when price is below |
| MA_MinDistance_Pct | double | 0.0 | Min. price distance from MA in % (0 = disabled) |
Logic: if price is above MA — only BUY, if below — only SELL.
📐 ZigZag Filter
| Parameter | Type | Default | Description |
|---|---|---|---|
| Use_ZigZag_Filter | bool | true | Enable ZigZag filter |
| ZZ_Depth | int | 12 | Depth for extremum search |
| ZZ_Deviation | int | 5 | Minimum deviation in points |
| ZZ_Backstep | int | 3 | Backstep for extremum suppression |
| ZZ_Wave_Multiplier_Min | double | 0.3 | Min. wave length multiplier (vs median) |
| ZZ_Wave_Multiplier_Max | double | 2.5 | Max. wave length multiplier (vs median) |
Logic: if the current wave is too short or too long compared to the median — the signal is rejected.
📉 TrendLine Filter
| Parameter | Type | Default | Description |
|---|---|---|---|
| Use_TrendLine_Filter | bool | true | Enable TrendLine filter |
| TrendLine_Period | int | 50 | Period for trend line calculation (bars) |
| TrendLine_MinPoints | int | 3 | Min. touches to consider trend line valid |
| TrendLine_MinSlope_Pct | double | 0.02 | Min. slope % per bar to consider trend |
| TrendLine_FlatSlope_Pct | double | 0.01 | Slope % threshold below which market is flat |
| TrendLine_CloseOnReverse | bool | true | Close counter-trend position on trend change |
| TrendLine_DrawLines | bool | true | Draw trend line on chart |
| TrendLine_Up_Color | color | clrLimeGreen | Uptrend color |
| TrendLine_Down_Color | color | clrOrangeRed | Downtrend color |
| TrendLine_Flat_Color | color | clrGray | Flat market color |
Logic:
-
UPTREND — only BUY.
-
DOWNTREND — only SELL.
-
FLAT — trading is blocked.
-
Chart Objects
The following objects are displayed on the chart:
-
Upper and lower channel boundaries (horizontal lines).
-
Trend line (dashed) with UPTREND / DOWNTREND / FLAT label.
-
MA label with period and color indicating direction.
All objects are automatically removed when the EA is unloaded.
Usage Recommendations
-
Start with backtesting in Strategy Tester over 6–12 months on your chosen instrument.
-
Optimize Channel_Width_Percent , MA_Period , and TrendLine_MinSlope_Pct for your instrument.
-
Do not disable filters — they significantly improve signal quality.
-
Monitor drawdown — Max_Drawdown_Percent protects your deposit.
-
Do not increase Max_Lots without understanding the recovery logic.
Risk Warning
Trading on financial markets involves high risk. Past results do not guarantee future returns. Use the EA only with funds you can afford to lose. Before running on a live account, always test the EA on a demo account.
-

