TradingView OTT Strategy Optimization: 4.4% to 10.1% a Year
Part 2 of 2 · OTT strategy
The short version. In part 1 the default OTT strategy on gold looked fine since 2020 and lost money from 2004 to 2019. So I tried to improve it the strict way: pick everything on gold 2004–2015, write the pass mark down first, then run the result once on data the choices never touched.
- It passed. On gold H1, 2016 to July 2026, the optimized version made 10.1% a year with a 21.1% max drawdown. The original made 4.4% with 24.1%. Buy and hold gold made 8.1% with 30.6%.
- On Exness ticks (Nov 2020 – Sep 2026) it made 14.7% a year with a 16.4% drawdown, against 7.7% / 25.8% for the original.
- But it's gold beta with brakes. Most of the profit came in 2024 and 2025. From 2016 to 2023 it added up to about +21% in eight years.
My verdict: a real improvement over the script's defaults and a smoother ride than holding gold. It isn't a new edge. It's a way to hold gold that steps aside when the trend breaks.
Where part 1 left off
The default OTT (VAR 2, 1.4%, long + short, stop-and-reverse) made PF 1.17 on gold M15 from 2020 to 2026, with 83% of it in 2026. On 2004–2019 Dukascopy data the same setup lost 153%. The short side lost in almost every period I looked at.
That's not much to build on. So the question for this part was narrow: is there any version of OTT on gold that holds up on data it wasn't picked on?
How I set it up
I wrote the whole plan before running a single test. The rules:
- Training data: gold, January 2004 to December 2015 (Dukascopy M1, spread from the data, swap scaled to the gold price of the time). Every choice gets made here.
- Test data, run once: January 2016 to July 2026 on the same Dukascopy data, plus Exness Raw ticks from November 2020 to September 2026 with real spread and commission.
- One score: yearly return divided by max drawdown (people call it MAR). Compounded, the whole account in each trade, drawdown measured on open equity every 5 minutes.
- Pick regions, not peaks. For each setup I ran 48 settings and scored the setup by its median, not its best cell. Then I picked the setting whose 3×3 neighbourhood scored best.
- Every layer had to earn its place on training data, and every result was rerun with the candles cut at four different times (on the hour, and 15, 30 and 45 minutes past).
- The pass mark for the final version: beat the original on both test datasets, beat it on at least 3 of 4 candle timings, and score above 0.3 on 2016–2026.
I'll be straight about one thing. I'd already seen 2004–2026 gold in part 1, so I knew the short side was weak before I wrote the plan. The selection rule was fixed in advance and only used 2004–2015, but putting "long only" on the list of things to try came from what I'd already seen.
Step 1: which version of OTT?
I tested 12 setups: three timeframes (M15, H1, H4), two signals (the default crossover and the colour change from part 1), long + short or long only. 48 settings each, so 576 runs on the training data.

Every long + short setup sat around zero. Every long-only setup was positive, and 69% to 100% of their 48 settings made money. That's the whole story of OTT on gold in one picture: the long side follows gold up, the short side gives it back.
The rule picked H1, default signal, long only, and a setting different from the script's default. The original long + short H1 scored −0.01 on the same years, and buy and hold scored 0.06 (a 55.7% drawdown, swap included).
Steps 2 to 4: what else earns its place?
Three more layers, each judged on 2004–2015 only:
| Layer | Pass mark | Training result | Kept? |
|---|---|---|---|
| A market filter (three designs, two ways to apply each, four variations each) | 3 of 4 variations beat no filter, at 3 of 4 candle timings | One design passed | Yes |
| Several versions side by side | Beat the single version's median | 0.131 vs 0.156 | No |
| A position-sizing rule (never more than 3× the account) | Beat fixed size | 0.200 vs 0.166 | Yes |
Running several versions at once helped my PMax optimization a lot. Here it made things worse, so it's out. I'm not publishing the exact settings or the filter design.
The test: did it hold up?
Here's every layer on the two test datasets. None of these numbers were used to choose anything.

