SuperTrend Strategy Optimization: No Losing Year on Gold
Part 2 of 2 · SuperTrend strategy
The short version. This is part 2 of my SuperTrend strategy optimization, and it's for gold only (XAUUSD, H4). I kept the TradingView script's entries exactly as they were and changed what happens after them.
- Gold H4, Jan 2020 to Sep 2026: the profit factor in the worst of three periods went from 1.02 to 1.65, and the worst single year went from 0.77 to 1.59. There's no losing year left.
- The cost: total profit per 0.01 lot fell from 3,997 USD to 1,359 USD, because the big 2024–2026 runs get cut shorter. Drawdown fell from 658 to 173.
- With risk-based sizing on a 10,000 USD account, 2% risk per trade grew it to 21,605 USD with a 5.7% maximum drawdown.
- Still missing: swap, and a real-tick run in MT5. I'm not publishing the exact rules yet.
My verdict: promising enough to take to the next stage, which is a real-tick test in MetaTrader 5. It's not proven yet.
Where part 1 left off
In part 1 I ported KivancOzbilgic's SuperTrend STRATEGY from TradingView and ran it on 6.7 years of Exness ticks with real spreads and commission. On gold H4 it made a profit factor of 1.97, but almost all of that came from the 2024–2026 rally. From 2020 to 2023 it was roughly break-even. On NZDUSD it lost on M15, H1 and H4.
The entries weren't the problem on gold. The question was whether better exits could hold on to the good years without giving everything back in the flat ones.
What did I change?
Two things, and neither of them is the entry signal.
- A trade-management layer. It decides how each position is protected once it's open and when it's closed early, instead of sitting in every trade until SuperTrend flips.
- Risk-based position sizing. Lot size comes from a fixed percentage of the account rather than a fixed 0.01 lot, so a trade in 2026 carries the same risk as a trade in 2020, even though gold's price nearly tripled in between.
The SuperTrend signals are exactly the ones from part 1: same 267 entries, same timestamps.
This is a gold-only optimization. Every setting was chosen on XAUUSD H4 and nothing else. I didn't tune it for forex pairs, indices or other timeframes, and the next section shows why you shouldn't assume it carries over.
I'm keeping the exact rules and settings to myself for now. I may turn this into an EA, and I don't want to publish numbers that someone copies into a live account before it has passed a real-tick test. What I can show is how it was tested, which is the part that tells you whether to trust it.
Results with a fixed 0.01 lot
Gold (XAUUSD Raw Spread), H4, 29 Jan 2020 to 16 Sep 2026, spread and commission included, swap not included:
| Original SuperTrend | With trade management | |
|---|---|---|
| Trades | 267 | 267 |
| Profit factor | 1.97 | 1.97 |
| PF in the worst period | 1.02 | 1.65 |
| PF in the worst year | 0.77 | 1.59 |
| Losing years | 2 (2021, 2022) | 0 |
| Net profit, USD per 0.01 lot | +3,997 | +1,359 |
| Max drawdown on closed trades | 658 | 173 |
| Win rate | 43.4% | 52.8% |
| Average holding time | 9.1 days | 1.2 days |

The overall profit factor didn't move. What moved is where the profit comes from. The original made most of its money in two years. The managed version makes a smaller amount every year, which is a much easier thing to live with.

Did I just curve-fit it?
That's the first thing I'd ask, so here's what I checked.
- Neighbouring settings. A result that only works at one exact setting is noise. I ran 35 nearby combinations with the full management in place. The worst-period profit factor stayed above 1.0 in all 35 (lowest 1.06, highest 1.90), and above 1.3 in half of them. The chosen one isn't the highest, and it isn't alone.
- Walk-forward. I picked the settings using only 2020–2023, then looked at 2024 to Sep 2026, which the choice never saw. The same settings came out on top, and the unseen period made a profit factor of 2.01.
- Random entries. I replaced the SuperTrend signals with random entries at the same frequency and kept the same management, 20 times. The median profit factor was 0.96, and the best worst-period result was 1.16. So the management alone isn't the edge. It works on top of SuperTrend's entries, not instead of them.
- Every piece earns its place. Switching off any single part of the management lowered the worst-period profit factor, to somewhere between 1.05 and 1.56.
- A second data set. On the Exness Cent gold feed (XAUUSDc) the worst-period profit factor was 1.62, against 1.65 on Raw.

What does risk-based sizing add?
Same trades, 10,000 USD starting balance, compounding, Jan 2020 to Sep 2026, before swap. The drawdown column includes the worst open loss inside each trade, which is closer to what MT5 reports as equity drawdown.
| Risk per trade | Final balance | Per year | Max drawdown | Worst year |
|---|---|---|---|---|
| 1% | 13,979 USD | 5.2% | 2.5% | +2.5% |
| 2% | 21,605 USD | 12.4% | 5.7% | +6.0% |
| 3% | 31,146 USD | 18.8% | 8.4% | +8.8% |

At 3% the yearly results were +23% (2020), +25% (2021), +9% (2022), +20% (2023), +14% (2024), +22% (2025) and +12% (2026 to mid-September). Those are backtest numbers on one instrument, before swap. I'd treat them as an upper bound, not a forecast.
Where does it still fail?
I optimized for gold H4 only. For context, here's what happened when I ran the same layer elsewhere, without re-tuning it:
- It gives up the big runs. In 2026 the original made 2,432 USD per 0.01 lot on gold H4. The managed version made 216. If you believe gold will trend like that again, the original catches more of it.
- Gold H1 didn't improve. On gold H1 the same kind of management made things worse. The result holds on H4 only.
- NZDUSD is still a loser. On H4 the profit factor went from 0.80 to 0.96, still a loss, and on H1 it got worse (0.86 to 0.77). Management can't create a trend where there isn't one.
What I haven't verified yet
- Swap. Still not included. Trades now last 1.2 days on average instead of 9.1, so the strategy spends about 86% fewer nights in the market. The effect will be much smaller than in part 1, but it won't be zero.
- Real ticks in MT5. These results come from checking every minute of Exness archive data. The management reacts to price inside the bar, so it's more sensitive to tick detail than the original strategy was. Within each minute I assumed the worse outcome happens first. A real-tick run in MetaTrader 5 is the next step, and I'll update this post with it.
- One instrument, by design. This optimization is for gold H4 only, over one 6.7-year stretch that included a strong bull market. Don't read it as a result for any other market.
Bottom line
Before swap and before a real-tick check, adding trade management and risk-based sizing to the TradingView SuperTrend strategy turned gold H4 from "four flat years, then a rally" into seven profitable years out of seven, at a third of the original profit per lot. That's promising, and not yet proven.
If you're reading this before the MT5 update, go back to part 1 for the unmodified strategy and all its tables.
I'm not affiliated with TradingView or with KivancOzbilgic. Past results, including backtests, don't guarantee future results.
Comments
No comments yet. Questions about the settings, the data or the numbers are welcome.
Log in or create a free account to comment.