



XAUUSD Heikin Ashi Structure cBot (for cTrader)
This is my personal cTrader robot that I built specifically for XAUUSD (Gold) on the M15 timeframe.
It’s not a “one size fits all” EA – it’s a structure-based system that tries to trade only around meaningful levels, with risk and money management built in.
You’ll get my best preset for Gold M15 so you can plug it in and run it.
If you like optimizing and experimenting, you can absolutely tweak it and try other markets/timeframes – more on that later.
How the robot works (in simple but detailed English)
1. HeikinAshi engine
Instead of using normal candles, the bot converts price into Heikin Ashi candles.
These smooth out noise and make it easier to spot real swings.
Whenever the HeikinAshi candles change color (from bullish to bearish or vice versa), the bot:
- Looks at that little 3-candle swing
- For a bullish shift it builds a support zone
- For a bearish shift it builds a resistance zone
But instead of a single line, it creates a price range (a “box”) between relevant highs/lows of those candles.
2. Smart structure zones
As new swings appear, zones that overlap get merged and refined:
- Old junk levels are removed after a while (you set how many days to keep them)
- The bot keeps a history of triggers inside each zone and tries to pick the “best trigger” level, not just the first one it saw
So over time you end up with a clean map of support and resistance zones that price has respected more than once.
3. Higher-timeframe bias filter
On top of the main M15 chart, the robot also looks at an extra timeframe that you can configure (for example a higher TF).
On that extra TF it does a similar Heikin Ashi structure analysis and decides:
- Overall Bullish bias → only allow buys
- Overall Bearish bias → only allow sells
If the higher TF says “bullish” but the M15 pattern wants to sell, the trade is simply blocked.
This keeps the bot trading with the bigger picture, not against it.
4. Entry logic
On the M15 chart:
- If the higher TF bias is bullish
- The bot watches the support zones
- When price breaks back above a key level inside one of those zones, it can open a buy trade
- If the higher TF bias is bearish
- The bot watches the resistance zones
- When price breaks back below a key level inside one of those zones, it can open a sell trade
To avoid over-trading the most recent noisy zones, it often uses the third-most-recent zone (a kind of “tertiary pivot”) as a cleaner level rather than the last one that everybody just poked.
5. Money management & safety
This is where most “shiny” EAs fail. I built this robot with several layers of risk control:
- Risk % per trade – you choose a % of your equity and the lot size is calculated automatically for XAUUSD
- Max trades per day – once this limit is hit, the bot stops opening new positions for that day
- Fixed stop-loss in pips – every trade has a real SL
- TP/SL ratio – take-profit is set as a multiple of SL (for example 1.2× etc.)
- Breakeven move
- When price moves far enough in your favor (you set the % of SL), the bot moves SL to breakeven (just beyond entry)
- Partial profit taking
- At a chosen % of the TP distance, it can close a part of the position and let the rest ride
- Gap-through-SL watchdog
- If for some reason the market jumps past your stop, the bot will force-close the position so it doesn’t just sit there unprotected
There is no martingale, no grid, no crazy averaging-down.
Every trade is planned with a fixed SL and TP from the moment it’s opened.
6. Robust behavior & restart safety
The robot keeps track of important things like:
- How many trades were taken today
- Which pivot zone was traded last (to avoid re-entering the exact same one)
- Whether partial profit or breakeven was already applied to an open position
If you restart c Trader , it reads that information back from the existing trades and continues managing them correctly.
7. Visual dashboard
On the chart you’ll see a small dashboard with:
- The latest support & resistance zones
- A summary of the structure on the main TF
- The bias of the extra timeframe
So you can always see what the robot “thinks” the market structure is.
Recommended use vs. experimentation
- My recommended and tested setup is:
- Symbol: XAUUSD
- Timeframe: M15
- Using my included preset settings
That’s the configuration I actually spent time tuning and back testing.
If you like to tinker:
- You can run your own optimizations on your broker’s data
- You can experiment with other pairs or timeframes
- Just treat anything outside XAUUSD M15 as experimental and do proper back tests + forward tests before risking real money
I encourage this if you enjoy research – the bot has a lot of parameters exactly for that reason – but the “official” recommendation from me is still Gold M15 with my preset.
Risk warning (please read)
Trading XAUUSD and other leveraged products is very risky.
The results and examples above are back tests on past data only – they do not guarantee or predict future performance. Live results can be very different because of spread, slippage, execution, and changing market conditions.
You can lose part or all of your capital.
Always test on a demo account first, use money you can afford to lose, and adjust the risk % per trade to something you are comfortable with. By using this robot you accept full responsibility for all trading decisions and outcomes.


 - Google Chrome_241015085504.png)