| Gold H1, test periods | Yearly return | Max drawdown | Return ÷ drawdown | Trades | PF |
|---|---|---|---|---|---|
| Dukascopy, Jan 2016 – Jul 2026 | |||||
| Original (default, long + short) | 4.4% | 24.1% | 0.18 | ||
| Optimized | 10.1% | 21.1% | 0.48 | 254 | 1.62 |
| Buy and hold gold | 8.1% | 30.6% | 0.27 | ||
| Exness, Nov 2020 – Sep 2026 | |||||
| Original | 7.7% | 25.8% | 0.30 | ||
| Optimized | 14.7% | 16.4% | 0.89 | 143 | 1.93 |
| Buy and hold gold | 8.9% | 30.6% | 0.29 |
Compounded. Spread and swap included; Exness also includes 3.5 USD per lot per side commission.
All three conditions passed. The single version (before sizing) beat the original at 4 of 4 candle timings on both datasets. On Exness it scored 0.75 to 0.97 across the four timings, while the original ranged from 0.07 to 0.30. On Dukascopy it was 0.41 to 0.46 against 0.01 to 0.18.

Where did the improvement come from? Mostly step 1. Dropping the short side and changing the setting took the score from 0.18 to 0.37. The filter cut the drawdown (21% to 17%), and the sizing rule spent some of that drawdown to buy more return.
Is it better than just holding gold?
On paper, yes: more return, a third less drawdown, and it's in the market about 60% of the time. But I wouldn't call it proven. I compared the monthly returns of the two (with buy and hold scaled down to the same drawdown) and got a t-statistic of +1.45 on 2016–2026 and +2.08 on 2020–2026. Positive, not convincing on the longer stretch. Against the original OTT it was +1.27 and +1.68.
And look at when it made its money:

When gold went sideways or down (2018, 2021, 2022), it lost a little or nothing. That's the filter doing its job: buy and hold lost 6%, 8% and 5% in those years. When gold ran (2017, 2024, 2025), it caught the move, and the sizing rule let it catch more than 1×. But in 2019 and 2020 gold rose 13% and 19% and the optimized version made −1% and +8%. It misses some of the good years too.
So this isn't something that makes money whatever gold does. It's long gold with a stop on the trend. If gold goes nowhere for five years, expect five flat years.
Risk structure
- Leverage. The sizing rule goes up to 3× the account. At entry it ranged from 0.8× to 2.7× in the test. You need the margin for that, and a 3× position on a gap is a 3× gap.
- Worst trades. The ten worst trades on 2016–2026 each lost 2.0% to 2.7% of the account. The worst: a buy at 1,304.57 on 18 March 2019, closed at 1,291.84 on 28 March, −2.67% with the position at 2.35×. Next: a buy at 1,870.35 on 9 December 2020, out the next day at 1,834.16, −2.59%.
- Losing years. 4 of 11 on Dukascopy, 2 of 7 on Exness. All small: the biggest were −3.0% on Dukascopy (2018) and −4.5% on Exness (the last two months of 2020).
- No stop loss. It still exits only on the opposite signal or when the filter turns off. No martingale, no grid, no averaging.
What I couldn't verify
- Truly unseen data. The test years weren't used to pick anything, but I had looked at them in part 1. That's weaker than a real out-of-sample test.
- Historical swap. I assumed about 4.9% a year on gold longs for the whole of 2004–2026. Swap was much lower when rates were near zero, so the older years are probably a bit pessimistic.
- MetaTrader 5. Everything here is my Python simulation. I haven't built and run it as an EA in the strategy tester yet.
- Other markets. I only tuned and tested gold. I wouldn't assume the same changes help on USDJPY or the S&P 500.
Bottom line
On gold H1, a long-only OTT with different settings, a market filter and a sizing rule passed every condition I set before testing: 10.1% a year with a 21% drawdown on 2016–2026, against 4.4% for the script's defaults and 8.1% for holding gold. It's a better way to hold gold, not an edge you'd want on a market that doesn't trend up.
If you haven't read it, part 1 has the default backtest, the screener problem and the 2004–2019 results. For the same kind of work on similar scripts, see PMax part 2 and the optimization section of the Hull Suite backtest, where nothing I tried beat the original.
I'm not affiliated with TradingView, KivancOzbilgic or Anıl Özekşi. 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.