<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Truong Pham | Moon The Train</title>
    <description>The latest articles on DEV Community by Truong Pham | Moon The Train (@moonthetrain).</description>
    <link>https://dev.to/moonthetrain</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2405521%2F747d1db6-8a77-4447-b3f5-7608eb9acc39.png</url>
      <title>DEV Community: Truong Pham | Moon The Train</title>
      <link>https://dev.to/moonthetrain</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/moonthetrain"/>
    <language>en</language>
    <item>
      <title>ICT Trading Strategy Backtest: 79 Setups on ES and NQ</title>
      <dc:creator>Truong Pham | Moon The Train</dc:creator>
      <pubDate>Sun, 22 Nov 2026 15:13:14 +0000</pubDate>
      <link>https://dev.to/moonthetrain/ict-trading-strategy-backtest-79-setups-on-es-and-nq-d4o</link>
      <guid>https://dev.to/moonthetrain/ict-trading-strategy-backtest-79-setups-on-es-and-nq-d4o</guid>
      <description>&lt;p&gt;&lt;strong&gt;The short version.&lt;/strong&gt; This is an ICT trading strategy backtest. ICT (Inner Circle Trader) is everywhere right now, so I read through the theory, turned the best-known setups into fixed rules, and ran them on the two markets the method is usually taught on, ES and NQ, from March 2014 to August 2026.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;None of the three setups made money.&lt;/strong&gt; The 2022 model, the Silver Bullet and the London version all came out with a profit factor between 0.66 and 0.94 on Dukascopy data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It isn't the spread.&lt;/strong&gt; With trading costs set to zero, five of six runs were still below break-even.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A higher-timeframe bias helped a little and not enough.&lt;/strong&gt; Daily bias, H4 bias, both together: 33 more setups, best profit factor 0.96.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The win rate tells the story.&lt;/strong&gt; With a 2R target you need 33.3% winners to break even. The 2R setups won 26% to 41% of the time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So as mechanical rules, I couldn't make ICT pay. That's not the same as saying ICT doesn't work, and I'll come back to that at the end, because I may well have some of the rules wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the ICT trading strategy?
&lt;/h2&gt;

&lt;p&gt;It's a set of ideas from Michael Huddleston about where price goes to collect orders. The core claim is that price runs to pools of stop orders (liquidity) above old highs and below old lows, reverses, and leaves a footprint you can enter on.&lt;/p&gt;

&lt;p&gt;The pieces I used:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Term&lt;/th&gt;
&lt;th&gt;How I defined it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Liquidity&lt;/td&gt;
&lt;td&gt;Previous day's high and low, Asia range (20:00 to 24:00 New York), London range (02:00 to 05:00). Only levels still untouched when the session opens&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sweep&lt;/td&gt;
&lt;td&gt;Price trades through one of those levels inside the session&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MSS (market structure shift)&lt;/td&gt;
&lt;td&gt;After the sweep, a bar closes beyond the last swing point on the other side&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;FVG (fair value gap)&lt;/td&gt;
&lt;td&gt;Three bars where bar 3's low is above bar 1's high (or the mirror for shorts)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Killzone&lt;/td&gt;
&lt;td&gt;New York morning, 08:30 to 11:00. London, 02:00 to 05:00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bias&lt;/td&gt;
&lt;td&gt;Direction on a higher timeframe. I tested daily, H4, and both agreeing&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All times are New York time and follow daylight saving.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which ICT setups did I test?
&lt;/h2&gt;

&lt;p&gt;Three, each written so a computer can't argue with it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The 2022 model.&lt;/strong&gt; In the New York morning, wait for a sweep of an untouched low. Then an MSS up. Then a bullish FVG that formed after the sweep low. Buy limit at the top edge of the gap, stop under the sweep low, target at 2R, flat at 16:00. Shorts are the mirror. M5 bars.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The London version.&lt;/strong&gt; Same rules, 02:00 to 05:00.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Silver Bullet.&lt;/strong&gt; Two versions. The simple one takes the first FVG that forms between 10:00 and 11:00. The second follows the rule set the popular Silver Bullet indicators draw (I already had it coded in an indicator of mine): trend by MSS on a swing zigzag, only gaps in the trend direction, three windows (03:00, 10:00 and 14:00 New York), the gap is dropped if a bar closes through it, and the target is the nearest unbroken swing at least 10 points away.&lt;/p&gt;

&lt;p&gt;Here's one trade so you can check my reading. On 31 July 2026 the Asia low on the S&amp;amp;P was 7455.41 and still untouched at 08:30. At 08:40 price dipped to 7450.41, taking it. Price then ran up, and the 09:30 bar left a gap above 7465.90. The rule bought at 7468.64 with the stop at 7449.66. It filled at 09:39 and was stopped out six minutes later. That's a textbook-looking setup, and it lost.&lt;/p&gt;

&lt;h2&gt;
  
  
  How did I test it?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Data:&lt;/strong&gt; Dukascopy one-minute bars for the S&amp;amp;P 500 and Nasdaq 100 index CFDs, March 2014 to August 2026, spread from the data (about 0.5 points on ES, 1 to 3 on NQ). I also ran Exness US500 ticks from March 2020 to September 2026 as a second source.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Risk:&lt;/strong&gt; a fixed $100 per trade, no compounding. So every result below is in R, where 1 R is the amount risked.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fills:&lt;/strong&gt; limit orders fill when price touches them, which flatters the result a bit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Look-ahead:&lt;/strong&gt; I cut the data at 12 points and reran. Every decision before each cut came out identical, so the rules don't peek at future bars. I wrote about why that check matters in &lt;a href="https://moonthetrain.com/lab/mql5-ea-backtest-sees-the-future" rel="noopener noreferrer"&gt;this post on backtests that see the future&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In total I ran 79 setups. I'm giving that number because the more variations you try, the more likely one looks good by luck.&lt;/p&gt;

&lt;p&gt;The code is on GitHub: &lt;a href="https://github.com/truongxxxx/ict-backtest" rel="noopener noreferrer"&gt;github.com/truongxxxx/ict-backtest&lt;/a&gt;. It's the rules plus a small backtester that gives the same trade list as my own engine, so you can rerun any number here or change a definition you disagree with. You'll need to download the price data yourself (the README explains how).&lt;/p&gt;

&lt;h2&gt;
  
  
  Is the ICT strategy profitable in a backtest?
&lt;/h2&gt;

&lt;p&gt;Not in mine. Here are the default rules, 2014 to August 2026:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Market&lt;/th&gt;
&lt;th&gt;Setup&lt;/th&gt;
&lt;th&gt;Trades&lt;/th&gt;
&lt;th&gt;Win rate&lt;/th&gt;
&lt;th&gt;Profit factor&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;th&gt;Winning years&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ES&lt;/td&gt;
&lt;td&gt;2022 model&lt;/td&gt;
&lt;td&gt;337&lt;/td&gt;
&lt;td&gt;35.3%&lt;/td&gt;
&lt;td&gt;0.87&lt;/td&gt;
&lt;td&gt;−26 R&lt;/td&gt;
&lt;td&gt;5 of 13&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ES&lt;/td&gt;
&lt;td&gt;London&lt;/td&gt;
&lt;td&gt;420&lt;/td&gt;
&lt;td&gt;32.1%&lt;/td&gt;
&lt;td&gt;0.94&lt;/td&gt;
&lt;td&gt;−17 R&lt;/td&gt;
&lt;td&gt;7 of 13&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ES&lt;/td&gt;
&lt;td&gt;Silver Bullet (first FVG)&lt;/td&gt;
&lt;td&gt;2,403&lt;/td&gt;
&lt;td&gt;26.5%&lt;/td&gt;
&lt;td&gt;0.72&lt;/td&gt;
&lt;td&gt;−501 R&lt;/td&gt;
&lt;td&gt;0 of 13&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NQ&lt;/td&gt;
&lt;td&gt;2022 model&lt;/td&gt;
&lt;td&gt;322&lt;/td&gt;
&lt;td&gt;35.4%&lt;/td&gt;
&lt;td&gt;0.74&lt;/td&gt;
&lt;td&gt;−51 R&lt;/td&gt;
&lt;td&gt;3 of 13&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NQ&lt;/td&gt;
&lt;td&gt;London&lt;/td&gt;
&lt;td&gt;395&lt;/td&gt;
&lt;td&gt;25.8%&lt;/td&gt;
&lt;td&gt;0.66&lt;/td&gt;
&lt;td&gt;−101 R&lt;/td&gt;
&lt;td&gt;3 of 13&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NQ&lt;/td&gt;
&lt;td&gt;Silver Bullet (first FVG)&lt;/td&gt;
&lt;td&gt;2,391&lt;/td&gt;
&lt;td&gt;27.9%&lt;/td&gt;
&lt;td&gt;0.77&lt;/td&gt;
&lt;td&gt;−391 R&lt;/td&gt;
&lt;td&gt;2 of 13&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fye7x9tsqzyhad2jvo6ay.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fye7x9tsqzyhad2jvo6ay.png" alt="Cumulative result in R for three ICT setups on S&amp;amp;P 500 and Nasdaq 100, March 2014 to August 2026, Dukascopy M1 data with spread: 2022 model, London and Silver Bullet all end below zero" width="800" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Exness tick run agreed: the 2022 model made 189 trades with a profit factor of 0.88. The one green number in the whole project was London on Exness, 1.11 over 253 trades. That's too few trades to tell from luck, and the same setup on NQ was the worst of the lot.&lt;/p&gt;

&lt;p&gt;And costs aren't the reason. With the spread set to zero the profit factors on ES were 0.97, 1.16 and 0.97, and on NQ 0.82, 0.92 and 0.95.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which part of the setup matters?
&lt;/h2&gt;

&lt;p&gt;This surprised me more than the losses. I switched the layers off one at a time on ES:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;2022 model, ES&lt;/th&gt;
&lt;th&gt;Trades&lt;/th&gt;
&lt;th&gt;Profit factor&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;All rules&lt;/td&gt;
&lt;td&gt;337&lt;/td&gt;
&lt;td&gt;0.87&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No liquidity sweep needed&lt;/td&gt;
&lt;td&gt;2,832&lt;/td&gt;
&lt;td&gt;0.82&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No MSS needed&lt;/td&gt;
&lt;td&gt;840&lt;/td&gt;
&lt;td&gt;0.85&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No killzone (any time until 16:00)&lt;/td&gt;
&lt;td&gt;2,791&lt;/td&gt;
&lt;td&gt;0.88&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Enter at the middle of the gap&lt;/td&gt;
&lt;td&gt;319&lt;/td&gt;
&lt;td&gt;0.88&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Move stop to break-even at 1R&lt;/td&gt;
&lt;td&gt;337&lt;/td&gt;
&lt;td&gt;0.89&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Target at opposite liquidity instead of 2R&lt;/td&gt;
&lt;td&gt;244&lt;/td&gt;
&lt;td&gt;0.85&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Take away the sweep, the structure shift or the time window and you get up to eight times the trades at about the same profit factor. In my test those filters picked fewer trades. They didn't pick better ones.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does a higher-timeframe bias fix it?
&lt;/h2&gt;

&lt;p&gt;A little. Not enough. I defined daily bias as "the last day closed outside the previous day's range" and H4 bias as the same MSS logic on four-hour bars, using only closed bars.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fddga09adsufi7um7np43.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fddga09adsufi7um7np43.png" alt="Profit factor of ICT setups on S&amp;amp;P 500 and Nasdaq 100 with no bias, daily bias, H4 bias and both, 2014 to August 2026: every bar is below the break-even line at 1.0" width="799" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The best case was the 2022 model on NQ, which went from 0.74 to 0.94 when daily and H4 agreed, with the win rate up from 35% to 41%. But that's 143 trades in twelve years, and it's still under 1. On the indicator-style Silver Bullet the bias cut the trade count roughly in half and left the win rate where it was (ES: 23.6% without, 22.8% with). Trades with the bias didn't win more often than trades against it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I couldn't test
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Discretion.&lt;/strong&gt; ICT traders pick setups by reading context. I can only test what I can write down, and a rule that needs judgment isn't testable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real futures.&lt;/strong&gt; These are index CFDs. They track ES and NQ closely, but not tick for tick.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Other concepts.&lt;/strong&gt; Order blocks, breakers, SMT divergence and the Unicorn model aren't in here yet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Other definitions.&lt;/strong&gt; There's more than one way to define a swing, a valid gap or a daily bias. I picked the plainest reading each time.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where this leaves me
&lt;/h2&gt;

&lt;p&gt;With the rules as I understood them, I wouldn't trade ICT mechanically. Twelve years, two markets, 79 setups, and nothing that clears break-even with enough trades to trust.&lt;/p&gt;

&lt;p&gt;But I want to be straight about the limits. I learned this from the published material, and it's likely I've misread or oversimplified some rules. People who trade it well may be using context I haven't captured. So I'm treating this as a first pass. If you think a definition above is wrong, tell me which one and how you'd write it (or open an issue on the repo), and I'll rerun it. I did the same thing with another famous rule set in &lt;a href="https://moonthetrain.com/lab/turtle-trading-rules-explained" rel="noopener noreferrer"&gt;my Turtle trading rules post&lt;/a&gt;, and I'll keep at this one too.&lt;/p&gt;

</description>
      <category>python</category>
      <category>backtesting</category>
      <category>trading</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>TradingView AlphaTrend Strategy: Best Settings, Backtest</title>
      <dc:creator>Truong Pham | Moon The Train</dc:creator>
      <pubDate>Sat, 21 Nov 2026 02:32:48 +0000</pubDate>
      <link>https://dev.to/moonthetrain/tradingview-alphatrend-strategy-best-settings-backtest-3fo9</link>
      <guid>https://dev.to/moonthetrain/tradingview-alphatrend-strategy-best-settings-backtest-3fo9</guid>
      <description>&lt;p&gt;&lt;strong&gt;The short version.&lt;/strong&gt; This is a TradingView AlphaTrend strategy backtest. KivancOzbilgic's "AlphaTrend Strategy" has about 7,200 boosts. I ported it to Python and ran it on Exness tick data for seven markets, M5 to D1, with real spread and commission, from January 2020 to September 2026.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;As a stand-alone long + short strategy, it has no edge of its own.&lt;/strong&gt; EURUSD, GBPUSD and NZDUSD lost on every timeframe from M5 to H4 after costs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Where it made money, the long side did the work.&lt;/strong&gt; Gold H4: PF 1.47, +2,336 USD per 0.01 lot. Longs made +2,484, shorts lost 148. Holding gold made +2,591 over the same period.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Long only, it kept pace with buy and hold at half the drawdown.&lt;/strong&gt; Gold H4 long only: +2,484 with a 757 max drawdown, versus 1,579 for holding. It was out of the market 47% of the time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The volume in MFI barely matters.&lt;/strong&gt; With the same prices and volume set to 1 on every bar, 96–99% of bars ended up in the same position. You can stop worrying about which broker's tick volume you use.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;On old data it went flat.&lt;/strong&gt; Dukascopy gold 2004–2019, H4 long + short: PF 1.03.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My take: use AlphaTrend as a trend filter or trailing level, long side, on markets that trend. Don't run the strategy script as written and expect the shorts to pay.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the AlphaTrend strategy on TradingView?
&lt;/h2&gt;

&lt;p&gt;It's the &lt;a href="https://www.tradingview.com/script/3wdQu7P3-AlphaTrend-Strategy/" rel="noopener noreferrer"&gt;open-source strategy version&lt;/a&gt; of Kıvanç Özbilgiç's AlphaTrend indicator, version 2.0 published 9 January 2023. Here's all of the code that trades:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ATR   = ta.sma(ta.tr, AP)                 // AP = 14
upT   = low  - ATR * coeff                // coeff = 1
downT = high + ATR * coeff
AlphaTrend := (novolumedata ? ta.rsi(src, AP) &amp;gt;= 50 : ta.mfi(hlc3, AP) &amp;gt;= 50) ?
              (upT &amp;lt; nz(AlphaTrend[1]) ? nz(AlphaTrend[1]) : upT) :
              (downT &amp;gt; nz(AlphaTrend[1]) ? nz(AlphaTrend[1]) : downT)

buySignalk  = ta.crossover(AlphaTrend, AlphaTrend[2])
sellSignalk = ta.crossunder(AlphaTrend, AlphaTrend[2])
if (buySignalk)
    strategy.entry("Long", strategy.long)
if (sellSignalk)
    strategy.entry("Short", strategy.short)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two things in there aren't obvious from the chart.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The line is a ratchet.&lt;/strong&gt; While MFI is at or above 50, the line can only move up to &lt;code&gt;low − ATR&lt;/code&gt;, never down. When MFI drops below 50, it can only move down to &lt;code&gt;high + ATR&lt;/code&gt;. That's why it sits flat for long stretches: the new level wasn't better than the one it already held.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The second line is the same line, two bars ago.&lt;/strong&gt; The red line on the chart isn't a slower average. So a "crossover" just means the ratchet changed direction in the last two bars. There's no second opinion involved.&lt;/p&gt;

&lt;p&gt;There's no stop loss and no exit. Each signal closes the old position and opens the opposite one, so the strategy is in the market about 98% of the time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8mx01ayy5p7ecunac8gv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8mx01ayy5p7ecunac8gv.png" alt="AlphaTrend on XAUUSD H4, 22 September to 24 October 2025: candles, the AlphaTrend line in blue and the same line two bars ago in red, green background while long and red while short, MFI 14 below with the 50 line, Exness tick data" width="800" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's a good month for it. One buy on 22 September held through the whole rise from about 3,690 to above 4,300. The line stepped up while MFI stayed above 50 and sat flat when it dipped. MFI went under 50 around 18 October, the line started falling a few days later, and the sell gave back part of the top.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does AlphaTrend repaint?
&lt;/h2&gt;

&lt;p&gt;Not after the bar closes. The line uses the current bar's high, low and MFI, so on a live bar it can move and a signal can appear and then disappear before the close. Once the bar closes, the value is final. I take signals on the close and fill at the next bar's open, the same way TradingView's tester does by default.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I tested it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Port:&lt;/strong&gt; Python, signal on the close, fill at the next open, stop-and-reverse like &lt;code&gt;strategy.entry&lt;/code&gt;. Default settings: ATR period 14, multiplier 1, MFI on hlc3.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Volume:&lt;/strong&gt; MFI needs volume, so I used the number of ticks per bar. That's what retail forex volume is on TradingView and MetaTrader too.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data:&lt;/strong&gt; Exness Raw Spread ticks for XAUUSD, USDJPY, EURUSD, GBPUSD, NZDUSD and US500, January 2020 to September 2026. BTCUSD from January 2024.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Costs:&lt;/strong&gt; buys fill at the real ask on the bar's first tick, sells at the bid, plus 3.5 USD per lot per side for forex and gold.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Swap:&lt;/strong&gt; checked separately for gold (below). Not included in the main tables.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Older data:&lt;/strong&gt; Dukascopy M1 via Tickstory, 2004 to 2026, for gold and four forex pairs, with Dukascopy's own tick counts as volume.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Size:&lt;/strong&gt; fixed, no compounding. Gold in USD per 0.01 lot (1 oz), forex in pips per lot, US500 in index points, Bitcoin in USD per 1 BTC.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The results
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fezfkyskjd9w0d5t0pm3v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fezfkyskjd9w0d5t0pm3v.png" alt="AlphaTrend Strategy profit factor after costs by market and timeframe, long plus short and long only, XAUUSD USDJPY EURUSD GBPUSD NZDUSD US500 BTCUSD, M5 to D1, with trade counts, Exness Raw Spread ticks 2020 to 2026" width="800" height="364"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;XAUUSD, Jan 2020 – Sep 2026, before swap.&lt;/strong&gt; Buy and hold: +2,588, max drawdown 1,600.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timeframe&lt;/th&gt;
&lt;th&gt;Trades&lt;/th&gt;
&lt;th&gt;PF&lt;/th&gt;
&lt;th&gt;Net&lt;/th&gt;
&lt;th&gt;Max DD&lt;/th&gt;
&lt;th&gt;Win rate&lt;/th&gt;
&lt;th&gt;Long net&lt;/th&gt;
&lt;th&gt;Short net&lt;/th&gt;
&lt;th&gt;Long only: PF / net / DD&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;M5&lt;/td&gt;
&lt;td&gt;12,041&lt;/td&gt;
&lt;td&gt;0.97&lt;/td&gt;
&lt;td&gt;−1,260&lt;/td&gt;
&lt;td&gt;2,434&lt;/td&gt;
&lt;td&gt;34%&lt;/td&gt;
&lt;td&gt;+663&lt;/td&gt;
&lt;td&gt;−1,923&lt;/td&gt;
&lt;td&gt;1.03 / +663 / 958&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M15&lt;/td&gt;
&lt;td&gt;3,823&lt;/td&gt;
&lt;td&gt;1.09&lt;/td&gt;
&lt;td&gt;+2,040&lt;/td&gt;
&lt;td&gt;868&lt;/td&gt;
&lt;td&gt;35%&lt;/td&gt;
&lt;td&gt;+2,312&lt;/td&gt;
&lt;td&gt;−272&lt;/td&gt;
&lt;td&gt;1.21 / +2,312 / 710&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M30&lt;/td&gt;
&lt;td&gt;1,885&lt;/td&gt;
&lt;td&gt;1.13&lt;/td&gt;
&lt;td&gt;+2,095&lt;/td&gt;
&lt;td&gt;926&lt;/td&gt;
&lt;td&gt;35%&lt;/td&gt;
&lt;td&gt;+2,341&lt;/td&gt;
&lt;td&gt;−247&lt;/td&gt;
&lt;td&gt;1.30 / +2,341 / 763&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;H1&lt;/td&gt;
&lt;td&gt;940&lt;/td&gt;
&lt;td&gt;1.22&lt;/td&gt;
&lt;td&gt;+2,438&lt;/td&gt;
&lt;td&gt;740&lt;/td&gt;
&lt;td&gt;37%&lt;/td&gt;
&lt;td&gt;+2,510&lt;/td&gt;
&lt;td&gt;−72&lt;/td&gt;
&lt;td&gt;1.49 / +2,510 / 526&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;H4&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;265&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.47&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+2,336&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;820&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;39%&lt;/td&gt;
&lt;td&gt;+2,484&lt;/td&gt;
&lt;td&gt;−148&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;2.08 / +2,484 / 757&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D1&lt;/td&gt;
&lt;td&gt;51&lt;/td&gt;
&lt;td&gt;2.53&lt;/td&gt;
&lt;td&gt;+2,560&lt;/td&gt;
&lt;td&gt;809&lt;/td&gt;
&lt;td&gt;43%&lt;/td&gt;
&lt;td&gt;+2,406&lt;/td&gt;
&lt;td&gt;+154&lt;/td&gt;
&lt;td&gt;4.76 / +2,406 / 809&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;USD per 0.01 lot.&lt;/em&gt; Look at the net column. From M15 to D1 it lands between +2,040 and +2,560 every time, right around the +2,588 that holding gold made. That's what a long-biased trend follower does in a market that doubled.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;USDJPY, Jan 2020 – Sep 2026.&lt;/strong&gt; Buy and hold: +4,845 pips.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timeframe&lt;/th&gt;
&lt;th&gt;Trades&lt;/th&gt;
&lt;th&gt;PF&lt;/th&gt;
&lt;th&gt;Net&lt;/th&gt;
&lt;th&gt;Max DD&lt;/th&gt;
&lt;th&gt;Win rate&lt;/th&gt;
&lt;th&gt;Long net&lt;/th&gt;
&lt;th&gt;Short net&lt;/th&gt;
&lt;th&gt;Long only: PF / net / DD&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;M5&lt;/td&gt;
&lt;td&gt;13,193&lt;/td&gt;
&lt;td&gt;0.87&lt;/td&gt;
&lt;td&gt;−15,318&lt;/td&gt;
&lt;td&gt;15,892&lt;/td&gt;
&lt;td&gt;33%&lt;/td&gt;
&lt;td&gt;−5,239&lt;/td&gt;
&lt;td&gt;−10,079&lt;/td&gt;
&lt;td&gt;0.91 / −5,239 / 5,589&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M15&lt;/td&gt;
&lt;td&gt;4,074&lt;/td&gt;
&lt;td&gt;1.05&lt;/td&gt;
&lt;td&gt;+2,972&lt;/td&gt;
&lt;td&gt;2,385&lt;/td&gt;
&lt;td&gt;35%&lt;/td&gt;
&lt;td&gt;+3,911&lt;/td&gt;
&lt;td&gt;−940&lt;/td&gt;
&lt;td&gt;1.12 / +3,911 / 1,326&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M30&lt;/td&gt;
&lt;td&gt;1,981&lt;/td&gt;
&lt;td&gt;1.05&lt;/td&gt;
&lt;td&gt;+2,098&lt;/td&gt;
&lt;td&gt;3,009&lt;/td&gt;
&lt;td&gt;36%&lt;/td&gt;
&lt;td&gt;+3,489&lt;/td&gt;
&lt;td&gt;−1,391&lt;/td&gt;
&lt;td&gt;1.16 / +3,489 / 1,840&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;H1&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;970&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.16&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+4,920&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;2,139&lt;/td&gt;
&lt;td&gt;38%&lt;/td&gt;
&lt;td&gt;+4,854&lt;/td&gt;
&lt;td&gt;+66&lt;/td&gt;
&lt;td&gt;1.31 / +4,854 / 1,689&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;H4&lt;/td&gt;
&lt;td&gt;288&lt;/td&gt;
&lt;td&gt;0.97&lt;/td&gt;
&lt;td&gt;−624&lt;/td&gt;
&lt;td&gt;3,957&lt;/td&gt;
&lt;td&gt;33%&lt;/td&gt;
&lt;td&gt;+2,161&lt;/td&gt;
&lt;td&gt;−2,785&lt;/td&gt;
&lt;td&gt;1.26 / +2,161 / 1,681&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D1&lt;/td&gt;
&lt;td&gt;44&lt;/td&gt;
&lt;td&gt;1.82&lt;/td&gt;
&lt;td&gt;+4,291&lt;/td&gt;
&lt;td&gt;1,932&lt;/td&gt;
&lt;td&gt;43%&lt;/td&gt;
&lt;td&gt;+4,799&lt;/td&gt;
&lt;td&gt;−508&lt;/td&gt;
&lt;td&gt;4.61 / +4,799 / 1,191&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Pips per lot, swap not included.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The other five markets, long + short:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Market&lt;/th&gt;
&lt;th&gt;M5&lt;/th&gt;
&lt;th&gt;M15&lt;/th&gt;
&lt;th&gt;M30&lt;/th&gt;
&lt;th&gt;H1&lt;/th&gt;
&lt;th&gt;H4&lt;/th&gt;
&lt;th&gt;D1&lt;/th&gt;
&lt;th&gt;Buy and hold&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;EURUSD&lt;/td&gt;
&lt;td&gt;0.83&lt;/td&gt;
&lt;td&gt;0.87&lt;/td&gt;
&lt;td&gt;0.93&lt;/td&gt;
&lt;td&gt;0.95&lt;/td&gt;
&lt;td&gt;0.87&lt;/td&gt;
&lt;td&gt;1.13&lt;/td&gt;
&lt;td&gt;+304 pips&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GBPUSD&lt;/td&gt;
&lt;td&gt;0.81&lt;/td&gt;
&lt;td&gt;0.90&lt;/td&gt;
&lt;td&gt;0.93&lt;/td&gt;
&lt;td&gt;0.89&lt;/td&gt;
&lt;td&gt;0.81&lt;/td&gt;
&lt;td&gt;1.22&lt;/td&gt;
&lt;td&gt;+214 pips&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NZDUSD&lt;/td&gt;
&lt;td&gt;0.71&lt;/td&gt;
&lt;td&gt;0.85&lt;/td&gt;
&lt;td&gt;0.99&lt;/td&gt;
&lt;td&gt;0.88&lt;/td&gt;
&lt;td&gt;0.74&lt;/td&gt;
&lt;td&gt;0.96&lt;/td&gt;
&lt;td&gt;−821 pips&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;US500&lt;/td&gt;
&lt;td&gt;0.97&lt;/td&gt;
&lt;td&gt;1.00&lt;/td&gt;
&lt;td&gt;1.02&lt;/td&gt;
&lt;td&gt;0.92&lt;/td&gt;
&lt;td&gt;0.89&lt;/td&gt;
&lt;td&gt;1.05&lt;/td&gt;
&lt;td&gt;+4,437 pts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BTCUSD*&lt;/td&gt;
&lt;td&gt;0.93&lt;/td&gt;
&lt;td&gt;0.96&lt;/td&gt;
&lt;td&gt;1.02&lt;/td&gt;
&lt;td&gt;1.04&lt;/td&gt;
&lt;td&gt;1.23&lt;/td&gt;
&lt;td&gt;0.85&lt;/td&gt;
&lt;td&gt;+41,139 USD&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Profit factor after spread and commission, no swap. *BTCUSD January 2024 – September 2026. Long only on US500 was 1.04–2.42 across timeframes, and on Bitcoin H4 1.46, both still behind holding.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The forex majors went sideways for six years, and AlphaTrend lost on them. Gold, yen, the S&amp;amp;P and Bitcoin went up, and AlphaTrend made money on the long side. That's the whole pattern.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fumem8q6jx0kjbn3i4y06.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fumem8q6jx0kjbn3i4y06.png" alt="AlphaTrend equity on XAUUSD H4 and USDJPY H1: long plus short, long only, the short side alone and buy and hold, January 2020 to September 2026, Exness Raw Spread ticks, spread and commission included, swap not included" width="800" height="364"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The red line is the short side on its own. On gold it bled for five years, lost about 900, then got most of it back in the 2026 sell-off. On USDJPY it finished at +66 pips after six years of work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Should you turn on "no volume data"?
&lt;/h2&gt;

&lt;p&gt;It barely matters. That surprised me more than anything else in this test.&lt;/p&gt;

&lt;p&gt;The script has a switch called "Change calculation (no volume data)?". Off, the filter is MFI, which weighs each bar by volume. On, it's RSI, which only uses closes. People worry about it because forex "volume" is just a tick count, and every broker's feed counts differently.&lt;/p&gt;

&lt;p&gt;So I kept the Exness prices fixed and swapped only the volume: Exness tick counts, Dukascopy tick counts, and a flat 1 on every bar (which removes volume completely).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F05zt9ge7bhx2f21qqy8u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F05zt9ge7bhx2f21qqy8u.png" alt="AlphaTrend profit factor on the same Exness prices with three volume feeds, Exness tick volume, Dukascopy tick volume and volume equal to 1, for XAUUSD H1 and H4, USDJPY H1, EURUSD H1, GBPUSD H1, NZDUSD H1, plus the share of bars in the same position, January 2020 to June 2026" width="800" height="349"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Positions matched on &lt;strong&gt;96–99.5% of bars&lt;/strong&gt; between the two brokers' tick volume, and &lt;strong&gt;96–98%&lt;/strong&gt; with no volume at all.&lt;/li&gt;
&lt;li&gt;Profit factor usually moved by less than 0.1, never by more than 0.2, and with no direction to it. Gold H4 was 1.60 with Exness volume and 1.79 with volume set to 1.&lt;/li&gt;
&lt;li&gt;Turning the switch on (RSI instead of MFI) gave nearly the same results too: gold H1 1.20 instead of 1.22, H4 1.40 instead of 1.47.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The reason is simple once you see it. Over 14 bars, MFI above 50 mostly means hlc3 went up more than it went down. The volume weights shuffle that a little but rarely flip it. So pick either setting. Your broker's tick feed won't change your signals much.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are the best AlphaTrend settings?
&lt;/h2&gt;

&lt;p&gt;The defaults are fine, and the choice of timeframe matters far more than the numbers.&lt;/p&gt;

&lt;p&gt;I ran 36 combinations: multiplier 0.5 to 3, period 7 to 50. On gold H1, all 36 had PF above 1, and 35 of 36 were profitable in both halves of 2020–2026. Gold M30 and H4: all 36 above 1. USDJPY H1: 35 of 36. On EURUSD, GBPUSD and NZDUSD almost nothing worked whatever I set. When every setting works on one market and none work on another, that's the market, not the setting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The D1 numbers are the trap.&lt;/strong&gt; Gold D1 PF 2.53 and USDJPY D1 1.82 look like the best cells in the table. They come from 51 and 44 trades. Flip the volume switch on gold D1 and PF drops to 1.29. I wouldn't pick a timeframe on that.&lt;/p&gt;

&lt;p&gt;I also tried a standard RMA-smoothed ATR instead of the script's SMA, and moved the candle open by up to three hours. Neither changed the picture: gold H4 stayed between 1.41 and 1.61.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is the gold result an edge or just gold going up?
&lt;/h2&gt;

&lt;p&gt;Mostly gold going up. Three tests point the same way.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;By year.&lt;/strong&gt; Gold H4, long + short, USD per 0.01 lot:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Exness gold H4&lt;/th&gt;
&lt;th&gt;2020&lt;/th&gt;
&lt;th&gt;2021&lt;/th&gt;
&lt;th&gt;2022&lt;/th&gt;
&lt;th&gt;2023&lt;/th&gt;
&lt;th&gt;2024&lt;/th&gt;
&lt;th&gt;2025&lt;/th&gt;
&lt;th&gt;2026 (to Sep)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Trades&lt;/td&gt;
&lt;td&gt;31&lt;/td&gt;
&lt;td&gt;44&lt;/td&gt;
&lt;td&gt;42&lt;/td&gt;
&lt;td&gt;40&lt;/td&gt;
&lt;td&gt;45&lt;/td&gt;
&lt;td&gt;36&lt;/td&gt;
&lt;td&gt;27&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PF&lt;/td&gt;
&lt;td&gt;0.79&lt;/td&gt;
&lt;td&gt;1.18&lt;/td&gt;
&lt;td&gt;1.03&lt;/td&gt;
&lt;td&gt;1.31&lt;/td&gt;
&lt;td&gt;1.21&lt;/td&gt;
&lt;td&gt;2.37&lt;/td&gt;
&lt;td&gt;1.83&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Net&lt;/td&gt;
&lt;td&gt;−140&lt;/td&gt;
&lt;td&gt;+87&lt;/td&gt;
&lt;td&gt;+21&lt;/td&gt;
&lt;td&gt;+152&lt;/td&gt;
&lt;td&gt;+144&lt;/td&gt;
&lt;td&gt;+1,026&lt;/td&gt;
&lt;td&gt;+1,044&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;89% of the profit came in 2025 and 2026. Trades before the author published version 2.0 (9 January 2023) made PF 0.97 on gold H4. After, 1.76.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Random timing.&lt;/strong&gt; I slid the strategy's own long/short sequence to a random point in time, 200 times, keeping trade lengths. Gold beat 90–97% of the shifted copies depending on timeframe, and USDJPY H1 95.5%. That sounds good. But I tested 70 market/timeframe cells, and a few will look like that by chance. Nothing else came close.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Older data.&lt;/strong&gt; This one settles it. Dukascopy gold, 2004 to 2019, with spread, commission and swap:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.jsdelivr.net%2Fgh%2Ftruongxxxx%2Fmoonthetrain-assets%40main%2Fimages%2Fb083815f87d7-at_gold_2004_2026.png%231500x990" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.jsdelivr.net%2Fgh%2Ftruongxxxx%2Fmoonthetrain-assets%40main%2Fimages%2Fb083815f87d7-at_gold_2004_2026.png%231500x990" alt="AlphaTrend on gold H4 from 2004 to 2026, gold price on a log scale above, cumulative percent per trade below for long only and long plus short, 2004 to 2019 shaded, Dukascopy M1 data with file spread, commission and long swap scaled to price" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Profit factor&lt;/th&gt;
&lt;th&gt;2004–2019&lt;/th&gt;
&lt;th&gt;2020–2026&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Gold H1, long + short&lt;/td&gt;
&lt;td&gt;1.01&lt;/td&gt;
&lt;td&gt;1.12&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gold H4, long + short&lt;/td&gt;
&lt;td&gt;1.03&lt;/td&gt;
&lt;td&gt;1.27&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gold H4, long only&lt;/td&gt;
&lt;td&gt;1.23&lt;/td&gt;
&lt;td&gt;1.78&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;USDJPY H1, long + short&lt;/td&gt;
&lt;td&gt;0.98&lt;/td&gt;
&lt;td&gt;1.14&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EURUSD / GBPUSD / NZDUSD H1&lt;/td&gt;
&lt;td&gt;0.95 / 1.01 / 0.98&lt;/td&gt;
&lt;td&gt;0.96 / 0.89 / 0.86&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Over those 16 years gold H4 long + short made +15% of price. Gold itself made +266%. Long only made +64%, and nearly all of it before 2012. After that, gold drifted down and sideways until 2019, and AlphaTrend gave some back.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it costs to hold gold longs
&lt;/h2&gt;

&lt;p&gt;Swap matters on a system that sits long for days. With Exness Raw long swap scaled to the gold price at the time, gold H4 drops from PF 1.47 to 1.38, H1 from 1.22 to 1.18. Long only on H4 goes from 2.08 to 1.85. About 17% of the profit goes to swap, and closer to 28% if you charge today's swap rate on every year.&lt;/p&gt;

&lt;h2&gt;
  
  
  Risk structure
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No stop loss.&lt;/strong&gt; A position only closes on the opposite signal. The line itself is the obvious place for a stop, but the script doesn't use it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Win rate 39% on gold H4&lt;/strong&gt;, 37% on H1. The longest losing streak on gold H4 was 7 trades.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The ten worst gold H4 trades&lt;/strong&gt; (long + short, USD per 0.01 lot, before swap). Seven of them opened in 2026, when gold moved 100+ USD in a day:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Entry&lt;/th&gt;
&lt;th&gt;Exit&lt;/th&gt;
&lt;th&gt;Side&lt;/th&gt;
&lt;th&gt;Entry → exit price&lt;/th&gt;
&lt;th&gt;Loss&lt;/th&gt;
&lt;th&gt;Worst point against&lt;/th&gt;
&lt;th&gt;Held&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;9 Feb 2026 20:00&lt;/td&gt;
&lt;td&gt;17 Feb 16:00&lt;/td&gt;
&lt;td&gt;Buy&lt;/td&gt;
&lt;td&gt;5,074.8 → 4,878.4&lt;/td&gt;
&lt;td&gt;−196.4&lt;/td&gt;
&lt;td&gt;233.6&lt;/td&gt;
&lt;td&gt;188 h&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;19 Aug 2026 00:00&lt;/td&gt;
&lt;td&gt;19 Aug 20:00&lt;/td&gt;
&lt;td&gt;Sell&lt;/td&gt;
&lt;td&gt;4,333.1 → 4,511.2&lt;/td&gt;
&lt;td&gt;−178.2&lt;/td&gt;
&lt;td&gt;194.6&lt;/td&gt;
&lt;td&gt;20 h&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;17 Feb 2026 16:00&lt;/td&gt;
&lt;td&gt;20 Feb 00:00&lt;/td&gt;
&lt;td&gt;Sell&lt;/td&gt;
&lt;td&gt;4,878.4 → 4,988.0&lt;/td&gt;
&lt;td&gt;−109.6&lt;/td&gt;
&lt;td&gt;144.0&lt;/td&gt;
&lt;td&gt;56 h&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;18 Sep 2026 12:00&lt;/td&gt;
&lt;td&gt;23 Sep 20:00&lt;/td&gt;
&lt;td&gt;Buy&lt;/td&gt;
&lt;td&gt;4,381.4 → 4,284.1&lt;/td&gt;
&lt;td&gt;−97.4&lt;/td&gt;
&lt;td&gt;106.8&lt;/td&gt;
&lt;td&gt;128 h&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;29 May 2026 12:00&lt;/td&gt;
&lt;td&gt;3 Jun 20:00&lt;/td&gt;
&lt;td&gt;Buy&lt;/td&gt;
&lt;td&gt;4,538.5 → 4,444.0&lt;/td&gt;
&lt;td&gt;−94.5&lt;/td&gt;
&lt;td&gt;114.7&lt;/td&gt;
&lt;td&gt;128 h&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2 Jul 2026 20:00&lt;/td&gt;
&lt;td&gt;8 Jul 16:00&lt;/td&gt;
&lt;td&gt;Buy&lt;/td&gt;
&lt;td&gt;4,121.5 → 4,034.2&lt;/td&gt;
&lt;td&gt;−87.3&lt;/td&gt;
&lt;td&gt;99.8&lt;/td&gt;
&lt;td&gt;140 h&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;27 May 2025 12:00&lt;/td&gt;
&lt;td&gt;2 Jun 16:00&lt;/td&gt;
&lt;td&gt;Sell&lt;/td&gt;
&lt;td&gt;3,288.5 → 3,374.4&lt;/td&gt;
&lt;td&gt;−86.0&lt;/td&gt;
&lt;td&gt;93.9&lt;/td&gt;
&lt;td&gt;148 h&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;29 Dec 2025 20:00&lt;/td&gt;
&lt;td&gt;5 Jan 08:00&lt;/td&gt;
&lt;td&gt;Sell&lt;/td&gt;
&lt;td&gt;4,337.1 → 4,422.0&lt;/td&gt;
&lt;td&gt;−85.0&lt;/td&gt;
&lt;td&gt;103.0&lt;/td&gt;
&lt;td&gt;156 h&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3 Sep 2026 12:00&lt;/td&gt;
&lt;td&gt;8 Sep 20:00&lt;/td&gt;
&lt;td&gt;Buy&lt;/td&gt;
&lt;td&gt;4,444.1 → 4,359.6&lt;/td&gt;
&lt;td&gt;−84.6&lt;/td&gt;
&lt;td&gt;98.8&lt;/td&gt;
&lt;td&gt;128 h&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2 Feb 2023 00:00&lt;/td&gt;
&lt;td&gt;3 Feb 16:00&lt;/td&gt;
&lt;td&gt;Buy&lt;/td&gt;
&lt;td&gt;1,953.1 → 1,873.1&lt;/td&gt;
&lt;td&gt;−80.1&lt;/td&gt;
&lt;td&gt;91.7&lt;/td&gt;
&lt;td&gt;40 h&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;At today's gold prices one bad H4 trade costs 100–200 USD per 0.01 lot. Size for that.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No martingale, no grid, no averaging down.&lt;/strong&gt; One position at a time.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Who should use it?
&lt;/h2&gt;

&lt;p&gt;If you trade gold, yen or indices and want a mechanical trend filter, AlphaTrend works as one. The line gives you a level to be wrong at, it doesn't repaint after the close, and the signal is nearly the same on any broker's feed. On H1 to H4, long side only, it stayed with gold's rise at a smaller drawdown than holding.&lt;/p&gt;

&lt;p&gt;Don't run the strategy script as a two-way system on forex majors, and don't count on the short side. And don't pick D1 because of the PF in the table.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I couldn't verify
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TradingView's own report.&lt;/strong&gt; My numbers come from my port, not TradingView's tester.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Forex swap.&lt;/strong&gt; Not included for USDJPY or the other pairs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live fills.&lt;/strong&gt; These are bar-open fills with real spread, not live execution. On H1 and H4 a few seconds of delay matters little, but I haven't measured it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Markets outside these seven.&lt;/strong&gt; I didn't test crypto other than Bitcoin, stocks, or exotic pairs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Bottom line
&lt;/h2&gt;

&lt;p&gt;The TradingView AlphaTrend strategy doesn't repaint after the close, and with default settings it lost on every forex major from M5 to H4. On gold, yen, the S&amp;amp;P and Bitcoin it made money, nearly all of it from the long side, and on gold about as much as holding. What it does well is ratchet in one direction while the trend holds, which makes it a trailing level and trend filter more than a strategy. Its MFI filter gives almost the same signals with or without volume.&lt;/p&gt;

&lt;p&gt;This is part of a series where I port the most-boosted open-source TradingView strategies and test them on broker ticks with real costs. For one that held on 16 years of unseen gold data, see the &lt;a href="https://moonthetrain.com/lab/tradingview-super-scalper-strategy-backtest" rel="noopener noreferrer"&gt;Super Scalper backtest&lt;/a&gt;. For another Kıvanç Özbilgiç script with the same long-side pattern on gold, see the &lt;a href="https://moonthetrain.com/lab/tradingview-pmax-strategy-backtest" rel="noopener noreferrer"&gt;PMax backtest&lt;/a&gt; and the &lt;a href="https://moonthetrain.com/lab/tradingview-supertrend-strategy-backtest" rel="noopener noreferrer"&gt;SuperTrend backtest&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I sell an MT4/MT5 port of the AlphaTrend indicator. I'm not affiliated with TradingView or KivancOzbilgic. Past results, including backtests, don't guarantee future results.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>backtesting</category>
      <category>trading</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>TradingView Super Scalper Strategy: Best Settings, Backtest</title>
      <dc:creator>Truong Pham | Moon The Train</dc:creator>
      <pubDate>Fri, 20 Nov 2026 08:39:30 +0000</pubDate>
      <link>https://dev.to/moonthetrain/tradingview-super-scalper-strategy-best-settings-backtest-2jpn</link>
      <guid>https://dev.to/moonthetrain/tradingview-super-scalper-strategy-best-settings-backtest-2jpn</guid>
      <description>&lt;p&gt;&lt;strong&gt;The short version.&lt;/strong&gt; This is a TradingView Super Scalper strategy backtest. VinayKumarKV's "Super Scalper - 5 Min 15 Min" has about 7,400 boosts. I ported it to Python and ran it on Exness tick data for seven markets, with real spread and commission, from January 2020 to September 2026.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;As a scalper, it loses.&lt;/strong&gt; On M5 and M15, the two timeframes in its name, none of the 14 market/timeframe cells got above PF 1.01 after costs with the default long + short setting. Gold M15: PF 0.95, 4,753 trades, −1,354 USD per 0.01 lot.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Put the same code on H1 and it's the steadiest result I've had in this series.&lt;/strong&gt; Gold H1: PF 1.31, +3,409 USD per 0.01 lot, 1,116 trades, 778 max drawdown. After swap, PF 1.27. Buy and hold made +2,588, with a drawdown of 1,600.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It held on data I never looked at.&lt;/strong&gt; On Dukascopy gold from 2004 to 2019, the same H1 setup made PF 1.10 after swap, and it beat 99.5% of randomly shifted copies of itself.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;USDJPY M30 and H1 also worked&lt;/strong&gt; (PF 1.11 and 1.18). EURUSD, GBPUSD and NZDUSD lost.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The stop loss and take profit in the code are never used&lt;/strong&gt;, and neither is the golden cross. The part doing the work is a double RSI filter.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My verdict: don't use it to scalp. On gold H1 with the default settings it's the one I'd keep watching. The edge is thin, though, and it swings hard: one year −39%, another +54%.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the Super Scalper strategy on TradingView?
&lt;/h2&gt;

&lt;p&gt;It's an &lt;a href="https://www.tradingview.com/script/4ORGCiTh-Super-Scalper-5-Min-15-Min/" rel="noopener noreferrer"&gt;open-source strategy&lt;/a&gt; published on 22 March 2022, shown on a NIFTY 5-minute chart. The author's description says it "works better in 5 and 15 Mins time frame", suggests backtesting with 1:2 reward to risk, and says to use other alerts to take profit or trail the stop. The current version (19 May 2022) switched from one RSI to two "to increase the profitable percentage."&lt;/p&gt;

&lt;p&gt;Here's the part of the code that trades:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;atr_slen   = ta.wma(ta.tr(true), 14)        // "ATR Smoothing" = WMA by default
upper_band = atr_slen * 1 + close
lower_band = close - atr_slen * 1

longCondition  = open &amp;lt; lower_band
shortCondition = open &amp;gt; upper_band
RSILong  = ta.rsi(close, 25) &amp;gt; ta.rsi(close, 100)
RSIShort = ta.rsi(close, 25) &amp;lt; ta.rsi(close, 100)

if (longCondition)
    stopLoss   = low - atr * 2
    takeProfit = high + atr * 5
    strategy.entry("long", strategy.long, when = RSILong)
if (shortCondition)
    stopLoss   = high + atr * 2
    takeProfit = low - atr * 5
    strategy.entry("short", strategy.short, when = RSIShort)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three things about this aren't obvious from the chart.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Open below the lower band" means a big green candle.&lt;/strong&gt; The bands are built from the close of the &lt;em&gt;same&lt;/em&gt; bar. So &lt;code&gt;open &amp;lt; close − ATR&lt;/code&gt; is just &lt;code&gt;close − open &amp;gt; ATR&lt;/code&gt;: the candle closed up by more than its average range. The "Buy" label looks like buying a dip under a band. It's actually buying after a strong up bar. That's momentum, not mean reversion.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The stop loss and take profit do nothing.&lt;/strong&gt; &lt;code&gt;stopLoss&lt;/code&gt; and &lt;code&gt;takeProfit&lt;/code&gt; are calculated and never passed to &lt;code&gt;strategy.exit&lt;/code&gt;. The only exit is the opposite signal, so it's a stop-and-reverse system that's in the market about 98% of the time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The golden cross is decoration.&lt;/strong&gt; EMA 21 and 65 crosses get labels on the chart and never touch an order. To be fair, the author says so in the release notes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnla2h0e5xsbwzwdkwgpy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnla2h0e5xsbwzwdkwgpy.png" alt="Super Scalper on XAUUSD H1, 29 September to 22 October 2025: candles with filled bodies where the body is larger than the WMA of true range, buy and sell arrows, green background while long and red while short, RSI 25 and RSI 100 below, Exness tick data" width="800" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's a typical stretch on gold H1. The longs carried most of the rally from 3,800 to 4,350, the short flips in between mostly cost a little, and the last sell on 21 October caught the start of the drop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does Super Scalper repaint?
&lt;/h2&gt;

&lt;p&gt;No. Everything uses the bar's own open and close plus past bars. The signal is final on the bar close, and I fill it at the next bar's open, the same as TradingView's tester with default settings.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I tested it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Port:&lt;/strong&gt; Python, signals on the close, fills at the next open, stop-and-reverse like &lt;code&gt;strategy.entry&lt;/code&gt;. Default settings: WMA of true range 14, multiplier 1, RSI 25 and 100.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data:&lt;/strong&gt; Exness Raw Spread ticks for XAUUSD, USDJPY, EURUSD, GBPUSD, NZDUSD and US500 from January 2020 to September 2026 (US500 to August), BTCUSD from January 2024.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Costs:&lt;/strong&gt; buys fill at the real ask on the bar's first tick, sells at the bid, plus 3.5 USD per lot per side for forex and gold.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Swap:&lt;/strong&gt; included for gold (Exness Raw rates, scaled to the gold price at the time). Not included for the others.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Older data:&lt;/strong&gt; Dukascopy M1 via Tickstory, 2004 to 2026, for gold, USDJPY, EURUSD, GBPUSD, NZDUSD and the S&amp;amp;P 500.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Size:&lt;/strong&gt; fixed, no compounding. Gold in USD per 0.01 lot (1 oz), forex in pips per lot, US500 in index points, Bitcoin in USD per 1 BTC.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The results
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa03qc60uiuk0qo1tvlak.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa03qc60uiuk0qo1tvlak.png" alt="Super Scalper profit factor after costs by market and timeframe, long plus short and long only, XAUUSD USDJPY EURUSD GBPUSD NZDUSD US500 BTCUSD, M5 to H4, with trade counts, Exness Raw Spread ticks 2020 to 2026" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;XAUUSD, Jan 2020 – Sep 2026, before swap.&lt;/strong&gt; Buy and hold: +2,588, max drawdown 1,600.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timeframe&lt;/th&gt;
&lt;th&gt;Trades&lt;/th&gt;
&lt;th&gt;PF&lt;/th&gt;
&lt;th&gt;Net&lt;/th&gt;
&lt;th&gt;Max DD&lt;/th&gt;
&lt;th&gt;Win rate&lt;/th&gt;
&lt;th&gt;Long net&lt;/th&gt;
&lt;th&gt;Short net&lt;/th&gt;
&lt;th&gt;Long only: PF / net / DD&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;M5&lt;/td&gt;
&lt;td&gt;14,490&lt;/td&gt;
&lt;td&gt;0.93&lt;/td&gt;
&lt;td&gt;−3,010&lt;/td&gt;
&lt;td&gt;4,081&lt;/td&gt;
&lt;td&gt;30%&lt;/td&gt;
&lt;td&gt;−212&lt;/td&gt;
&lt;td&gt;−2,798&lt;/td&gt;
&lt;td&gt;0.99 / −212 / 1,467&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M15&lt;/td&gt;
&lt;td&gt;4,753&lt;/td&gt;
&lt;td&gt;0.95&lt;/td&gt;
&lt;td&gt;−1,354&lt;/td&gt;
&lt;td&gt;2,057&lt;/td&gt;
&lt;td&gt;31%&lt;/td&gt;
&lt;td&gt;+612&lt;/td&gt;
&lt;td&gt;−1,966&lt;/td&gt;
&lt;td&gt;1.05 / +612 / 1,022&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M30&lt;/td&gt;
&lt;td&gt;2,266&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.23&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;+3,746&lt;/td&gt;
&lt;td&gt;589&lt;/td&gt;
&lt;td&gt;34%&lt;/td&gt;
&lt;td&gt;+3,166&lt;/td&gt;
&lt;td&gt;+579&lt;/td&gt;
&lt;td&gt;1.42 / +3,166 / 532&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;H1&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1,116&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.31&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+3,409&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;778&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;35%&lt;/td&gt;
&lt;td&gt;+2,999&lt;/td&gt;
&lt;td&gt;+411&lt;/td&gt;
&lt;td&gt;1.60 / +2,999 / 532&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;H4&lt;/td&gt;
&lt;td&gt;329&lt;/td&gt;
&lt;td&gt;1.16&lt;/td&gt;
&lt;td&gt;+982&lt;/td&gt;
&lt;td&gt;1,016&lt;/td&gt;
&lt;td&gt;35%&lt;/td&gt;
&lt;td&gt;+1,802&lt;/td&gt;
&lt;td&gt;−819&lt;/td&gt;
&lt;td&gt;1.79 / +1,802 / 846&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;USD per 0.01 lot. With swap: M30 1.21, H1 1.27 (+3,016), H1 long only 1.51.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;USDJPY, Jan 2020 – Sep 2026.&lt;/strong&gt; Buy and hold: +4,845 pips.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timeframe&lt;/th&gt;
&lt;th&gt;Trades&lt;/th&gt;
&lt;th&gt;PF&lt;/th&gt;
&lt;th&gt;Net&lt;/th&gt;
&lt;th&gt;Max DD&lt;/th&gt;
&lt;th&gt;Win rate&lt;/th&gt;
&lt;th&gt;Long net&lt;/th&gt;
&lt;th&gt;Short net&lt;/th&gt;
&lt;th&gt;Long only: PF / net / DD&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;M5&lt;/td&gt;
&lt;td&gt;15,549&lt;/td&gt;
&lt;td&gt;0.83&lt;/td&gt;
&lt;td&gt;−22,503&lt;/td&gt;
&lt;td&gt;22,807&lt;/td&gt;
&lt;td&gt;28%&lt;/td&gt;
&lt;td&gt;−8,832&lt;/td&gt;
&lt;td&gt;−13,671&lt;/td&gt;
&lt;td&gt;0.86 / −8,832 / 9,044&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M15&lt;/td&gt;
&lt;td&gt;4,871&lt;/td&gt;
&lt;td&gt;1.00&lt;/td&gt;
&lt;td&gt;+193&lt;/td&gt;
&lt;td&gt;2,499&lt;/td&gt;
&lt;td&gt;31%&lt;/td&gt;
&lt;td&gt;+2,521&lt;/td&gt;
&lt;td&gt;−2,328&lt;/td&gt;
&lt;td&gt;1.08 / +2,521 / 1,552&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M30&lt;/td&gt;
&lt;td&gt;2,334&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.11&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;+5,343&lt;/td&gt;
&lt;td&gt;1,493&lt;/td&gt;
&lt;td&gt;34%&lt;/td&gt;
&lt;td&gt;+5,104&lt;/td&gt;
&lt;td&gt;+239&lt;/td&gt;
&lt;td&gt;1.24 / +5,104 / 950&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;H1&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1,153&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.18&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+5,817&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;1,923&lt;/td&gt;
&lt;td&gt;35%&lt;/td&gt;
&lt;td&gt;+5,298&lt;/td&gt;
&lt;td&gt;+519&lt;/td&gt;
&lt;td&gt;1.37 / +5,298 / 1,553&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;H4&lt;/td&gt;
&lt;td&gt;332&lt;/td&gt;
&lt;td&gt;0.74&lt;/td&gt;
&lt;td&gt;−5,925&lt;/td&gt;
&lt;td&gt;7,500&lt;/td&gt;
&lt;td&gt;27%&lt;/td&gt;
&lt;td&gt;−429&lt;/td&gt;
&lt;td&gt;−5,496&lt;/td&gt;
&lt;td&gt;0.96 / −429 / 2,900&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Pips per lot, swap not included.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The other five markets, long + short:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Market&lt;/th&gt;
&lt;th&gt;Timeframe&lt;/th&gt;
&lt;th&gt;Trades&lt;/th&gt;
&lt;th&gt;PF&lt;/th&gt;
&lt;th&gt;Net&lt;/th&gt;
&lt;th&gt;Max DD&lt;/th&gt;
&lt;th&gt;Long only PF / net&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;EURUSD&lt;/td&gt;
&lt;td&gt;M5&lt;/td&gt;
&lt;td&gt;16,260&lt;/td&gt;
&lt;td&gt;0.80&lt;/td&gt;
&lt;td&gt;−19,131&lt;/td&gt;
&lt;td&gt;19,182&lt;/td&gt;
&lt;td&gt;0.80 / −9,404&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;M15&lt;/td&gt;
&lt;td&gt;5,136&lt;/td&gt;
&lt;td&gt;0.88&lt;/td&gt;
&lt;td&gt;−6,587&lt;/td&gt;
&lt;td&gt;6,673&lt;/td&gt;
&lt;td&gt;0.88 / −3,146&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;M30&lt;/td&gt;
&lt;td&gt;2,604&lt;/td&gt;
&lt;td&gt;0.91&lt;/td&gt;
&lt;td&gt;−3,325&lt;/td&gt;
&lt;td&gt;4,753&lt;/td&gt;
&lt;td&gt;0.92 / −1,525&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;H1&lt;/td&gt;
&lt;td&gt;1,342&lt;/td&gt;
&lt;td&gt;1.00&lt;/td&gt;
&lt;td&gt;−95&lt;/td&gt;
&lt;td&gt;3,023&lt;/td&gt;
&lt;td&gt;1.01 / +150&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;H4&lt;/td&gt;
&lt;td&gt;325&lt;/td&gt;
&lt;td&gt;0.83&lt;/td&gt;
&lt;td&gt;−2,249&lt;/td&gt;
&lt;td&gt;4,068&lt;/td&gt;
&lt;td&gt;0.85 / −967&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GBPUSD&lt;/td&gt;
&lt;td&gt;M5&lt;/td&gt;
&lt;td&gt;16,159&lt;/td&gt;
&lt;td&gt;0.80&lt;/td&gt;
&lt;td&gt;−24,697&lt;/td&gt;
&lt;td&gt;25,398&lt;/td&gt;
&lt;td&gt;0.80 / −12,239&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;M15&lt;/td&gt;
&lt;td&gt;5,218&lt;/td&gt;
&lt;td&gt;0.86&lt;/td&gt;
&lt;td&gt;−10,229&lt;/td&gt;
&lt;td&gt;10,548&lt;/td&gt;
&lt;td&gt;0.86 / −5,046&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;M30&lt;/td&gt;
&lt;td&gt;2,591&lt;/td&gt;
&lt;td&gt;0.86&lt;/td&gt;
&lt;td&gt;−7,186&lt;/td&gt;
&lt;td&gt;9,323&lt;/td&gt;
&lt;td&gt;0.86 / −3,471&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;H1&lt;/td&gt;
&lt;td&gt;1,346&lt;/td&gt;
&lt;td&gt;0.92&lt;/td&gt;
&lt;td&gt;−2,892&lt;/td&gt;
&lt;td&gt;6,711&lt;/td&gt;
&lt;td&gt;0.92 / −1,282&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;H4&lt;/td&gt;
&lt;td&gt;351&lt;/td&gt;
&lt;td&gt;0.79&lt;/td&gt;
&lt;td&gt;−3,995&lt;/td&gt;
&lt;td&gt;6,375&lt;/td&gt;
&lt;td&gt;0.84 / −1,581&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NZDUSD&lt;/td&gt;
&lt;td&gt;M5&lt;/td&gt;
&lt;td&gt;17,417&lt;/td&gt;
&lt;td&gt;0.66&lt;/td&gt;
&lt;td&gt;−30,819&lt;/td&gt;
&lt;td&gt;30,981&lt;/td&gt;
&lt;td&gt;0.66 / −15,812&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;M15&lt;/td&gt;
&lt;td&gt;5,268&lt;/td&gt;
&lt;td&gt;0.79&lt;/td&gt;
&lt;td&gt;−9,935&lt;/td&gt;
&lt;td&gt;10,221&lt;/td&gt;
&lt;td&gt;0.77 / −5,353&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;M30&lt;/td&gt;
&lt;td&gt;2,606&lt;/td&gt;
&lt;td&gt;0.84&lt;/td&gt;
&lt;td&gt;−5,062&lt;/td&gt;
&lt;td&gt;5,601&lt;/td&gt;
&lt;td&gt;0.82 / −2,908&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;H1&lt;/td&gt;
&lt;td&gt;1,243&lt;/td&gt;
&lt;td&gt;0.92&lt;/td&gt;
&lt;td&gt;−1,728&lt;/td&gt;
&lt;td&gt;3,069&lt;/td&gt;
&lt;td&gt;0.89 / −1,195&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;H4&lt;/td&gt;
&lt;td&gt;277&lt;/td&gt;
&lt;td&gt;1.11&lt;/td&gt;
&lt;td&gt;+1,037&lt;/td&gt;
&lt;td&gt;1,177&lt;/td&gt;
&lt;td&gt;1.08 / +352&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;US500&lt;/td&gt;
&lt;td&gt;M5&lt;/td&gt;
&lt;td&gt;14,300&lt;/td&gt;
&lt;td&gt;0.98&lt;/td&gt;
&lt;td&gt;−1,784&lt;/td&gt;
&lt;td&gt;3,788&lt;/td&gt;
&lt;td&gt;1.04 / +1,315&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;M15&lt;/td&gt;
&lt;td&gt;4,693&lt;/td&gt;
&lt;td&gt;0.97&lt;/td&gt;
&lt;td&gt;−1,456&lt;/td&gt;
&lt;td&gt;3,355&lt;/td&gt;
&lt;td&gt;1.07 / +1,481&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;M30&lt;/td&gt;
&lt;td&gt;2,258&lt;/td&gt;
&lt;td&gt;0.97&lt;/td&gt;
&lt;td&gt;−1,026&lt;/td&gt;
&lt;td&gt;2,236&lt;/td&gt;
&lt;td&gt;1.12 / +1,691&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;H1&lt;/td&gt;
&lt;td&gt;1,216&lt;/td&gt;
&lt;td&gt;1.01&lt;/td&gt;
&lt;td&gt;+217&lt;/td&gt;
&lt;td&gt;2,067&lt;/td&gt;
&lt;td&gt;1.21 / +2,277&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;H4&lt;/td&gt;
&lt;td&gt;314&lt;/td&gt;
&lt;td&gt;0.96&lt;/td&gt;
&lt;td&gt;−477&lt;/td&gt;
&lt;td&gt;2,408&lt;/td&gt;
&lt;td&gt;1.53 / +2,260&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BTCUSD*&lt;/td&gt;
&lt;td&gt;M5&lt;/td&gt;
&lt;td&gt;7,706&lt;/td&gt;
&lt;td&gt;0.93&lt;/td&gt;
&lt;td&gt;−116,995&lt;/td&gt;
&lt;td&gt;124,451&lt;/td&gt;
&lt;td&gt;0.95 / −38,110&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;M15&lt;/td&gt;
&lt;td&gt;2,565&lt;/td&gt;
&lt;td&gt;0.97&lt;/td&gt;
&lt;td&gt;−31,183&lt;/td&gt;
&lt;td&gt;70,453&lt;/td&gt;
&lt;td&gt;1.01 / +3,607&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;M30&lt;/td&gt;
&lt;td&gt;1,264&lt;/td&gt;
&lt;td&gt;0.99&lt;/td&gt;
&lt;td&gt;−4,798&lt;/td&gt;
&lt;td&gt;71,587&lt;/td&gt;
&lt;td&gt;1.05 / +17,547&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;H1&lt;/td&gt;
&lt;td&gt;653&lt;/td&gt;
&lt;td&gt;1.03&lt;/td&gt;
&lt;td&gt;+12,462&lt;/td&gt;
&lt;td&gt;46,893&lt;/td&gt;
&lt;td&gt;1.10 / +24,584&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;H4&lt;/td&gt;
&lt;td&gt;171&lt;/td&gt;
&lt;td&gt;1.02&lt;/td&gt;
&lt;td&gt;+5,525&lt;/td&gt;
&lt;td&gt;88,666&lt;/td&gt;
&lt;td&gt;1.21 / +23,228&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Forex in pips per lot, US500 in index points, BTCUSD in USD per 1 BTC (*January 2024 – September 2026). Buy and hold: EURUSD +305, GBPUSD +215, NZDUSD −820, US500 +4,425, BTCUSD +41,200. No swap.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The long-only column on US500 and Bitcoin looks fine until you compare it with buy and hold: US500 H4 long only made +2,260 points, holding the index made +4,425. That's an index going up, not the strategy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0mbm5p21oe53g4hzbuga.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0mbm5p21oe53g4hzbuga.png" alt="Super Scalper equity on XAUUSD and USDJPY, H1 and M15 long plus short versus buy and hold, January 2020 to September 2026, Exness Raw Spread ticks, spread and commission included, swap not included" width="800" height="364"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why does a "5 Min 15 Min" scalper only work on H1?
&lt;/h2&gt;

&lt;p&gt;I expected the answer to be spread. It's only part of it. On gold M15 the average trade loses 0.12 USD per 0.01 lot &lt;em&gt;before&lt;/em&gt; costs, and spread plus commission add another 0.16. So the signal itself has nothing on M15, and costs just make it worse.&lt;/p&gt;

&lt;p&gt;On H1 the average trade makes +3.21 before costs. Costs are still about 0.16, which barely dents it.&lt;/p&gt;

&lt;p&gt;The difference is the RSI filter. On M15 it barely helps (gold goes from 0.88 without it to 0.95 with it, still losing). On H1 it's most of the edge. More on that below.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is the gold H1 result real?
&lt;/h2&gt;

&lt;p&gt;I tried to break it four ways, and it held each time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Random timing test.&lt;/strong&gt; I took the strategy's own long/short sequence, slid it to a random point in time, and kept every trade's length. 200 times. Gold H1 beat 98.5% of the shifted copies (p = 0.015), gold M30 99.5%. USDJPY M30 and H1 passed too. Gold M15, gold H4, every other forex pair, US500 and Bitcoin didn't.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Moving the candle open.&lt;/strong&gt; H1 candles normally start on the hour. Starting them at :15, :30 or :45 instead gave PF 1.12 to 1.13. Lower than 1.31, still positive. Gold M30 fell to 1.04–1.05 when I did the same, so I trust H1 more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Settings.&lt;/strong&gt; 60 combinations of ATR length (7 to 28), multiplier (0.6 to 1.5) and RSI pairs (14/50, 25/100, 50/200): 56 of 60 had PF above 1 on gold H1, and 70% were profitable in both halves of the period.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Older data.&lt;/strong&gt; This is the one that matters. I picked "gold H1" by looking at 2020–2026, so I went back to Dukascopy gold from 2004 to 2019:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyf2uwuj2eia3nm0fqww8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyf2uwuj2eia3nm0fqww8.png" alt="Super Scalper on gold from 2004 to 2026, gold price on a log scale above, cumulative percent per trade below for H1 and M15 long plus short, 2004 to 2019 shaded, Dukascopy M1 data with file spread and long swap scaled to price" width="800" height="528"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Gold, long + short&lt;/th&gt;
&lt;th&gt;2004–2019 PF (after swap)&lt;/th&gt;
&lt;th&gt;2020–2026 PF&lt;/th&gt;
&lt;th&gt;Random timing test, 2004–2019&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;M15&lt;/td&gt;
&lt;td&gt;0.90&lt;/td&gt;
&lt;td&gt;0.91&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M30&lt;/td&gt;
&lt;td&gt;0.97&lt;/td&gt;
&lt;td&gt;1.16&lt;/td&gt;
&lt;td&gt;beats 96%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;H1&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;1.10&lt;/strong&gt; (+85% of price, 2,577 trades)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.27&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;beats 99.5%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;H4&lt;/td&gt;
&lt;td&gt;0.98&lt;/td&gt;
&lt;td&gt;1.04&lt;/td&gt;
&lt;td&gt;beats 89.5%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Gold H1 kept its edge for 16 years the backtest never saw. M15 lost almost the entire 22 years. USDJPY did the same on old data: M30 PF 1.05 and H1 1.11 from 2004 to 2019, both beating 97% of random copies.&lt;/p&gt;

&lt;p&gt;It also held after the author published the current version. On Exness gold H1, trades before 19 May 2022 made PF 1.46 (354 trades) and trades after made 1.27 (762 trades). USDJPY H1 went from 1.28 to 1.16.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are the best Super Scalper settings?
&lt;/h2&gt;

&lt;p&gt;The defaults, on H1. A March 2022 update added the choice of RMA, SMA, EMA or WMA smoothing and told people to "select a moving average which is giving highest profits." It doesn't matter much: on gold H1 all four gave PF 1.24 to 1.31, on USDJPY H1 1.16 to 1.22. Picking whichever did best on your chart is just fitting noise.&lt;/p&gt;

&lt;p&gt;Then I took each layer away to see which one matters:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx60cpqmj2pnrp9m0c198.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx60cpqmj2pnrp9m0c198.png" alt="Super Scalper profit factor on XAUUSD and USDJPY M15, M30 and H1: the script as written, without the RSI filter, and with the unused 2 ATR stop and 5 ATR target switched on, Exness Raw Spread ticks 2020 to 2026, long plus short" width="800" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Remove the double RSI filter&lt;/strong&gt; and gold H1 drops from 1.31 to 1.01. Gold M30 drops from 1.23 to 0.97. The big-candle rule on its own is roughly break-even.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Switch on the stop and target the author calculated&lt;/strong&gt; (2 ATR beyond the signal candle, target 5 ATR) and gold H1 drops to 1.16, USDJPY H1 to 1.15. On M15 it doesn't rescue anything. I checked those exits minute by minute.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the 2022 change to a double RSI really did make it better, at least on gold and yen. The stop-loss code would make it worse if anyone wired it up.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gold H1 by year
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Exness gold H1&lt;/th&gt;
&lt;th&gt;2020&lt;/th&gt;
&lt;th&gt;2021&lt;/th&gt;
&lt;th&gt;2022&lt;/th&gt;
&lt;th&gt;2023&lt;/th&gt;
&lt;th&gt;2024&lt;/th&gt;
&lt;th&gt;2025&lt;/th&gt;
&lt;th&gt;2026 (to Sep)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Trades&lt;/td&gt;
&lt;td&gt;123&lt;/td&gt;
&lt;td&gt;170&lt;/td&gt;
&lt;td&gt;172&lt;/td&gt;
&lt;td&gt;201&lt;/td&gt;
&lt;td&gt;175&lt;/td&gt;
&lt;td&gt;157&lt;/td&gt;
&lt;td&gt;118&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PF&lt;/td&gt;
&lt;td&gt;1.69&lt;/td&gt;
&lt;td&gt;1.24&lt;/td&gt;
&lt;td&gt;1.00&lt;/td&gt;
&lt;td&gt;0.83&lt;/td&gt;
&lt;td&gt;1.32&lt;/td&gt;
&lt;td&gt;1.63&lt;/td&gt;
&lt;td&gt;1.32&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Net&lt;/td&gt;
&lt;td&gt;+611&lt;/td&gt;
&lt;td&gt;+227&lt;/td&gt;
&lt;td&gt;+4&lt;/td&gt;
&lt;td&gt;−227&lt;/td&gt;
&lt;td&gt;+407&lt;/td&gt;
&lt;td&gt;+1,284&lt;/td&gt;
&lt;td&gt;+1,103&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Less lopsided than most of this series (MACD ReLoaded made 75% of its gold profit in 2026 alone). Still, 2022–2023 went nowhere. Over 2004–2026 on Dukascopy, H1 was positive in 14 of 23 years, with swings from −39% of price (2006) to +54% (2008). In 2013, when gold fell 28%, it made +29%, almost all of it from shorts (+30.5% short, −1.5% long). A short side that pays its way is rare in these tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Risk structure
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No stop loss.&lt;/strong&gt; A position only closes on the opposite signal. A wrong-way trade can run for days.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Win rate is low:&lt;/strong&gt; 35% on gold H1. Profits come from a few long rides.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The ten worst gold H1 trades&lt;/strong&gt; were all in 2026, when gold moved 100+ USD in a day. USD per 0.01 lot, before swap:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Entry&lt;/th&gt;
&lt;th&gt;Exit&lt;/th&gt;
&lt;th&gt;Side&lt;/th&gt;
&lt;th&gt;Entry → exit price&lt;/th&gt;
&lt;th&gt;Loss&lt;/th&gt;
&lt;th&gt;Held&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;23 Jan 2026 09:00&lt;/td&gt;
&lt;td&gt;26 Jan 15:00&lt;/td&gt;
&lt;td&gt;Sell&lt;/td&gt;
&lt;td&gt;4,913.9 → 5,096.4&lt;/td&gt;
&lt;td&gt;−182.58&lt;/td&gt;
&lt;td&gt;78 h&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2 Jun 2026 05:00&lt;/td&gt;
&lt;td&gt;5 Jun 13:00&lt;/td&gt;
&lt;td&gt;Buy&lt;/td&gt;
&lt;td&gt;4,517.3 → 4,406.4&lt;/td&gt;
&lt;td&gt;−110.96&lt;/td&gt;
&lt;td&gt;80 h&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;9 Mar 2026 00:00&lt;/td&gt;
&lt;td&gt;10 Mar 02:00&lt;/td&gt;
&lt;td&gt;Sell&lt;/td&gt;
&lt;td&gt;5,076.2 → 5,184.3&lt;/td&gt;
&lt;td&gt;−108.21&lt;/td&gt;
&lt;td&gt;26 h&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;26 Jan 2026 19:00&lt;/td&gt;
&lt;td&gt;27 Jan 21:00&lt;/td&gt;
&lt;td&gt;Sell&lt;/td&gt;
&lt;td&gt;5,069.1 → 5,176.7&lt;/td&gt;
&lt;td&gt;−107.72&lt;/td&gt;
&lt;td&gt;26 h&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;17 Apr 2026 13:00&lt;/td&gt;
&lt;td&gt;21 Apr 15:00&lt;/td&gt;
&lt;td&gt;Buy&lt;/td&gt;
&lt;td&gt;4,846.3 → 4,739.2&lt;/td&gt;
&lt;td&gt;−107.21&lt;/td&gt;
&lt;td&gt;98 h&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1 May 2026 14:00&lt;/td&gt;
&lt;td&gt;4 May 16:00&lt;/td&gt;
&lt;td&gt;Buy&lt;/td&gt;
&lt;td&gt;4,625.3 → 4,521.6&lt;/td&gt;
&lt;td&gt;−103.71&lt;/td&gt;
&lt;td&gt;74 h&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4 Feb 2026 01:00&lt;/td&gt;
&lt;td&gt;4 Feb 16:00&lt;/td&gt;
&lt;td&gt;Buy&lt;/td&gt;
&lt;td&gt;5,015.8 → 4,920.7&lt;/td&gt;
&lt;td&gt;−95.17&lt;/td&gt;
&lt;td&gt;15 h&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;15 Jan 2026 14:00&lt;/td&gt;
&lt;td&gt;20 Jan 04:00&lt;/td&gt;
&lt;td&gt;Sell&lt;/td&gt;
&lt;td&gt;4,588.5 → 4,680.2&lt;/td&gt;
&lt;td&gt;−91.78&lt;/td&gt;
&lt;td&gt;110 h&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;21 Jan 2026 20:00&lt;/td&gt;
&lt;td&gt;22 Jan 16:00&lt;/td&gt;
&lt;td&gt;Sell&lt;/td&gt;
&lt;td&gt;4,781.3 → 4,871.9&lt;/td&gt;
&lt;td&gt;−90.63&lt;/td&gt;
&lt;td&gt;20 h&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;20 Mar 2026 08:00&lt;/td&gt;
&lt;td&gt;20 Mar 14:00&lt;/td&gt;
&lt;td&gt;Buy&lt;/td&gt;
&lt;td&gt;4,706.4 → 4,616.3&lt;/td&gt;
&lt;td&gt;−90.16&lt;/td&gt;
&lt;td&gt;6 h&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;At current gold prices, one bad trade costs around 180 USD per 0.01 lot. Size for that.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What isn't a red flag:&lt;/strong&gt; no martingale, no grid, no averaging down.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Who should use it?
&lt;/h2&gt;

&lt;p&gt;If you trade gold or USDJPY and want a simple mechanical system on H1, Super Scalper with the default settings is worth paper trading. It doesn't repaint, the logic is three lines, and it held on 16 years of data it had never seen. Expect long flat stretches, a 35% win rate, and years like 2023.&lt;/p&gt;

&lt;p&gt;Don't run it on M5 or M15, whatever the name says. And don't wire up the stop loss in the code.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I couldn't verify
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TradingView's own report.&lt;/strong&gt; My numbers come from my port, not TradingView's tester.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NIFTY.&lt;/strong&gt; The author's chart is the Indian NIFTY 50 index on 5 minutes. I don't have NIFTY tick data, so I can't say how it did there.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Forex swap.&lt;/strong&gt; Not included for USDJPY or the other pairs. While US rates sit above Japan's, longs usually earn swap and shorts pay it, so on a two-sided system the effect partly cancels. I haven't measured it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live fills.&lt;/strong&gt; These are bar-open fills with real spread, not live execution. On H1 a few seconds of delay matters less than on M5, but I haven't measured it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Bottom line
&lt;/h2&gt;

&lt;p&gt;The TradingView Super Scalper strategy doesn't repaint and, as a scalper, never got above PF 1.01 on any market I tested. Move it to H1 and gold made PF 1.27 after swap from 2020 to 2026 and 1.10 from 2004 to 2019, which makes it the most durable result in this series so far. Thin and bumpy, but real enough to keep watching.&lt;/p&gt;

&lt;p&gt;This is part of a series where I port the most-boosted open-source TradingView strategies and test them on broker ticks with real costs. For a strategy that held on Bitcoin but faded each year, see the &lt;a href="https://moonthetrain.com/lab/tradingview-macd-reloaded-strategy-backtest" rel="noopener noreferrer"&gt;MACD ReLoaded backtest&lt;/a&gt;; for one where a chart setting creates fake profits, the &lt;a href="https://moonthetrain.com/lab/tradingview-ut-bot-strategy-backtest" rel="noopener noreferrer"&gt;UT Bot backtest&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm not affiliated with TradingView or VinayKumarKV. Past results, including backtests, don't guarantee future results.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>backtesting</category>
      <category>trading</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>TradingView MACD ReLoaded Strategy: Best Settings, Backtest</title>
      <dc:creator>Truong Pham | Moon The Train</dc:creator>
      <pubDate>Wed, 18 Nov 2026 01:20:49 +0000</pubDate>
      <link>https://dev.to/moonthetrain/tradingview-macd-reloaded-strategy-best-settings-backtest-ggd</link>
      <guid>https://dev.to/moonthetrain/tradingview-macd-reloaded-strategy-best-settings-backtest-ggd</guid>
      <description>&lt;p&gt;&lt;strong&gt;The short version.&lt;/strong&gt; This is a TradingView MACD ReLoaded Strategy backtest. KivancOzbilgic's script (7,672 boosts) is a regular MACD where all three averages can be one of 11 moving-average types, VAR by default. I ported it to Python and ran it on Exness tick data with real spread, commission and, for Bitcoin, Exness swap.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bitcoin H4 is one of the better results in this series.&lt;/strong&gt; PF 1.30 and +76,316 USD per BTC from January 2024 to November 2026 after spread, commission and swap, 223 trades, 24,685 drawdown. Buy and hold made +18,063 after swap, with a drawdown of about 67,000.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;And it held up after the script was published.&lt;/strong&gt; On Dukascopy Bitcoin, H4 made PF 1.29 before July 2021 and 1.26 after. The two earlier ones I checked this way (ANN Strategy and Flawless Victory) didn't.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;But it's fading.&lt;/strong&gt; By year: 2024 PF 1.64, 2025 1.23, 2026 so far 1.09.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gold H1 looked good (PF 1.21) until I split it by year.&lt;/strong&gt; 2026 alone made 75% of the profit, and from 2004 to 2019 the same setup broke even.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Forex lost.&lt;/strong&gt; EURUSD, GBPUSD and NZDUSD: PF 0.69 to 1.07 from M5 to H4.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The author's tip "use SMA or WMA on daily charts" didn't hold.&lt;/strong&gt; SMA was the best daily setting on Bitcoin before publishing (PF 2.31) and dropped to 1.16 after. The default VAR went from 1.38 to 1.50.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My verdict: on Bitcoin H4 with the default settings, this is the first one in the series I'd keep watching. It's not proven: one market, a shrinking edge, and a statistics test it didn't clearly pass.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the MACD ReLoaded strategy on TradingView?
&lt;/h2&gt;

&lt;p&gt;It's the &lt;a href="https://www.tradingview.com/script/VO6DY8s1-MACD-ReLoaded-STRATEGY/" rel="noopener noreferrer"&gt;strategy version&lt;/a&gt; of KivancOzbilgic's MACD ReLoaded indicator, first published on 4 July 2021 (current Pine v5 code from January 2023). The chart on the page is Binance BTCUSDT, daily.&lt;/p&gt;

&lt;p&gt;Gerald Appel's MACD uses exponential averages. This one lets you pick: SMA, EMA, WMA, DEMA, TMA, VAR, WWMA, ZLEMA, TSF, HULL or TILL. The default is &lt;strong&gt;VAR&lt;/strong&gt;, also called VIDYA: an EMA whose speed scales with a 9-bar momentum reading (CMO), so it nearly stops moving when price chops and speeds up when it trends.&lt;/p&gt;

&lt;p&gt;The trading part is short:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MA12 = getMA(close, 12)
MA26 = getMA1(close, 26)
src2 = MA12 - MA26              // MACD line
MATR = getMA2(src2, 9)          // signal line
hist = src2 - MATR

if ta.crossover(hist, 0)
    strategy.entry('MacdLong', strategy.long)
if ta.crossunder(hist, 0)
    strategy.entry('MacdShort', strategy.short)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So it goes long when the MACD line crosses above its signal line and reverses to short when it crosses below. It's always in the market. No stop loss, no take profit. There are From/To date inputs, but the &lt;code&gt;window()&lt;/code&gt; function that would use them is never called, so they do nothing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs40cq8tbkkde06g40k9h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs40cq8tbkkde06g40k9h.png" alt="MACD ReLoaded on BTCUSD H4, 20 September to 19 October 2025: candles with green background while long and red while short, buy and sell arrows, and below them the VAR MACD line, signal line and histogram crossing zero, Exness tick data" width="800" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's the typical picture on Bitcoin H4. One long rode the rally from 110,000 to 125,000, one short caught most of the drop back to 105,000, and a two-candle flip in the middle cost a little.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does MACD ReLoaded repaint?
&lt;/h2&gt;

&lt;p&gt;No. Every input is the bar's close and the averages only look back. Signals come on the bar close and I fill them at the next bar's open, same as TradingView's tester with default settings.&lt;/p&gt;

&lt;p&gt;One small thing: in Pine, VAR starts at zero on the first bar of the chart and takes a while to settle. TradingView loads enough history that you won't notice. My data starts in 2020, so I start VAR at the first price and skip the first 200 bars. On H1 and H4 the two starting rules gave the same PF within 0.02.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I tested it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Port:&lt;/strong&gt; Python, signals on the close, fills at the next open, stop-and-reverse like &lt;code&gt;strategy.entry&lt;/code&gt;. Default settings: VAR, 12/26/9, close.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data:&lt;/strong&gt; Exness Raw Spread ticks for XAUUSD, EURUSD, GBPUSD, USDJPY and NZDUSD from January 2020 to September 2026, BTCUSD from 1 January 2024 to 3 November 2026.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Costs:&lt;/strong&gt; buys fill at the real ask on the bar's first tick, sells at the bid, plus 3.5 USD per lot per side (forex, gold) or 1 USD per BTC per side.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bitcoin swap:&lt;/strong&gt; from the Exness symbol spec (September 2026): longs pay 16.39 USD per BTC per night, triple on Friday, nothing for Saturday and Sunday; shorts pay nothing. Roughly 7.6% a year at 78,000.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Longer history:&lt;/strong&gt; Dukascopy Bitcoin M5 from May 2017 and Dukascopy gold M1 from 2004.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Size:&lt;/strong&gt; fixed, no compounding. Gold in USD per 0.01 lot, forex in pips, Bitcoin in USD per 1 BTC.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The results
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Profit factor after spread and commission, default settings:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Feickievb1vbetartwv8s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Feickievb1vbetartwv8s.png" alt="MACD ReLoaded profit factor after costs by symbol and timeframe, long plus short and long only, XAUUSD USDJPY EURUSD GBPUSD NZDUSD BTCUSD, M5 to D1, with trade counts, Exness Raw Spread ticks 2020 to 2026, swap not included" width="800" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Small timeframes lose everywhere. On M5 the strategy takes around 19,000 trades in six and a half years and the spread eats it (forex PF 0.69 to 0.83, gold 0.95). From H1 up it gets interesting on three markets: gold, USDJPY and Bitcoin.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is MACD ReLoaded profitable on Bitcoin?
&lt;/h2&gt;

&lt;p&gt;On H4 so far, yes, including swap. This is the part that surprised me.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;BTCUSD, 1 Jan 2024 – 3 Nov 2026, long + short unless noted:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timeframe&lt;/th&gt;
&lt;th&gt;Trades&lt;/th&gt;
&lt;th&gt;PF before swap&lt;/th&gt;
&lt;th&gt;PF after swap&lt;/th&gt;
&lt;th&gt;Net after swap&lt;/th&gt;
&lt;th&gt;Max drawdown&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;H1&lt;/td&gt;
&lt;td&gt;918&lt;/td&gt;
&lt;td&gt;1.03&lt;/td&gt;
&lt;td&gt;1.02&lt;/td&gt;
&lt;td&gt;+10,627&lt;/td&gt;
&lt;td&gt;49,968&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;H4&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;223&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.34&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.30&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+76,316&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;24,685&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;H4 long only&lt;/td&gt;
&lt;td&gt;111&lt;/td&gt;
&lt;td&gt;1.54&lt;/td&gt;
&lt;td&gt;1.45&lt;/td&gt;
&lt;td&gt;+51,477&lt;/td&gt;
&lt;td&gt;19,537&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D1&lt;/td&gt;
&lt;td&gt;27&lt;/td&gt;
&lt;td&gt;1.66&lt;/td&gt;
&lt;td&gt;1.57&lt;/td&gt;
&lt;td&gt;+50,393&lt;/td&gt;
&lt;td&gt;39,428&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Buy and hold&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;+18,063&lt;/td&gt;
&lt;td&gt;67,188 (before swap)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;USD per 1 BTC. Swap took 8,095 from the H4 strategy (only the long half pays it) and 16,992 from buy and hold.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9tm2xfqu37ccbz8gbmaw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9tm2xfqu37ccbz8gbmaw.png" alt="MACD ReLoaded equity on BTCUSD H4, long plus short and long only, versus buy and hold Bitcoin, January 2024 to November 2026, after spread, commission and Exness swap on longs" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Both sides made money on H4: longs +51,477 after swap, shorts +24,839. That matters because a Bitcoin strategy that only profits from longs is mostly just holding Bitcoin. This one made money on the way down in early 2026 when buy and hold gave back most of its gain.&lt;/p&gt;

&lt;p&gt;Then I changed the settings. Across 57 combinations of fast (6 to 24), slow (20 to 52) and signal (5 to 14) lengths, all 57 had PF above 1 before swap, and 93% still did after swap (median 1.20). It's not one lucky setting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now the worrying part:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;BTCUSD H4 after swap&lt;/th&gt;
&lt;th&gt;2024&lt;/th&gt;
&lt;th&gt;2025&lt;/th&gt;
&lt;th&gt;2026 (to 3 Nov)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Long + short&lt;/td&gt;
&lt;td&gt;1.64&lt;/td&gt;
&lt;td&gt;1.23&lt;/td&gt;
&lt;td&gt;1.09&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Long only&lt;/td&gt;
&lt;td&gt;3.20&lt;/td&gt;
&lt;td&gt;1.14&lt;/td&gt;
&lt;td&gt;0.92&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The edge has shrunk every year. Long only is already losing in 2026.&lt;/p&gt;

&lt;h2&gt;
  
  
  Did it work on Bitcoin after it was published?
&lt;/h2&gt;

&lt;p&gt;Yes, and this is the strongest evidence in its favour. Exness only has Bitcoin from 2024, so I went back to May 2017 with Dukascopy data and a 0.06% round-trip cost per trade, and split it at the publish date:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F63wtw3ty9l3libsjnmvc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F63wtw3ty9l3libsjnmvc.png" alt="MACD ReLoaded on Bitcoin from 2017 to 2026, Bitcoin price on a log scale above, cumulative percent per trade below for H4 VAR, D1 VAR and D1 SMA, with the 4 July 2021 publish date marked, Dukascopy M5 data with 0.06 percent round-trip cost" width="800" height="528"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;PF, long + short&lt;/th&gt;
&lt;th&gt;2017 – Jul 2021&lt;/th&gt;
&lt;th&gt;Jul 2021 – Jun 2026&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;H1, VAR&lt;/td&gt;
&lt;td&gt;1.24&lt;/td&gt;
&lt;td&gt;1.02&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;H4, VAR (default)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.29&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.26&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D1, VAR&lt;/td&gt;
&lt;td&gt;1.38&lt;/td&gt;
&lt;td&gt;1.50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D1, SMA&lt;/td&gt;
&lt;td&gt;2.31&lt;/td&gt;
&lt;td&gt;1.16&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D1, WMA&lt;/td&gt;
&lt;td&gt;1.53&lt;/td&gt;
&lt;td&gt;1.09&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The second column is data the author couldn't have seen. H4 with the default settings made +223% compounded after publishing while Bitcoin itself rose 75%. Before publishing it made +201% while Bitcoin rose 2,127%, so it didn't beat the big bull run, but it held through the bear market of 2022 better than holding did.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are the best MACD ReLoaded settings?
&lt;/h2&gt;

&lt;p&gt;The author's description gives two tips: on shorter timeframes TILL, WWMA and VAR avoid whipsaws because they give fewer signals, and on daily charts WMA and SMA "are more accurate according to backtest results." I tested all 11 types on six markets and four timeframes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip one holds.&lt;/strong&gt; VAR, WWMA and TILL produce far fewer trades (on H1, a median of about 1,600 to 2,100 per market, versus about 6,900 for HULL and ZLEMA). On M15 and H1, VAR and WWMA ranked best on average, with TILL close behind. Fewer trades means less spread paid. They still lost on M15, just less.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip two doesn't.&lt;/strong&gt; Here's Bitcoin, sorted by what looked best before publishing:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqmjw07b8n7h3yajt25lu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqmjw07b8n7h3yajt25lu.png" alt="MACD ReLoaded profit factor for all 11 moving average types on BTCUSD H4 and D1, before publishing 2017 to July 2021 in grey versus after publishing July 2021 to 2026 in blue, Dukascopy M5 data, 0.06 percent round-trip cost, lengths 12 26 9" width="800" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SMA was the clear winner on daily Bitcoin before July 2021, which is probably what the author's own backtests showed. After publishing it fell to 1.16. WMA fell from 1.53 to 1.09. VAR, the default, was mid-table before and the second best after. Across the six Exness markets, VAR and WWMA also ranked best on D1 on average, with SMA and WMA in the middle.&lt;/p&gt;

&lt;p&gt;So my answer for "best settings" is boring: leave the default. VAR 12/26/9 on H4.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is the gold result real?
&lt;/h2&gt;

&lt;p&gt;Partly. Gold H1 made PF 1.21 and +3,025 USD per 0.01 lot from 2020 to 2026, 1,540 trades, 887 drawdown. Buy and hold made +2,588 with a 1,600 drawdown. Sounds good. Here's the timeline:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjk2wltjafa51411gcdhv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjk2wltjafa51411gcdhv.png" alt="MACD ReLoaded equity on XAUUSD H1, H4 and D1 long plus short versus buy and hold gold, January 2020 to September 2026, 2026 shaded, Exness Raw Spread ticks, spread and commission included, swap not included" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Gold H1, by year&lt;/th&gt;
&lt;th&gt;2020&lt;/th&gt;
&lt;th&gt;2021&lt;/th&gt;
&lt;th&gt;2022&lt;/th&gt;
&lt;th&gt;2023&lt;/th&gt;
&lt;th&gt;2024&lt;/th&gt;
&lt;th&gt;2025&lt;/th&gt;
&lt;th&gt;2026&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;PF&lt;/td&gt;
&lt;td&gt;1.04&lt;/td&gt;
&lt;td&gt;1.09&lt;/td&gt;
&lt;td&gt;1.03&lt;/td&gt;
&lt;td&gt;0.82&lt;/td&gt;
&lt;td&gt;1.04&lt;/td&gt;
&lt;td&gt;1.24&lt;/td&gt;
&lt;td&gt;1.63&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Net&lt;/td&gt;
&lt;td&gt;+73&lt;/td&gt;
&lt;td&gt;+110&lt;/td&gt;
&lt;td&gt;+39&lt;/td&gt;
&lt;td&gt;−260&lt;/td&gt;
&lt;td&gt;+78&lt;/td&gt;
&lt;td&gt;+726&lt;/td&gt;
&lt;td&gt;+2,258&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Five years of almost nothing, then 2026. On older gold (Dukascopy, 2004 to 2019, swap on longs scaled to price) the same setup made PF 0.99 on H1 and 1.09 on H4, while gold rose 266%. Swap on 2020–26 gold also trims H1 from 1.21 to 1.18.&lt;/p&gt;

&lt;p&gt;The random timing test is interesting here. I slid the strategy's own long/short sequence to a random point in time 200 times, keeping every trade's length. On 2004–2019 gold the real signal beat 97% to 99% of the random copies on both H1 and H4. So the timing is better than chance, just not by enough to pay the spread. I saw the same thing with the ANN Strategy v2.&lt;/p&gt;

&lt;p&gt;USDJPY D1 shows PF 2.05, but on 69 trades, with most of the profit in the 2022–24 yen slide and 2026 at PF 0.39. I wouldn't read much into it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Risk structure
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No stop loss.&lt;/strong&gt; A trade ends only when the histogram crosses zero again. On Bitcoin H4 that means holding a wrong-way trade for days.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The worst losses on Bitcoin were shorts during breakouts.&lt;/strong&gt; Ten worst H4 trades after swap, USD per BTC:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Entry&lt;/th&gt;
&lt;th&gt;Exit&lt;/th&gt;
&lt;th&gt;Side&lt;/th&gt;
&lt;th&gt;Entry → exit price&lt;/th&gt;
&lt;th&gt;Loss&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;6 Mar 2024 00:00&lt;/td&gt;
&lt;td&gt;11 Mar 12:00&lt;/td&gt;
&lt;td&gt;Sell&lt;/td&gt;
&lt;td&gt;63,756.7 → 71,510.8&lt;/td&gt;
&lt;td&gt;−7,756&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1 Dec 2025 04:00&lt;/td&gt;
&lt;td&gt;2 Dec 20:00&lt;/td&gt;
&lt;td&gt;Sell&lt;/td&gt;
&lt;td&gt;86,358.9 → 91,932.4&lt;/td&gt;
&lt;td&gt;−5,575&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;17 Nov 2024 04:00&lt;/td&gt;
&lt;td&gt;20 Nov 16:00&lt;/td&gt;
&lt;td&gt;Sell&lt;/td&gt;
&lt;td&gt;90,255.5 → 94,836.0&lt;/td&gt;
&lt;td&gt;−4,582&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;13 Oct 2025 20:00&lt;/td&gt;
&lt;td&gt;14 Oct 12:00&lt;/td&gt;
&lt;td&gt;Buy&lt;/td&gt;
&lt;td&gt;115,902.0 → 111,400.4&lt;/td&gt;
&lt;td&gt;−4,520&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4 Mar 2025 12:00&lt;/td&gt;
&lt;td&gt;5 Mar 16:00&lt;/td&gt;
&lt;td&gt;Sell&lt;/td&gt;
&lt;td&gt;83,972.1 → 88,338.6&lt;/td&gt;
&lt;td&gt;−4,368&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;22 Aug 2025 20:00&lt;/td&gt;
&lt;td&gt;24 Aug 20:00&lt;/td&gt;
&lt;td&gt;Buy&lt;/td&gt;
&lt;td&gt;116,672.8 → 112,575.5&lt;/td&gt;
&lt;td&gt;−4,099&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;12 May 2025 16:00&lt;/td&gt;
&lt;td&gt;19 May 00:00&lt;/td&gt;
&lt;td&gt;Sell&lt;/td&gt;
&lt;td&gt;102,513.3 → 106,465.8&lt;/td&gt;
&lt;td&gt;−3,955&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8 Jul 2025 04:00&lt;/td&gt;
&lt;td&gt;9 Jul 20:00&lt;/td&gt;
&lt;td&gt;Sell&lt;/td&gt;
&lt;td&gt;107,923.1 → 111,755.9&lt;/td&gt;
&lt;td&gt;−3,835&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;31 Oct 2024 16:00&lt;/td&gt;
&lt;td&gt;6 Nov 04:00&lt;/td&gt;
&lt;td&gt;Sell&lt;/td&gt;
&lt;td&gt;70,531.1 → 74,330.3&lt;/td&gt;
&lt;td&gt;−3,801&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1 Jul 2025 16:00&lt;/td&gt;
&lt;td&gt;2 Jul 20:00&lt;/td&gt;
&lt;td&gt;Sell&lt;/td&gt;
&lt;td&gt;106,089.3 → 109,749.0&lt;/td&gt;
&lt;td&gt;−3,662&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Eight of ten are shorts. The worst one sold just before Bitcoin broke its old high in March 2024 and held for 132 hours. At 0.01 lot that's −77.56 USD, so size it for at least 250 USD of drawdown per 0.01 lot.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Win rate is low:&lt;/strong&gt; 42% on Bitcoin H4, 35% on gold H1. Profits come from a few long trends.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What isn't a red flag:&lt;/strong&gt; no martingale, no grid, no averaging down.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Is the Bitcoin result statistically real?
&lt;/h2&gt;

&lt;p&gt;Not proven. With the random timing test, Bitcoin H4 beat 97% of random copies (p = 0.03). That sounds good, but I ran the same test on 36 combinations (six markets, three timeframes, long + short and long only), and with that many tries a 0.03 can show up by luck. None of the 36 passed once I adjusted for that.&lt;/p&gt;

&lt;p&gt;What makes me take it more seriously than the number alone: it held past the publish date, it held across all 57 parameter combinations, and it held on two different data sources. What makes me careful: almost three years of Exness data is only 223 trades, and the yearly PF keeps dropping.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who should use it?
&lt;/h2&gt;

&lt;p&gt;If you trade Bitcoin and want a mechanical trend system, MACD ReLoaded with the default settings on H4 is a reasonable thing to paper trade. It's simple, it doesn't repaint, and it kept its result after publication, which the earlier ones I checked didn't. Expect single losses of up to about 7,800 USD per BTC and long losing stretches.&lt;/p&gt;

&lt;p&gt;I wouldn't run it on forex, and I wouldn't trust the gold H1 result to continue after the 2026 rally ends.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I couldn't verify
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TradingView's own report.&lt;/strong&gt; My numbers come from my port, not from TradingView's strategy tester.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Binance BTCUSDT.&lt;/strong&gt; The author's chart is Binance spot; mine are Exness CFD ticks and Dukascopy. Spot has no swap but has different fees.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The exact swap on Exness Raw.&lt;/strong&gt; The swap I used comes from the Exness symbol spec on a different account type (September 2026). Swap rates change, and the Raw account may differ.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Forex swap.&lt;/strong&gt; Not included. It wouldn't rescue PF 0.69–1.07.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Out-of-sample on Exness Bitcoin.&lt;/strong&gt; Only 2024–2026 exists. I'll rerun it as new data comes in.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Bottom line
&lt;/h2&gt;

&lt;p&gt;The TradingView MACD ReLoaded strategy doesn't repaint, loses on forex, and only beat gold buy and hold thanks to 2026. On Bitcoin H4 with the default VAR settings it made PF 1.30 after Exness swap and kept its edge after publication, but that edge has shrunk every year since 2024.&lt;/p&gt;

&lt;p&gt;This is part of a series where I port the most-boosted open-source TradingView strategies and test them on broker ticks with real costs. For another KivancOzbilgic script on the same data, see the &lt;a href="https://moonthetrain.com/lab/tradingview-tott-strategy-backtest" rel="noopener noreferrer"&gt;TOTT backtest&lt;/a&gt;; for one where a backtest setting creates fake profits, the &lt;a href="https://moonthetrain.com/lab/tradingview-ut-bot-strategy-backtest" rel="noopener noreferrer"&gt;UT Bot backtest&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm not affiliated with TradingView or KivancOzbilgic. Past results, including backtests, don't guarantee future results.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>backtesting</category>
      <category>trading</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>TradingView TOTT Strategy: Best Settings, Repaint, Backtest</title>
      <dc:creator>Truong Pham | Moon The Train</dc:creator>
      <pubDate>Tue, 17 Nov 2026 02:58:05 +0000</pubDate>
      <link>https://dev.to/moonthetrain/tradingview-tott-strategy-best-settings-repaint-backtest-214i</link>
      <guid>https://dev.to/moonthetrain/tradingview-tott-strategy-best-settings-repaint-backtest-214i</guid>
      <description>&lt;p&gt;&lt;strong&gt;The short version.&lt;/strong&gt; This is a TradingView TOTT strategy backtest: Twin Optimized Trend Tracker by KivancOzbilgic, built on Anıl Özekşi's OTT. I ported it line for line to Python and ran the default settings on Exness tick data with real spread and commission: gold and four forex pairs from 2020 to 2026, Bitcoin from 2024, and gold back to 2004.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gold since 2020 looks good.&lt;/strong&gt; PF 1.52 on M15 (333 trades, +3,429 USD per 0.01 lot), 1.44 on H1, 1.25 on H4. Every timeframe was positive.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gold from 2004 to 2019 didn't.&lt;/strong&gt; The same M15 setup made PF 0.99 over sixteen years while gold rose 266%. H4 went backwards.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Almost all of the profit came from the long side.&lt;/strong&gt; Shorts lost money on gold H1, H4 and D1, on USDJPY and on Bitcoin.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Forex mostly lost or broke even.&lt;/strong&gt; EURUSD, GBPUSD and NZDUSD: PF 0.79 to 1.10 on M5 to H4, with one exception (GBPUSD H1, 1.30 on 89 trades) that didn't beat random timing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The "twin" part doesn't help.&lt;/strong&gt; Splitting OTT into two lines cut trades by about a quarter and raised PF in 11 of 18 cases, lowered it in 7.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My verdict: TOTT is a slow trend follower that rode the 2020s gold rally. I didn't find an edge beyond that.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the TOTT strategy on TradingView?
&lt;/h2&gt;

&lt;p&gt;It's a moving average that flips the trade when it crosses a trailing band set 1% away from itself. The &lt;a href="https://www.tradingview.com/script/eENf7NpJ/" rel="noopener noreferrer"&gt;Twin Optimized Trend Tracker Strategy&lt;/a&gt; was published by KivancOzbilgic on 10 January 2023 (Pine v5) and had 8,819 boosts when I checked in November 2026. The idea comes from Anıl Özekşi, who designed OTT for Turkish stocks. The script page links his video "Toy Borsacı İçin OTT Kullanım Kılavuzu 2" and says the twin lines are there "to cope with sideways' false signals".&lt;/p&gt;

&lt;p&gt;Here's the core of the code with the defaults (OTT period 40, optimization constant 1, twin coefficient 0.001, VAR average):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MAvg = getMA(src, length)            // VAR: EMA scaled by |CMO(9)|
fark = MAvg * percent * 0.01
longStop  := MAvg &amp;gt; longStopPrev  ? math.max(longStop, longStopPrev)   : longStop
shortStop := MAvg &amp;lt; shortStopPrev ? math.min(shortStop, shortStopPrev) : shortStop
MT  = dir == 1 ? longStop : shortStop
OTT = MAvg &amp;gt; MT ? MT * (200 + percent) / 200 : MT * (200 - percent) / 200
OTTup = OTT * (1 + coeff)
OTTdn = OTT * (1 - coeff)
buySignalk  = ta.crossover(MAvg, OTTup[2])
sellSignalk = ta.crossunder(MAvg, OTTdn[2])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In plain words:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The support line&lt;/strong&gt; is VAR, the Variable Index Dynamic Average. It's an EMA whose speed depends on the 9-bar Chande Momentum Oscillator, so it nearly stops moving when price goes sideways.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The stop&lt;/strong&gt; sits 1% below that line in an uptrend and only ever moves up, like a trailing stop. In a downtrend it sits 1% above and only moves down.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The twin lines&lt;/strong&gt; are that stop shifted up 0.1% and down 0.1%.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The signals&lt;/strong&gt; fire when the support line itself (not price) crosses the upper twin line from two bars ago (buy) or the lower one (sell). The strategy is always in the market and reverses on each signal. No stop loss, no take profit.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So it's a cousin of SuperTrend and &lt;a href="https://moonthetrain.com/lab/tradingview-pmax-strategy-backtest" rel="noopener noreferrer"&gt;PMax&lt;/a&gt;, not of Bollinger Bands: the band is a fixed percent of price, not volatility, and it ratchets in one direction.&lt;/p&gt;

&lt;p&gt;Here's what that looks like on gold H1:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fws8qc1pwwtiw05lkf4cu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fws8qc1pwwtiw05lkf4cu.png" alt="TOTT strategy on XAUUSD H1, 1 Aug to 31 Oct 2025, default settings: VAR support line in blue with green and red OTT twin lines below it during a rally from 3,350 to 4,350, two buy and two sell signals, Exness tick data" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Three small losses in August, then one long from 3,389.79 on 26 August held for eight weeks and closed at 4,111.27 on 21 October: +721 USD per 0.01 lot. It gave back about 270 from the top before the support line turned. That's the trade TOTT exists for.&lt;/p&gt;

&lt;p&gt;The 1% band is wide. On gold M5 it made only 656 trades in six and a half years, and on H4 just 60. Every result below should be read with that in mind.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does TOTT repaint?
&lt;/h2&gt;

&lt;p&gt;No. It decides at the bar close and fills at the next bar's open, and the &lt;code&gt;[2]&lt;/code&gt; on the OTT lines looks back, not forward. The &lt;code&gt;barssince&lt;/code&gt; calls only colour the chart and place labels; they don't touch the orders. One quirk: VAR starts at zero on the first bar of the chart and climbs slowly, so the first few signals on a short chart history are meaningless. On TradingView's normal history that's long gone before the bars you care about. I started VAR at the first price and skipped 100 bars. Starting from zero instead moved gold H1 and H4 by 0.01 to 0.05 PF, but some forex H4 cells (40 to 50 trades) moved by up to 0.2, which tells you how little those cells are worth.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I tested it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Port:&lt;/strong&gt; Python, line for line, reusing the VAR and trailing-band code from my PMax port. Signals at the bar close, fills at the next bar's open, stop-and-reverse like &lt;code&gt;strategy.entry&lt;/code&gt;. A repeated buy while already long is ignored, as in Pine.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data:&lt;/strong&gt; Exness Raw Spread tick archives for XAUUSD, EURUSD, GBPUSD, USDJPY and NZDUSD, January 2020 to September 2026. BTCUSD from January 2024 to October 2026.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Costs:&lt;/strong&gt; buys fill at the real ask on the first tick of the bar, sells at the bid, plus 3.5 USD per lot per side on forex and gold, 1 USD per BTC per side. Swap gets its own section.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Older gold data:&lt;/strong&gt; Dukascopy M1 bars via Tickstory, 2004 to July 2026, spread from the data, swap on longs scaled to the gold price of the time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Size:&lt;/strong&gt; fixed, no compounding. Gold in USD per 0.01 lot (one ounce), forex in pips, Bitcoin in USD per 1 BTC.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Is the TradingView backtest accurate?
&lt;/h2&gt;

&lt;p&gt;For TOTT, mostly yes. The script has no commission and TradingView can't model spread or swap (more on that in the &lt;a href="https://moonthetrain.com/lab/tradingview-supertrend-strategy-backtest" rel="noopener noreferrer"&gt;SuperTrend backtest&lt;/a&gt;), but TOTT trades so rarely that costs barely move it:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Default settings, long + short&lt;/th&gt;
&lt;th&gt;Trades&lt;/th&gt;
&lt;th&gt;PF, no costs&lt;/th&gt;
&lt;th&gt;PF, real costs&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Gold M15&lt;/td&gt;
&lt;td&gt;333&lt;/td&gt;
&lt;td&gt;1.54&lt;/td&gt;
&lt;td&gt;1.52&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EURUSD M5&lt;/td&gt;
&lt;td&gt;355&lt;/td&gt;
&lt;td&gt;0.91&lt;/td&gt;
&lt;td&gt;0.89&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;USDJPY M5&lt;/td&gt;
&lt;td&gt;415&lt;/td&gt;
&lt;td&gt;1.04&lt;/td&gt;
&lt;td&gt;1.01&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BTCUSD M5&lt;/td&gt;
&lt;td&gt;707&lt;/td&gt;
&lt;td&gt;1.04&lt;/td&gt;
&lt;td&gt;1.02&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Swap is the cost that matters here, because trades last days. It's further down.&lt;/p&gt;

&lt;h2&gt;
  
  
  The results
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Profit factor after spread and commission, default settings:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcpo4jbw6kg9uhquv4b97.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcpo4jbw6kg9uhquv4b97.png" alt="TOTT strategy profit factor after costs by symbol and timeframe, long plus short and long only, XAUUSD USDJPY EURUSD GBPUSD NZDUSD BTCUSD, M5 to D1, with trade counts, Exness Raw Spread ticks 2020 to 2026" width="800" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The D1 column has 5 to 19 trades per cell. Ignore it. USDJPY H4 (1.54) is 37 trades.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gold (XAUUSD Raw Spread), 29 Jan 2020 – Sep 2026, before swap:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timeframe&lt;/th&gt;
&lt;th&gt;Direction&lt;/th&gt;
&lt;th&gt;Trades&lt;/th&gt;
&lt;th&gt;Win rate&lt;/th&gt;
&lt;th&gt;PF&lt;/th&gt;
&lt;th&gt;Net&lt;/th&gt;
&lt;th&gt;Max drawdown&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;M5&lt;/td&gt;
&lt;td&gt;long + short&lt;/td&gt;
&lt;td&gt;656&lt;/td&gt;
&lt;td&gt;38.1%&lt;/td&gt;
&lt;td&gt;1.24&lt;/td&gt;
&lt;td&gt;+2,443&lt;/td&gt;
&lt;td&gt;1,095&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;M15&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;long + short&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;333&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;38.7%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.52&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+3,429&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1,280&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;H1&lt;/td&gt;
&lt;td&gt;long + short&lt;/td&gt;
&lt;td&gt;141&lt;/td&gt;
&lt;td&gt;37.6%&lt;/td&gt;
&lt;td&gt;1.44&lt;/td&gt;
&lt;td&gt;+1,871&lt;/td&gt;
&lt;td&gt;969&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;H4&lt;/td&gt;
&lt;td&gt;long + short&lt;/td&gt;
&lt;td&gt;60&lt;/td&gt;
&lt;td&gt;31.7%&lt;/td&gt;
&lt;td&gt;1.25&lt;/td&gt;
&lt;td&gt;+756&lt;/td&gt;
&lt;td&gt;1,662&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M15&lt;/td&gt;
&lt;td&gt;long only&lt;/td&gt;
&lt;td&gt;166&lt;/td&gt;
&lt;td&gt;44.0%&lt;/td&gt;
&lt;td&gt;2.03&lt;/td&gt;
&lt;td&gt;+3,013&lt;/td&gt;
&lt;td&gt;952&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;H1&lt;/td&gt;
&lt;td&gt;long only&lt;/td&gt;
&lt;td&gt;70&lt;/td&gt;
&lt;td&gt;44.3%&lt;/td&gt;
&lt;td&gt;2.14&lt;/td&gt;
&lt;td&gt;+2,236&lt;/td&gt;
&lt;td&gt;1,073&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Buy and hold&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;+2,588&lt;/td&gt;
&lt;td&gt;1,629&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Net and drawdown in USD per 0.01 lot, drawdown on open equity. "Long only" isn't a script setting; I added it to see where the money came from.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpt5t4aef05lzsszkwqa5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpt5t4aef05lzsszkwqa5.png" alt="TOTT strategy equity on XAUUSD, M15 H1 and H4 long plus short, versus buy and hold gold, Jan 2020 to Sep 2026, Exness Raw Spread ticks, spread and commission included, swap not included" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Look at the M15 line next to buy and hold. They move almost together from 2024 on. On M15 the long side made +3,013 and the short side +416; on H1 and H4 the shorts lost 365 and 883.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Forex, Bitcoin and USDJPY, long + short, after costs:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;M5&lt;/th&gt;
&lt;th&gt;M15&lt;/th&gt;
&lt;th&gt;H1&lt;/th&gt;
&lt;th&gt;H4&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;EURUSD&lt;/td&gt;
&lt;td&gt;0.89&lt;/td&gt;
&lt;td&gt;1.04&lt;/td&gt;
&lt;td&gt;1.10&lt;/td&gt;
&lt;td&gt;0.95&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GBPUSD&lt;/td&gt;
&lt;td&gt;0.93&lt;/td&gt;
&lt;td&gt;0.91&lt;/td&gt;
&lt;td&gt;1.30&lt;/td&gt;
&lt;td&gt;0.90&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NZDUSD&lt;/td&gt;
&lt;td&gt;0.79&lt;/td&gt;
&lt;td&gt;0.81&lt;/td&gt;
&lt;td&gt;0.94&lt;/td&gt;
&lt;td&gt;0.97&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;USDJPY&lt;/td&gt;
&lt;td&gt;1.01&lt;/td&gt;
&lt;td&gt;0.92&lt;/td&gt;
&lt;td&gt;1.17&lt;/td&gt;
&lt;td&gt;1.54&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BTCUSD (2024–26)&lt;/td&gt;
&lt;td&gt;1.02&lt;/td&gt;
&lt;td&gt;0.96&lt;/td&gt;
&lt;td&gt;1.10&lt;/td&gt;
&lt;td&gt;0.99&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;USDJPY tells the same story as gold. It rose for most of the period, the long side made the money (H4 longs +4,215 pips, shorts −790), and the long-only version did better than the default.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is the gold M15 result real?
&lt;/h2&gt;

&lt;p&gt;It passed one test that most of these strategies fail, then failed the one that matters.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Every year was positive.&lt;/strong&gt; Gold M15 by exit year: 2020 PF 1.82, 2021 1.16, 2022 1.02, 2023 1.22, 2024 1.42, 2025 2.00, 2026 1.56. But 2025 and 2026 made +2,481 of the +3,429.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It beat random timing.&lt;/strong&gt; I slid the strategy's own long/short pattern to a random point in time, 300 times, keeping every trade's length. Only 2.3% of the random copies did as well (p = 0.023). Gold H1 and H4 didn't pass (p = 0.17 and 0.31), and neither did USDJPY H4 (0.22), GBPUSD H1 (0.17) or anything else I tried. One pass out of twelve tries is borderline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A handful of trades carry it.&lt;/strong&gt; The ten best trades made +3,655. The other 323 lost 226 together.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Before 2020 it broke even.&lt;/strong&gt; Below.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Does TOTT work on gold before 2020?
&lt;/h2&gt;

&lt;p&gt;No. I ran the same defaults on Dukascopy gold from 2004 to 2019. I hadn't looked at that data when I picked M15.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Gold, 2004–2019&lt;/th&gt;
&lt;th&gt;Trades&lt;/th&gt;
&lt;th&gt;PF after swap&lt;/th&gt;
&lt;th&gt;Summed return&lt;/th&gt;
&lt;th&gt;Long / short&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;M5 long + short&lt;/td&gt;
&lt;td&gt;1,476&lt;/td&gt;
&lt;td&gt;1.08&lt;/td&gt;
&lt;td&gt;+62%&lt;/td&gt;
&lt;td&gt;+86% / −25%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;M15 long + short&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;808&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.99&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−1%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;+56% / −57%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;H1 long + short&lt;/td&gt;
&lt;td&gt;336&lt;/td&gt;
&lt;td&gt;1.07&lt;/td&gt;
&lt;td&gt;+61%&lt;/td&gt;
&lt;td&gt;+87% / −27%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;H4 long + short&lt;/td&gt;
&lt;td&gt;144&lt;/td&gt;
&lt;td&gt;1.14&lt;/td&gt;
&lt;td&gt;−15%&lt;/td&gt;
&lt;td&gt;+47% / −62%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;H1 long only&lt;/td&gt;
&lt;td&gt;168&lt;/td&gt;
&lt;td&gt;1.23&lt;/td&gt;
&lt;td&gt;+87%&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Fixed size, no compounding. "Summed return" adds each trade's profit as a percent of its entry price. Gold itself rose 266% over the period. H4 shows PF above 1 in dollars but a loss in percent because its winning longs came at higher gold prices, which count for more in dollars.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk177u4qir092ngls093w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk177u4qir092ngls093w.png" alt="Gold price on a log scale and cumulative TOTT return on M15 H1 and H4, long plus short, 2004 to 2026: M15 ends 2019 at about zero and only climbs with the 2024 to 2026 rally, Dukascopy data with price-scaled swap" width="800" height="528"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The M15 line, the best one since 2020, ended 2019 roughly where it started in 2004. The long side made money while gold rose, and the short side gave it back. The same random-timing test on 2004–2019 H4 gave p = 0.37 for long + short and 0.39 for long only, which means no better than chance.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are the best TOTT settings?
&lt;/h2&gt;

&lt;p&gt;On recent gold almost anything works, and on older gold almost nothing stands out. I ran OTT period 10, 20, 40, 80 and 160 against optimization constant 0.2, 0.5, 1, 1.5, 2 and 3%, with twin coefficient 0, 0.001 and 0.003. That's 90 combinations per market and timeframe, long + short, after costs:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Market&lt;/th&gt;
&lt;th&gt;Combos with PF &amp;gt; 1&lt;/th&gt;
&lt;th&gt;Profitable in both halves&lt;/th&gt;
&lt;th&gt;Median PF&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;XAUUSD M15, 2020–26&lt;/td&gt;
&lt;td&gt;82 / 90&lt;/td&gt;
&lt;td&gt;68&lt;/td&gt;
&lt;td&gt;1.27&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XAUUSD H1, 2020–26&lt;/td&gt;
&lt;td&gt;78 / 90&lt;/td&gt;
&lt;td&gt;56&lt;/td&gt;
&lt;td&gt;1.34&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XAUUSD H4, 2020–26&lt;/td&gt;
&lt;td&gt;74 / 90&lt;/td&gt;
&lt;td&gt;36&lt;/td&gt;
&lt;td&gt;1.46&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;USDJPY H4&lt;/td&gt;
&lt;td&gt;80 / 90&lt;/td&gt;
&lt;td&gt;58&lt;/td&gt;
&lt;td&gt;1.54&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EURUSD H1&lt;/td&gt;
&lt;td&gt;37 / 90&lt;/td&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;td&gt;0.97&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GBPUSD H1&lt;/td&gt;
&lt;td&gt;55 / 90&lt;/td&gt;
&lt;td&gt;31&lt;/td&gt;
&lt;td&gt;1.06&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NZDUSD H1&lt;/td&gt;
&lt;td&gt;30 / 90&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0.87&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BTCUSD H1&lt;/td&gt;
&lt;td&gt;49 / 90&lt;/td&gt;
&lt;td&gt;36&lt;/td&gt;
&lt;td&gt;1.02&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XAUUSD M15, 2004–19&lt;/td&gt;
&lt;td&gt;68 / 90&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;1.04&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XAUUSD H4, 2004–19&lt;/td&gt;
&lt;td&gt;32 / 90&lt;/td&gt;
&lt;td&gt;15&lt;/td&gt;
&lt;td&gt;0.96&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;"Both halves" = profitable in the first and second half of the data. For 2004–19 the halves are 2004–2011 and 2012–2019.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdgvqu9cqukucors4xog9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdgvqu9cqukucors4xog9.png" alt="TOTT strategy settings grid on XAUUSD M15, OTT period 10 to 160 against optimization constant 0.2 to 3 percent, profit factor after costs, gold 2004 to 2019 versus 2020 to 2026: mostly 0.94 to 1.12 before 2020 and 1.05 to 1.67 after" width="800" height="352"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's the clearest picture in this review. The same 30 settings on the same market: pale grey from 2004 to 2019, blue from 2020 on. The settings didn't get better. Gold started trending, and any trend follower on the long side makes money when it does. If you optimize TOTT on recent gold, you're fitting the rally.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does the twin line help?
&lt;/h2&gt;

&lt;p&gt;Not in any consistent way. Setting the coefficient to 0 gives you plain OTT, one line. Here's the default 0.001 against that:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuq4he89x1duyoj2rplq2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuq4he89x1duyoj2rplq2.png" alt="TOTT twin lines versus a single OTT line, profit factor after costs on six markets and three timeframes, Exness ticks 2020 to 2026: trade count drops in 17 of 18 cases, PF rises in 11 and falls in 7" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The twin lines did what the description says: fewer trades in 17 of 18 cases, typically 20–30% fewer. Whether that helped is a coin flip. Gold M15 went from 1.23 to 1.52, GBPUSD H1 from 1.42 to 1.30, USDJPY H1 from 1.36 to 1.17.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does it compare with UT Bot, Hull Suite, PMax and SuperTrend?
&lt;/h2&gt;

&lt;p&gt;On gold since 2020, TOTT has the best H1 number of the five. Same Exness data, same costs, default settings, long + short:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Gold, Jan 2020 – Sep 2026&lt;/th&gt;
&lt;th&gt;H1 PF&lt;/th&gt;
&lt;th&gt;H4 PF&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;TOTT&lt;/td&gt;
&lt;td&gt;1.44&lt;/td&gt;
&lt;td&gt;1.25&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://moonthetrain.com/lab/tradingview-ut-bot-strategy-backtest" rel="noopener noreferrer"&gt;UT Bot&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;1.04&lt;/td&gt;
&lt;td&gt;1.17&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://moonthetrain.com/lab/tradingview-hull-suite-strategy-backtest" rel="noopener noreferrer"&gt;Hull Suite&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;1.28&lt;/td&gt;
&lt;td&gt;1.25&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://moonthetrain.com/lab/tradingview-pmax-strategy-backtest" rel="noopener noreferrer"&gt;PMax&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;1.37&lt;/td&gt;
&lt;td&gt;0.98&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SuperTrend&lt;/td&gt;
&lt;td&gt;1.09&lt;/td&gt;
&lt;td&gt;1.90&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;But all five are trend followers tested on the same rising market, and the three I took back to 2004 (UT Bot, Hull Suite, TOTT) all looked much weaker before 2020. A higher number here mostly means the strategy stays long longer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Risk structure
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No stop loss.&lt;/strong&gt; A trade closes only when the support line crosses the opposite twin line, which is slow. The worst gold M15 trade was a sell at 4,591.33 on 2 April 2026, closed at 4,818.45 on 7 April: −227 USD per 0.01 lot, about 5% of price.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Whipsaws come in runs.&lt;/strong&gt; That sell was followed by a buy that lost 165 and another sell that lost 129, −521 in twelve days:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Foy6kk70xci2o1s37fd82.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Foy6kk70xci2o1s37fd82.png" alt="TOTT strategy on XAUUSD M15, 30 March to 16 April 2026: the support line crosses the twin lines three times while gold chops between 4,600 and 4,850, each reversal a loss, Exness tick data" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Nine of the ten worst gold M15 trades were between October 2025 and August 2026&lt;/strong&gt;, losing 121 to 227 each. A fixed lot risks more as gold gets more expensive.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Swap.&lt;/strong&gt; Gold M15 trades last 175 hours on average, the longest 1,308. Raw-account swap on longs, scaled to price, takes M15 from PF 1.52 to 1.45, H1 from 1.44 to 1.33 and H4 from 1.25 to 1.10.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Losing streaks.&lt;/strong&gt; The longest on gold M15 was 10 trades. The win rate is 31–44% everywhere.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What isn't a red flag:&lt;/strong&gt; no martingale, no grid, no averaging.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Who should use it?
&lt;/h2&gt;

&lt;p&gt;If you already want to be long gold and you'd like a rule for when to step aside, TOTT on M15 or H1 is a reasonable, slow filter. It cut the worst stretches of buy and hold and kept most of the upside since 2020. As a long + short system with the defaults, it lost on most forex, its short side lost money on every market that trended up, and its best gold result broke even for sixteen years before 2020. I wouldn't run it as an automated strategy.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I couldn't verify
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TradingView's own report.&lt;/strong&gt; My numbers come from my port. I didn't export TradingView's strategy tester results to compare trade by trade.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Turkish stocks.&lt;/strong&gt; OTT was designed for BIST shares, often on daily bars. I only had forex, gold and Bitcoin ticks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Forex swap.&lt;/strong&gt; Not included in the forex numbers. It wouldn't rescue PF 0.79.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bitcoin before 2024.&lt;/strong&gt; Under three years of Exness BTC ticks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Daily candles.&lt;/strong&gt; Mine close at UTC midnight; TradingView forex daily bars usually close at 17:00 New York. With 10–19 trades per D1 cell, it doesn't matter much.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Bottom line
&lt;/h2&gt;

&lt;p&gt;The TradingView TOTT strategy doesn't repaint, and with default settings it made money on gold (M15 PF 1.52) and USDJPY since 2020 almost entirely from the long side, then broke even on gold from 2004 to 2019. The twin line doesn't change that. It's a slow trend filter, not an edge.&lt;/p&gt;

&lt;p&gt;This is part of a series where I take the most-boosted open-source TradingView strategies, port them exactly and test them on broker ticks with real costs. The &lt;a href="https://moonthetrain.com/lab/tradingview-ut-bot-strategy-backtest" rel="noopener noreferrer"&gt;UT Bot backtest&lt;/a&gt; uses the same data if you want to compare.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm not affiliated with TradingView, KivancOzbilgic or Anıl Özekşi. Past results, including backtests, don't guarantee future results.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>backtesting</category>
      <category>trading</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>TradingView UT Bot Strategy: Heikin Ashi Backtest Is Fake</title>
      <dc:creator>Truong Pham | Moon The Train</dc:creator>
      <pubDate>Tue, 17 Nov 2026 01:20:06 +0000</pubDate>
      <link>https://dev.to/moonthetrain/tradingview-ut-bot-strategy-heikin-ashi-backtest-is-fake-5bb0</link>
      <guid>https://dev.to/moonthetrain/tradingview-ut-bot-strategy-heikin-ashi-backtest-is-fake-5bb0</guid>
      <description>&lt;p&gt;&lt;strong&gt;The short version.&lt;/strong&gt; This TradingView UT Bot strategy backtest starts with the Heikin Ashi trap: on an HA chart the strategy looks like a money machine, and at real prices it isn't. It also covers the settings and repainting. The script is UT Bot Strategy by QuantNomad, one of the most-boosted open-source strategies on TradingView. I ported it line for line to Python and ran it on Exness tick data with real spread and commission: five forex and gold markets from 2020 to 2026, Bitcoin from 2024, and gold back to 2004.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Heikin Ashi chart backtest is fake.&lt;/strong&gt; Put the strategy on a Heikin Ashi chart and it shows PF 8.6 to 11.5 with 65–69% winners on every market and timeframe I tried (gold, EURUSD, Bitcoin, M5 to H4). Fill the same signals at real prices and it's PF 0.90 to 1.19 with 35–38% winners. The table and the equity chart below show both side by side.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Forex lost money on every timeframe.&lt;/strong&gt; EURUSD, GBPUSD, NZDUSD and USDJPY: profit factor 0.52 to 1.00 from M5 to D1 after costs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gold H4 is the only real positive.&lt;/strong&gt; PF 1.17 on 1,219 trades, +2,245 USD per 0.01 lot. But 2020 to 2022 lost money, and the ten best trades made more than the whole result.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gold 2004–2019, data I didn't use to pick H4: PF 1.00.&lt;/strong&gt; Sixteen years of break-even.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;M5 and M15 lose everywhere.&lt;/strong&gt; About 35–40 trades a day, and the spread eats all of it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My verdict: UT Bot is a plain ATR trailing stop that flips long and short. It doesn't have an edge on its own. If you've seen a UT Bot backtest with a 70–90% win rate, check the chart type first.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the UT Bot strategy on TradingView?
&lt;/h2&gt;

&lt;p&gt;It's a trailing stop that sits one ATR away from price and flips the trade when a candle closes on the other side of it. The &lt;a href="https://www.tradingview.com/script/VKMgZdYr/" rel="noopener noreferrer"&gt;UT Bot Strategy&lt;/a&gt; page is QuantNomad's strategy version of the "UT Bot" indicator by Yo_adriiiiaan, which credits HPotter for the idea. It's dated 15 November 2019, Pine v4, and had 9,114 boosts when I checked in November 2026. The "UT Bot Strategy with Backtesting Range" by the same author has identical rules plus a date filter, so this review covers both.&lt;/p&gt;

&lt;p&gt;Three inputs: &lt;strong&gt;Key Value&lt;/strong&gt; (default 1), &lt;strong&gt;ATR Period&lt;/strong&gt; (default 10) and a checkbox &lt;strong&gt;Signals from Heikin Ashi Candles&lt;/strong&gt; (off). Here's the core of the Pine code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;xATR  = atr(c)
nLoss = a * xATR
xATRTrailingStop := iff(src &amp;gt; nz(xATRTrailingStop[1], 0) and src[1] &amp;gt; nz(xATRTrailingStop[1], 0), max(nz(xATRTrailingStop[1]), src - nLoss),
   iff(src &amp;lt; nz(xATRTrailingStop[1], 0) and src[1] &amp;lt; nz(xATRTrailingStop[1], 0), min(nz(xATRTrailingStop[1]), src + nLoss),
   iff(src &amp;gt; nz(xATRTrailingStop[1], 0), src - nLoss, src + nLoss)))
...
buy  = src &amp;gt; xATRTrailingStop and crossover(ema(src, 1), xATRTrailingStop)
sell = src &amp;lt; xATRTrailingStop and crossover(xATRTrailingStop, ema(src, 1))
strategy.entry("long",   true, when = buy)
strategy.entry("short", false, when = sell)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In plain words: while price stays above the line, the line moves up to &lt;code&gt;close − Key × ATR&lt;/code&gt; and never moves down. When a close drops below it, the line jumps above price and starts following it down. Each crossing is a buy or a sell. &lt;code&gt;ema(src, 1)&lt;/code&gt; is just the close itself. There's no stop loss or take profit. The line &lt;em&gt;is&lt;/em&gt; the stop, but it's only checked at the candle close, and the strategy is always in the market, long or short.&lt;/p&gt;

&lt;p&gt;Here's what that looks like on gold H4 with the defaults:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F23d6j7u70x8t4ptjvaws.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F23d6j7u70x8t4ptjvaws.png" alt="UT Bot strategy on XAUUSD H4 candles, 25 Aug to 20 Oct 2025, default Key 1 and ATR 10: ATR trailing stop line in green below price and red above price, with 15 buy and 15 sell signals during a rally from 3,350 to 4,350, Exness tick data" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Gold went from about 3,350 to 4,350 in those eight weeks. UT Bot still flipped short 15 times, because a stop one ATR away gets hit by any normal pullback. The longs made +557 USD per 0.01 lot, the shorts lost 387, so it kept +171 of a 1,000-dollar move.&lt;/p&gt;

&lt;p&gt;In a range it's worse:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxji8rdwwow2wnukjpxv2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxji8rdwwow2wnukjpxv2.png" alt="UT Bot strategy on XAUUSD H4 in a sideways market, 28 Jul to 15 Aug 2025: the trailing stop sits close to price and most of the 12 signals reverse at a loss" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Twelve trades in three weeks, net −234. That's the whole pattern of this strategy in two pictures.&lt;/p&gt;

&lt;h2&gt;
  
  
  Should you use UT Bot on Heikin Ashi candles?
&lt;/h2&gt;

&lt;p&gt;Use the checkbox if you like, but don't put the strategy on a Heikin Ashi chart. The author says the same thing on the script page: "Do not add this strategy to HA candles, use usual candles and this checkbox." This is where most of the amazing UT Bot backtests on YouTube come from, so it's worth showing why.&lt;/p&gt;

&lt;p&gt;Heikin Ashi candles aren't real prices. The HA open is the average of the previous HA open and close, so it lags the market. When the strategy runs on an HA chart, TradingView fills the orders at those HA prices unless you change the fill setting in the strategy properties. So the backtest buys at a price that's usually below where the market actually was, and sells above it. I ran the same signals both ways, no costs, as TradingView shows by default:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;No costs&lt;/th&gt;
&lt;th&gt;Strategy on an HA chart&lt;/th&gt;
&lt;th&gt;Same signals at real prices&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;XAUUSD H1&lt;/td&gt;
&lt;td&gt;PF 11.26, 67% winners&lt;/td&gt;
&lt;td&gt;PF 1.12, 36% winners&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XAUUSD H4&lt;/td&gt;
&lt;td&gt;PF 10.81, 68%&lt;/td&gt;
&lt;td&gt;PF 1.19, 38%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EURUSD M15&lt;/td&gt;
&lt;td&gt;PF 9.99, 67%&lt;/td&gt;
&lt;td&gt;PF 0.94, 36%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EURUSD H4&lt;/td&gt;
&lt;td&gt;PF 11.52, 69%&lt;/td&gt;
&lt;td&gt;PF 1.05, 38%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BTCUSD M5&lt;/td&gt;
&lt;td&gt;PF 9.39, 66%&lt;/td&gt;
&lt;td&gt;PF 1.04, 36%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BTCUSD H1&lt;/td&gt;
&lt;td&gt;PF 10.15, 66%&lt;/td&gt;
&lt;td&gt;PF 1.01, 36%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Exness ticks, gold and EURUSD Jan 2020 – Sep 2026, BTCUSD Jan 2024 – Nov 2026, Key 1 and ATR 10.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It doesn't matter what market or timeframe you pick. The HA chart turns a coin flip into a money printer, and none of that money exists:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsnshzkgyu3ojf5hjpu8v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsnshzkgyu3ojf5hjpu8v.png" alt="UT Bot strategy equity on XAUUSD H1, 2020 to 2026, no costs: on a Heikin Ashi chart it reaches +35,129 USD per 0.01 lot with PF 11.3, while the same signals filled at real prices make +2,607 with PF 1.12" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And the checkbox, which reads the HA close but trades at real prices, doesn't rescue anything either. After costs: gold H1 1.10, gold H4 1.18, EURUSD M5 to H1 0.70 to 0.85, BTCUSD M5 to H4 0.90 to 0.98.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does UT Bot repaint?
&lt;/h2&gt;

&lt;p&gt;No, not on normal candles. The strategy decides at the bar close and fills at the next bar's open. The Heikin Ashi option uses &lt;code&gt;security()&lt;/code&gt; on the same timeframe with &lt;code&gt;lookahead = false&lt;/code&gt;, so it doesn't look ahead on historical bars either. The line on the live, unfinished candle can move while the candle is open, which is why the signal sometimes appears and disappears in real time. The strategy only acts once the bar closes. The thing that misleads people isn't repainting. It's the HA chart fills above.&lt;/p&gt;

&lt;h2&gt;
  
  
  What does the author claim?
&lt;/h2&gt;

&lt;p&gt;Nothing about performance. QuantNomad says they took Yo_adriiiiaan's code, cleaned it up, moved it to Pine v4, made a strategy from it and added the Heikin Ashi checkbox. There are no profit claims, no suggested market and no suggested timeframe. So I tested the defaults across everything I had.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I tested it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Port:&lt;/strong&gt; Python, line for line, including Pine's &lt;code&gt;nz(stop[1], 0)&lt;/code&gt; start-up and the RMA-based &lt;code&gt;atr()&lt;/code&gt;. Signals at the bar close, fills at the next bar's open, stop-and-reverse like &lt;code&gt;strategy.entry&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data:&lt;/strong&gt; Exness Raw Spread tick archives for XAUUSD, EURUSD, GBPUSD, USDJPY and NZDUSD, January 2020 to September 2026. BTCUSD from January 2024 to November 2026, which is all the tick history I have for it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Costs:&lt;/strong&gt; buys fill at the real ask on the first tick of the bar, sells at the bid, plus 3.5 USD per lot per side on forex and gold, 1 USD per BTC per side on Bitcoin. Swap gets its own line further down.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Older gold data:&lt;/strong&gt; Dukascopy M1 bars via Tickstory, 2004 to July 2026, spread from the data, swap on longs scaled to the gold price of the time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Size:&lt;/strong&gt; fixed, no compounding. Gold in USD per 0.01 lot (one ounce), forex in pips, Bitcoin in USD per 1 BTC.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Is the TradingView backtest accurate?
&lt;/h2&gt;

&lt;p&gt;The signals, yes. The money, no, and less so the lower the timeframe. The script sets no commission and TradingView's tester can't model spread or swap (I went through this in the &lt;a href="https://moonthetrain.com/lab/tradingview-supertrend-strategy-backtest" rel="noopener noreferrer"&gt;SuperTrend backtest&lt;/a&gt;). UT Bot trades a lot, so this matters more than usual:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Default settings, long + short&lt;/th&gt;
&lt;th&gt;Trades&lt;/th&gt;
&lt;th&gt;PF, no costs&lt;/th&gt;
&lt;th&gt;PF, real costs&lt;/th&gt;
&lt;th&gt;Net, no costs → real&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Gold M5&lt;/td&gt;
&lt;td&gt;61,372&lt;/td&gt;
&lt;td&gt;1.00&lt;/td&gt;
&lt;td&gt;0.90&lt;/td&gt;
&lt;td&gt;+286 → −9,527 USD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gold H4&lt;/td&gt;
&lt;td&gt;1,219&lt;/td&gt;
&lt;td&gt;1.19&lt;/td&gt;
&lt;td&gt;1.17&lt;/td&gt;
&lt;td&gt;+2,437 → +2,245 USD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EURUSD M5&lt;/td&gt;
&lt;td&gt;68,889&lt;/td&gt;
&lt;td&gt;0.90&lt;/td&gt;
&lt;td&gt;0.66&lt;/td&gt;
&lt;td&gt;−17,660 → −76,718 pips&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;USDJPY M15&lt;/td&gt;
&lt;td&gt;20,362&lt;/td&gt;
&lt;td&gt;1.00&lt;/td&gt;
&lt;td&gt;0.83&lt;/td&gt;
&lt;td&gt;+587 → −26,370 pips&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BTCUSD M5&lt;/td&gt;
&lt;td&gt;36,295&lt;/td&gt;
&lt;td&gt;1.02&lt;/td&gt;
&lt;td&gt;0.90&lt;/td&gt;
&lt;td&gt;+78,215 → −384,201 USD&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;On a TradingView-style test, gold M5 and BTC M5 look like small winners. With the spread they're the worst results in the whole study.&lt;/p&gt;

&lt;h2&gt;
  
  
  The results
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Profit factor after spread and commission, default Key 1 / ATR 10:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuw1w29z73k2mrwzju5f4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuw1w29z73k2mrwzju5f4.png" alt="UT Bot strategy profit factor after costs by symbol and timeframe, long plus short and long only, XAUUSD USDJPY EURUSD GBPUSD NZDUSD BTCUSD, M5 to D1, Exness Raw Spread ticks 2020 to 2026" width="800" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Red everywhere below H1. Forex stays red on every timeframe. The blue cells are gold H4/D1 and Bitcoin D1, and the Bitcoin D1 cell has 109 trades in under three years, which is too few to trust.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gold (XAUUSD Raw Spread), 29 Jan 2020 – Sep 2026, before swap:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timeframe&lt;/th&gt;
&lt;th&gt;Direction&lt;/th&gt;
&lt;th&gt;Trades&lt;/th&gt;
&lt;th&gt;Win rate&lt;/th&gt;
&lt;th&gt;PF&lt;/th&gt;
&lt;th&gt;Net&lt;/th&gt;
&lt;th&gt;Max drawdown&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;M5&lt;/td&gt;
&lt;td&gt;long + short&lt;/td&gt;
&lt;td&gt;61,372&lt;/td&gt;
&lt;td&gt;33.1%&lt;/td&gt;
&lt;td&gt;0.90&lt;/td&gt;
&lt;td&gt;−9,527&lt;/td&gt;
&lt;td&gt;11,026&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M15&lt;/td&gt;
&lt;td&gt;long + short&lt;/td&gt;
&lt;td&gt;19,483&lt;/td&gt;
&lt;td&gt;34.2%&lt;/td&gt;
&lt;td&gt;0.93&lt;/td&gt;
&lt;td&gt;−4,100&lt;/td&gt;
&lt;td&gt;4,383&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;H1&lt;/td&gt;
&lt;td&gt;long + short&lt;/td&gt;
&lt;td&gt;4,565&lt;/td&gt;
&lt;td&gt;35.7%&lt;/td&gt;
&lt;td&gt;1.04&lt;/td&gt;
&lt;td&gt;+931&lt;/td&gt;
&lt;td&gt;1,099&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;H4&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;long + short&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1,219&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;37.2%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.17&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+2,245&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;809&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;H4&lt;/td&gt;
&lt;td&gt;long only&lt;/td&gt;
&lt;td&gt;609&lt;/td&gt;
&lt;td&gt;39.2%&lt;/td&gt;
&lt;td&gt;1.38&lt;/td&gt;
&lt;td&gt;+2,413&lt;/td&gt;
&lt;td&gt;816&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D1&lt;/td&gt;
&lt;td&gt;long + short&lt;/td&gt;
&lt;td&gt;239&lt;/td&gt;
&lt;td&gt;42.3%&lt;/td&gt;
&lt;td&gt;1.07&lt;/td&gt;
&lt;td&gt;+459&lt;/td&gt;
&lt;td&gt;1,807&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Buy and hold&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;+2,591&lt;/td&gt;
&lt;td&gt;1,579&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Net and drawdown in USD per 0.01 lot, drawdown on open equity. "Long only" isn't a script setting; I added it to see where the money came from.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0uv2sdwfo8ensus66enk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0uv2sdwfo8ensus66enk.png" alt="UT Bot strategy equity on XAUUSD, M15 H1 and H4, long plus short and H4 long only, versus buy and hold gold, Jan 2020 to Sep 2026, Exness Raw Spread ticks, spread and commission included, swap not included" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The shorts lost money on gold on every timeframe. On H4 they cost 168, so the long-only version did slightly better than the default, and neither beat buying gold and holding it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is the gold H4 result real?
&lt;/h2&gt;

&lt;p&gt;Probably not, or at least not in a way you could count on. Four things point the same way:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It all came from two years.&lt;/strong&gt; Gold H4 by exit year: 2020 PF 0.96, 2021 0.97, 2022 0.84, 2023 1.20, 2024 0.98, 2025 1.35, 2026 1.38. The 2025–2026 profit (+2,380) is bigger than the six-and-a-half-year total.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A handful of trades carry it.&lt;/strong&gt; The ten best trades made +2,460. The other 1,209 trades lost 216 together.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Random timing comes close.&lt;/strong&gt; I slid the strategy's own long/short pattern to a random point in time, 300 times. Same trades, same holding times, no link to price. The real result (+2,245) beat most copies (median −3), but 6.6% of the random copies did as well or better. Gold H1 was weaker: 19% of random copies beat it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Before 2020 it broke even.&lt;/strong&gt; Below.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Does it work on gold before 2020?
&lt;/h2&gt;

&lt;p&gt;No. I ran the default settings on Dukascopy gold from 2004 to 2019, a period I hadn't looked at when choosing H4. The spread in that data is wider than an Exness Raw account, so the low timeframes get hit even harder, but H4 and D1 shouldn't care much.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Gold, 2004–2019&lt;/th&gt;
&lt;th&gt;Trades&lt;/th&gt;
&lt;th&gt;PF after swap&lt;/th&gt;
&lt;th&gt;Summed return&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;M5 long + short&lt;/td&gt;
&lt;td&gt;134,789&lt;/td&gt;
&lt;td&gt;0.61&lt;/td&gt;
&lt;td&gt;−4,421%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M15 long + short&lt;/td&gt;
&lt;td&gt;42,685&lt;/td&gt;
&lt;td&gt;0.74&lt;/td&gt;
&lt;td&gt;−1,523%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;H1 long + short&lt;/td&gt;
&lt;td&gt;10,297&lt;/td&gt;
&lt;td&gt;0.89&lt;/td&gt;
&lt;td&gt;−333%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;H4 long + short&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;2,694&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.00&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−11.5%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;H4 long only&lt;/td&gt;
&lt;td&gt;1,347&lt;/td&gt;
&lt;td&gt;1.05&lt;/td&gt;
&lt;td&gt;+50%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D1 long only&lt;/td&gt;
&lt;td&gt;284&lt;/td&gt;
&lt;td&gt;1.16&lt;/td&gt;
&lt;td&gt;+67%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Fixed size, no compounding. "Summed return" adds each trade's profit as a percent of its entry price. Gold itself rose 266% over the period.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgsezsph1trkwa50av34a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgsezsph1trkwa50av34a.png" alt="Gold price on a log scale and cumulative UT Bot H4 return, long plus short and long only, 2004 to 2026: the default version is flat to negative from 2004 until the 2025 rally, Dukascopy data with price-scaled swap" width="800" height="528"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The long-only line made a little while gold was rising (2004–2011) and gave some back after. The default long + short line went nowhere for sixteen years and was still negative in 2024. Only the 2025 rally pulled it up.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are the best UT Bot settings?
&lt;/h2&gt;

&lt;p&gt;There aren't any that hold up. I ran Key 0.5, 1, 1.5, 2, 3 and 4 against ATR 1, 3, 5, 10, 14, 20 and 50, with and without the Heikin Ashi checkbox. That's 84 combinations per market and timeframe, long + short, all after costs:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Market&lt;/th&gt;
&lt;th&gt;Combos with PF &amp;gt; 1&lt;/th&gt;
&lt;th&gt;Profitable in both halves&lt;/th&gt;
&lt;th&gt;Median PF&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;XAUUSD M15 (long + short)&lt;/td&gt;
&lt;td&gt;37 / 84&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;0.98&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XAUUSD H1&lt;/td&gt;
&lt;td&gt;76 / 84&lt;/td&gt;
&lt;td&gt;39&lt;/td&gt;
&lt;td&gt;1.08&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XAUUSD H4&lt;/td&gt;
&lt;td&gt;84 / 84&lt;/td&gt;
&lt;td&gt;48&lt;/td&gt;
&lt;td&gt;1.18&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EURUSD M15&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0 / 84&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0.84&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EURUSD H1&lt;/td&gt;
&lt;td&gt;5 / 84&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;0.87&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;USDJPY H1&lt;/td&gt;
&lt;td&gt;57 / 84&lt;/td&gt;
&lt;td&gt;42&lt;/td&gt;
&lt;td&gt;1.03&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NZDUSD H1 and H4&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0 / 84&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0.87&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BTCUSD H1&lt;/td&gt;
&lt;td&gt;9 / 84&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;0.95&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;"Both halves" = profitable in the first and in the second half of the data. Halves for gold are Jan 2020 – May 2023 and May 2023 – Sep 2026.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Gold H4 looks great until you split it. Here are the 42 settings without Heikin Ashi, each half on its own:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1knortbb4a70v0qb8suf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1knortbb4a70v0qb8suf.png" alt="UT Bot strategy settings grid on XAUUSD H4, Key value 0.5 to 4 against ATR period 1 to 50, profit factor after costs in two halves, Jan 2020 to May 2023 and May 2023 to Sep 2026: Key 3 and 4 reach 2.0 to 2.4 in the second half but 0.73 to 1.24 in the first" width="800" height="352"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A bigger Key (3 or 4) means a looser stop, so the strategy stays in the trend longer. That's exactly what paid in the 2024–2026 rally (PF mostly 1.7 to 2.4). In 2020 to mid-2023, when gold chopped around, the same settings made 0.73 to 1.24. Key 4 with ATR 14 went from 0.73 to 2.06. If you optimize UT Bot on recent gold data you'll pick a big Key, and you'll be picking the last rally.&lt;/p&gt;

&lt;p&gt;On 2004–2019 gold the grid says the same: median PF 1.02 on H4 and 0.97 on H1, and only a few settings made money in both 2004–2011 and 2012–2019.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does it compare with Hull Suite, PMax and SuperTrend?
&lt;/h2&gt;

&lt;p&gt;It's the weakest of the four on gold. Same Exness data, same costs, default settings, long + short:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Gold, Jan 2020 – Sep 2026&lt;/th&gt;
&lt;th&gt;H1 PF&lt;/th&gt;
&lt;th&gt;H4 PF&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;UT Bot&lt;/td&gt;
&lt;td&gt;1.04&lt;/td&gt;
&lt;td&gt;1.17&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://moonthetrain.com/lab/tradingview-hull-suite-strategy-backtest" rel="noopener noreferrer"&gt;Hull Suite&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;1.28&lt;/td&gt;
&lt;td&gt;1.25&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://moonthetrain.com/lab/tradingview-pmax-strategy-backtest" rel="noopener noreferrer"&gt;PMax&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;1.37&lt;/td&gt;
&lt;td&gt;0.98&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SuperTrend&lt;/td&gt;
&lt;td&gt;1.09&lt;/td&gt;
&lt;td&gt;1.90&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All four are trend followers. The difference is mostly how far the stop sits from price, and UT Bot's default of one ATR is the tightest.&lt;/p&gt;

&lt;h2&gt;
  
  
  Risk structure
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No stop loss beyond the line, and the line only counts at the close.&lt;/strong&gt; The worst gold H4 trade was a buy at 4,725.86 on 20 March 2026, closed at 4,553.56 twelve hours later: −172 USD per 0.01 lot, after being 249 underwater.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Whipsaws come in pairs.&lt;/strong&gt; On 29 January 2026 a short at 5,182.88 lost 123, and the buy that replaced it lost 109 by the next morning.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nine of the ten worst gold H4 trades were in 2026&lt;/strong&gt;, with gold at 4,000 to 5,300. A fixed lot risks more as price rises.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Swap.&lt;/strong&gt; Gold H4 trades last 48 hours on average (longest 284). Swap on longs, scaled to price, takes gold H4 from +2,245 to +1,815 (PF 1.14).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Losing streaks.&lt;/strong&gt; The longest run of losers on gold H4 was 10 trades. The win rate is 37%. That's normal for trend following, but you need the big winners to show up, and in 2020–2022 they mostly didn't.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What isn't a red flag:&lt;/strong&gt; no martingale, no grid, no averaging.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Who should use it?
&lt;/h2&gt;

&lt;p&gt;Honestly, I wouldn't trade it as a strategy. As a visual trailing stop for trades you take for other reasons, a bigger Key (2 to 4) on H4 or higher is reasonable, and it's simple to read. As an automated system with the defaults, it lost on forex, lost below H1 everywhere, and only made money on gold H4 because of the 2025–2026 rally. If you want a trend filter for gold, &lt;a href="https://moonthetrain.com/lab/tradingview-hull-suite-strategy-backtest" rel="noopener noreferrer"&gt;Hull Suite&lt;/a&gt; held up better on the same data.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I couldn't verify
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TradingView itself.&lt;/strong&gt; My HA-chart numbers come from my port, filling at HA open prices the way TradingView's default does. I didn't export TradingView's own report.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Forex swap.&lt;/strong&gt; Not included in the forex numbers. It wouldn't turn PF 0.66 into a winner.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bitcoin before 2024.&lt;/strong&gt; I only have Exness BTC ticks from January 2024, so the BTC results cover under three years.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Other brokers, stocks and indices.&lt;/strong&gt; Exness data only, forex, gold and Bitcoin only.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Daily candles.&lt;/strong&gt; Mine close at UTC midnight; TradingView forex daily bars usually close at 17:00 New York.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Bottom line
&lt;/h2&gt;

&lt;p&gt;The TradingView UT Bot strategy doesn't repaint and doesn't make money with its default settings: forex lost on every timeframe, M5 and M15 lost everywhere, and gold H4 (PF 1.17) came from one rally and broke even from 2004 to 2019. The 70–90% win-rate backtests come from running it on a Heikin Ashi chart, where it fills at prices that never traded.&lt;/p&gt;

&lt;p&gt;This is part of a series where I take the most-boosted open-source TradingView strategies, port them exactly and test them on broker ticks with real costs. The &lt;a href="https://moonthetrain.com/lab/tradingview-hull-suite-strategy-backtest" rel="noopener noreferrer"&gt;Hull Suite backtest&lt;/a&gt; uses the same data if you want to compare.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm not affiliated with TradingView, QuantNomad, Yo_adriiiiaan or HPotter. Past results, including backtests, don't guarantee future results.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>backtesting</category>
      <category>trading</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>TradingView Hull Suite Strategy: Repaint, Settings, Backtest</title>
      <dc:creator>Truong Pham | Moon The Train</dc:creator>
      <pubDate>Tue, 10 Nov 2026 01:52:35 +0000</pubDate>
      <link>https://dev.to/moonthetrain/tradingview-hull-suite-strategy-repaint-settings-backtest-5fal</link>
      <guid>https://dev.to/moonthetrain/tradingview-hull-suite-strategy-repaint-settings-backtest-5fal</guid>
      <description>&lt;p&gt;&lt;strong&gt;The short version.&lt;/strong&gt; This is a TradingView Hull Suite strategy backtest, and it also answers the repaint and settings questions. The script is Hull Suite Strategy by DashTrader, one of the most-boosted open-source strategies on TradingView. I ported it line for line to Python and ran it on 6.7 years of real Exness ticks with real spread and commission. Then I went back to 2004 on gold, using data I hadn't looked at when picking the result.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gold H1 looks great since 2020.&lt;/strong&gt; Long only (the script's default): profit factor 1.47 on 892 trades, +3,351 USD per 0.01 lot, worst drawdown 506. Buy and hold made +2,588 with a drawdown of 1,600.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It holds up under stress.&lt;/strong&gt; Shifted candle times, 39 settings, a random-timing test. On gold H1 it passed all three.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;But it needs gold to trend.&lt;/strong&gt; From 2012 to 2019, while gold fell and then went sideways, the same settings lost 11% (PF 0.95). The profit before 2020 came from 2004 to 2011.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Forex lost money.&lt;/strong&gt; EURUSD, GBPUSD and NZDUSD lost on M15 and H1. The short side never earned its keep anywhere.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I couldn't improve it.&lt;/strong&gt; Trend filters, running 12 copies and ATR position sizing all failed on years I hadn't used to pick them.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My verdict: it's a decent trend filter for gold and a poor robot. It works when the market trends and bleeds slowly when it doesn't, sometimes for years.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the Hull Suite strategy on TradingView?
&lt;/h2&gt;

&lt;p&gt;It's a Hull moving average with a simple rule: be long while the Hull line is rising, get out when it turns down. The &lt;a href="https://www.tradingview.com/script/Q9OQye4C/" rel="noopener noreferrer"&gt;Hull Suite Strategy&lt;/a&gt; page is DashTrader's conversion of InSilico's Hull Suite indicator into a strategy. Version 2 dates from 25 May 2020 and it had 15,140 boosts when I checked in November 2026.&lt;/p&gt;

&lt;p&gt;The default is a Hull MA of the close with length 55:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;HULL = WMA(2 × WMA(close, 27) − WMA(close, 55), 7)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then it compares the line with its own value two bars earlier. Here's the trading part of the Pine code (Pine v4):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HULL = Mode(modeSwitch, src, length)
if HULL[0] &amp;gt; HULL[2] and testPeriod()
    strategy.entry("buy", strategy.long)
if HULL[0] &amp;lt; HULL[2] and testPeriod()
    strategy.entry("sell", strategy.short)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One detail that's easy to miss: the &lt;strong&gt;Strategy Direction&lt;/strong&gt; input defaults to "long", and the script calls &lt;code&gt;strategy.risk.allow_entry_in(long)&lt;/code&gt;. With that set, the sell signal doesn't open a short. It just closes the long. So out of the box, Hull Suite is long or flat. Switch the input to "all" and it becomes a stop-and-reverse system that's always in the market. I tested both.&lt;/p&gt;

&lt;p&gt;There's no stop loss and no take profit. The coloured band you see on the chart is the gap between HULL and HULL[2], green when rising and red when falling. A colour flip is the signal:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq9su7vol2ngi7elfpr34.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq9su7vol2ngi7elfpr34.png" alt="Hull Suite strategy on XAUUSD H1 candles, 26 Aug to 9 Sep 2025: HMA 55 band in green when HULL is above its value two bars ago and red when below, with buy and exit arrows at each colour flip, Exness tick data" width="799" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In a clean trend like that one, you ride most of the move and hand back a little at each turn. In a range it looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqgc4oz8cdf92bit9pja5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqgc4oz8cdf92bit9pja5.png" alt="Hull Suite strategy on XAUUSD H1 in a sideways market, 14 to 25 Jul 2025: the HMA 55 band flips colour several times and three of the five buy signals exit below their entry" width="799" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Same rule, same settings. The band flips back and forth, and each flip costs the spread plus whatever the line gave back before it turned.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does Hull Suite repaint?
&lt;/h2&gt;

&lt;p&gt;No. The strategy decides at the bar close and fills at the next bar's open, and it doesn't call &lt;code&gt;security()&lt;/code&gt; on other timeframes. The band colour on the live, unfinished bar can change while the bar is open, which is why the chart can look jumpy in real time. With the default &lt;code&gt;calc_on_every_tick = false&lt;/code&gt;, the strategy ignores that and only acts once the bar has closed. What you see on a historical chart is what you'd have got, before costs.&lt;/p&gt;

&lt;h2&gt;
  
  
  What does the author claim?
&lt;/h2&gt;

&lt;p&gt;Almost nothing, and that's fair. The page has two release notes: one says it converted the indicator into a strategy for easier backtesting, the other says it added a direction setting that "defaults to long only". There are no profit claims. The only advice is inside an input label: "180-200 for floating S/R, 55 for swing entry". I tested both lengths below.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I tested it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Port:&lt;/strong&gt; I rewrote the logic in Python with Pine's weighted moving average. Pine v4 rounds 55 / 2 down to 27 and √55 to 7, and I did the same. The long-only behaviour copies &lt;code&gt;allow_entry_in&lt;/code&gt;: a sell signal closes the long and opens nothing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Main data:&lt;/strong&gt; Exness Raw Spread tick archives for XAUUSD, USDJPY, EURUSD, GBPUSD and NZDUSD, January 2020 to September 2026 (gold starts on 29 January 2020, where the archive begins).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Costs:&lt;/strong&gt; longs fill at the real ask on the first tick of the next bar, shorts at the bid, plus 3.5 USD per lot per side commission. Swap gets its own section.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Older gold data:&lt;/strong&gt; Dukascopy M1 bars via Tickstory, 2004 to July 2026, with the spread from the data, no commission, and swap scaled to the gold price of the time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Size:&lt;/strong&gt; fixed, no compounding. Gold is in USD per 0.01 lot (one ounce), forex in pips.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Is the TradingView backtest accurate?
&lt;/h2&gt;

&lt;p&gt;The signals, yes. The money, not quite. The script sets commission to 0, and TradingView's tester has no spread or swap setting, as I explained in the &lt;a href="https://moonthetrain.com/lab/tradingview-supertrend-strategy-backtest" rel="noopener noreferrer"&gt;SuperTrend backtest&lt;/a&gt;. On H1 gold the gap is small. On forex M15 it decides the result:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Test (long only)&lt;/th&gt;
&lt;th&gt;Trades&lt;/th&gt;
&lt;th&gt;PF, no costs&lt;/th&gt;
&lt;th&gt;PF, real costs&lt;/th&gt;
&lt;th&gt;Net, no costs → real&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Gold M15&lt;/td&gt;
&lt;td&gt;3,766&lt;/td&gt;
&lt;td&gt;1.15&lt;/td&gt;
&lt;td&gt;1.11&lt;/td&gt;
&lt;td&gt;+2,384 → +1,774 USD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gold H1&lt;/td&gt;
&lt;td&gt;892&lt;/td&gt;
&lt;td&gt;1.50&lt;/td&gt;
&lt;td&gt;1.47&lt;/td&gt;
&lt;td&gt;+3,490 → +3,351 USD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;USDJPY M15&lt;/td&gt;
&lt;td&gt;3,949&lt;/td&gt;
&lt;td&gt;1.10&lt;/td&gt;
&lt;td&gt;0.98&lt;/td&gt;
&lt;td&gt;+4,416 → −832 pips&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EURUSD M15&lt;/td&gt;
&lt;td&gt;3,965&lt;/td&gt;
&lt;td&gt;0.96&lt;/td&gt;
&lt;td&gt;0.86&lt;/td&gt;
&lt;td&gt;−1,332 → −4,605 pips&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NZDUSD M15&lt;/td&gt;
&lt;td&gt;3,994&lt;/td&gt;
&lt;td&gt;0.92&lt;/td&gt;
&lt;td&gt;0.76&lt;/td&gt;
&lt;td&gt;−2,083 → −7,310 pips&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;USDJPY M15 is the one to look at. Profitable on a TradingView-style test, losing once you pay the spread.&lt;/p&gt;

&lt;h2&gt;
  
  
  The results
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Gold (XAUUSD Raw Spread), 29 Jan 2020 – Sep 2026, default settings, after spread and commission, before swap:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timeframe&lt;/th&gt;
&lt;th&gt;Direction&lt;/th&gt;
&lt;th&gt;Trades&lt;/th&gt;
&lt;th&gt;Win rate&lt;/th&gt;
&lt;th&gt;PF&lt;/th&gt;
&lt;th&gt;Net&lt;/th&gt;
&lt;th&gt;Max drawdown&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;M15&lt;/td&gt;
&lt;td&gt;long only&lt;/td&gt;
&lt;td&gt;3,766&lt;/td&gt;
&lt;td&gt;34.9%&lt;/td&gt;
&lt;td&gt;1.11&lt;/td&gt;
&lt;td&gt;+1,774&lt;/td&gt;
&lt;td&gt;638&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;H1&lt;/td&gt;
&lt;td&gt;long only&lt;/td&gt;
&lt;td&gt;892&lt;/td&gt;
&lt;td&gt;39.0%&lt;/td&gt;
&lt;td&gt;1.47&lt;/td&gt;
&lt;td&gt;+3,351&lt;/td&gt;
&lt;td&gt;506&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;H1&lt;/td&gt;
&lt;td&gt;long + short&lt;/td&gt;
&lt;td&gt;1,784&lt;/td&gt;
&lt;td&gt;36.7%&lt;/td&gt;
&lt;td&gt;1.28&lt;/td&gt;
&lt;td&gt;+4,130&lt;/td&gt;
&lt;td&gt;614&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;H4&lt;/td&gt;
&lt;td&gt;long only&lt;/td&gt;
&lt;td&gt;239&lt;/td&gt;
&lt;td&gt;43.5%&lt;/td&gt;
&lt;td&gt;1.66&lt;/td&gt;
&lt;td&gt;+2,246&lt;/td&gt;
&lt;td&gt;1,146&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D1&lt;/td&gt;
&lt;td&gt;long only&lt;/td&gt;
&lt;td&gt;51&lt;/td&gt;
&lt;td&gt;37.3%&lt;/td&gt;
&lt;td&gt;2.14&lt;/td&gt;
&lt;td&gt;+1,737&lt;/td&gt;
&lt;td&gt;1,197&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Buy and hold&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;+2,588&lt;/td&gt;
&lt;td&gt;1,600&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Net and drawdown in USD per 0.01 lot. Drawdown is on open equity.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fomk1b01l81dufrhk06ae.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fomk1b01l81dufrhk06ae.png" alt="Hull Suite strategy equity on XAUUSD H1, long only and long plus short, versus buy and hold gold, Jan 2020 to Sep 2026, Exness Raw Spread ticks, spread and commission included, swap not included" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;All five markets, profit factor after costs:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4qfawuo8t952efnsh077.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4qfawuo8t952efnsh077.png" alt="Hull Suite strategy profit factor after costs by symbol and timeframe, long only and long plus short, XAUUSD USDJPY EURUSD GBPUSD NZDUSD, Jan 2020 to Sep 2026, default HMA 55" width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Gold and USDJPY made money from H1 up. Both had long trends in this window: gold went from about 1,580 to over 4,000, and the yen weakened from 108 to 150-plus. EURUSD, GBPUSD and NZDUSD lost on M15 and H1 and broke even on H4. The D1 cells look good, but with 44 to 102 trades over 6.7 years they don't mean much.&lt;/p&gt;

&lt;p&gt;Adding shorts made gold H1 more profitable (+4,130 vs +3,351) and everything else worse or flat.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is the gold H1 result real?
&lt;/h2&gt;

&lt;p&gt;On 2020–2026 data, yes. Three checks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Shifted candles.&lt;/strong&gt; I cut H1 bars at :15, :30 and :45 past the hour. Long-only PF stayed between 1.47 and 1.55.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Random timing.&lt;/strong&gt; I took the strategy's own in/out pattern and slid it to a random point in time, 300 times. Same number of trades, same holding times, but no link to the price. The real result (+3,351) beat 296 of the 300 shifted copies, whose median was +1,245. So it isn't just "long half the time in a rising market". The timing adds something.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not a few lucky trades.&lt;/strong&gt; The five biggest winners made +1,120. The other 887 trades made +2,232.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;USDJPY H1 passed the random-timing test too (+5,148 vs a median of +1,346). Gold H4 didn't: +2,246 against a median of +1,322, beaten by 15% of the random copies. That one is mostly the gold rally.&lt;/p&gt;

&lt;p&gt;And here's the catch. Split gold H1 long-only by year, as a percentage of the gold price:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Year&lt;/th&gt;
&lt;th&gt;2020&lt;/th&gt;
&lt;th&gt;2021&lt;/th&gt;
&lt;th&gt;2022&lt;/th&gt;
&lt;th&gt;2023&lt;/th&gt;
&lt;th&gt;2024&lt;/th&gt;
&lt;th&gt;2025&lt;/th&gt;
&lt;th&gt;2026 (to Sep)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Return per trade, summed&lt;/td&gt;
&lt;td&gt;+21.0%&lt;/td&gt;
&lt;td&gt;−1.1%&lt;/td&gt;
&lt;td&gt;+0.2%&lt;/td&gt;
&lt;td&gt;+9.5%&lt;/td&gt;
&lt;td&gt;+18.6%&lt;/td&gt;
&lt;td&gt;+42.8%&lt;/td&gt;
&lt;td&gt;+22.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;When gold trended (2020, 2024–2026) it made money. In 2021–2022, when gold went nowhere, it went nowhere too. That made me want a longer history.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does it work on gold before 2020?
&lt;/h2&gt;

&lt;p&gt;Only while gold was trending. I ran the same default settings on Dukascopy gold data from 2004 to 2019, a period I never touched when choosing "gold H1". Swap on longs is scaled to the price of the time, so 2005 isn't charged at 2026 rates.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Gold, 2004–2019&lt;/th&gt;
&lt;th&gt;Trades&lt;/th&gt;
&lt;th&gt;PF after swap&lt;/th&gt;
&lt;th&gt;Summed return&lt;/th&gt;
&lt;th&gt;Shorts&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;M15 long only&lt;/td&gt;
&lt;td&gt;9,405&lt;/td&gt;
&lt;td&gt;0.85&lt;/td&gt;
&lt;td&gt;−249%&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;H1 long only&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;2,181&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.15&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+118%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;H1 long + short&lt;/td&gt;
&lt;td&gt;4,361&lt;/td&gt;
&lt;td&gt;1.09&lt;/td&gt;
&lt;td&gt;+122%&lt;/td&gt;
&lt;td&gt;+4.6%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;H4 long only&lt;/td&gt;
&lt;td&gt;594&lt;/td&gt;
&lt;td&gt;1.05&lt;/td&gt;
&lt;td&gt;+38%&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;H4 long + short&lt;/td&gt;
&lt;td&gt;1,188&lt;/td&gt;
&lt;td&gt;0.96&lt;/td&gt;
&lt;td&gt;−36%&lt;/td&gt;
&lt;td&gt;−74%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D1 long only&lt;/td&gt;
&lt;td&gt;122&lt;/td&gt;
&lt;td&gt;1.35&lt;/td&gt;
&lt;td&gt;+73%&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Fixed size, no compounding. "Summed return" adds up each trade's profit as a percentage of its entry price. Gold itself rose 266% over the period.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;H1 long-only is still positive. But look at where the money came from:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsvrkz9mphm03wnzgkowo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsvrkz9mphm03wnzgkowo.png" alt="Gold price on a log scale and cumulative Hull Suite H1 long-only return, 2004 to 2026: strong gains 2004 to 2011, flat to slightly down 2012 to 2019, gains again 2020 to 2026, Dukascopy data with price-scaled swap" width="800" height="528"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;2004–2011&lt;/strong&gt;, gold's long bull run: +129%, PF 1.38.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;2012–2019&lt;/strong&gt;, gold slides from about 1,700 to 1,050 by late 2015 and then ranges: &lt;strong&gt;−11%, PF 0.95&lt;/strong&gt;. Eight years of nothing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;2020–2026&lt;/strong&gt; on the same Tickstory data: +93%, PF 1.42, close to the Exness result.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the edge is real in the sense that it catches trends better than random entries (the random-timing test gave the same answer on 2004–2019). But if gold stops trending, so does the equity curve. And shorts added almost nothing in any period. Over 16 years of H1 shorts: +4.6%.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are the best Hull Suite settings?
&lt;/h2&gt;

&lt;p&gt;On gold, the default (Hma, length 55, long only) is fine, and there's no magic setting. I ran 13 lengths from 9 to 250 across all three Hull variants (Hma, Ehma, Thma), so 39 combinations per market, on H1 and H4, after costs:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Market (long only)&lt;/th&gt;
&lt;th&gt;Combos with PF &amp;gt; 1&lt;/th&gt;
&lt;th&gt;PF &amp;gt; 1.2&lt;/th&gt;
&lt;th&gt;Profitable in 2020–22 and 2023–26&lt;/th&gt;
&lt;th&gt;Median PF&lt;/th&gt;
&lt;th&gt;Default PF&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;XAUUSD H1&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;39 / 39&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;31&lt;/td&gt;
&lt;td&gt;29&lt;/td&gt;
&lt;td&gt;1.42&lt;/td&gt;
&lt;td&gt;1.47&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XAUUSD H4&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;39 / 39&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;38&lt;/td&gt;
&lt;td&gt;38&lt;/td&gt;
&lt;td&gt;1.60&lt;/td&gt;
&lt;td&gt;1.66&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;USDJPY H1&lt;/td&gt;
&lt;td&gt;38&lt;/td&gt;
&lt;td&gt;26&lt;/td&gt;
&lt;td&gt;36&lt;/td&gt;
&lt;td&gt;1.24&lt;/td&gt;
&lt;td&gt;1.24&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;USDJPY H4&lt;/td&gt;
&lt;td&gt;39&lt;/td&gt;
&lt;td&gt;27&lt;/td&gt;
&lt;td&gt;36&lt;/td&gt;
&lt;td&gt;1.25&lt;/td&gt;
&lt;td&gt;1.28&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EURUSD H1&lt;/td&gt;
&lt;td&gt;15&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;0.95&lt;/td&gt;
&lt;td&gt;0.87&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GBPUSD H1&lt;/td&gt;
&lt;td&gt;13&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;0.97&lt;/td&gt;
&lt;td&gt;0.97&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NZDUSD H1&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;0.85&lt;/td&gt;
&lt;td&gt;0.86&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;39 combinations per row. On H1 the trade count runs from about 240 (length 250) to 5,600 (length 9).&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hma, Ehma or Thma?&lt;/strong&gt; It doesn't matter. Across every test the median profit factor was 1.02, 1.01 and 1.00.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;55 or 180–200?&lt;/strong&gt; On gold H1 since 2020, length 180 gave 1.55 and 200 gave 1.69, against 1.47 for 55. On 2004–2019 they gave 1.05 and 1.10, against 1.15. Nothing to choose between them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Short lengths are worse.&lt;/strong&gt; On 2004–2019 gold H1, lengths 9 to 30 lost money (PF 0.84 to 0.95) and 40 to 120 made money (1.11 to 1.15). Only 27 of 39 combinations had PF above 1 in that period, against 39 of 39 since 2020.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Long only beats long + short almost everywhere.&lt;/strong&gt; If you trade it, leave the direction on the default.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The market matters far more than the dials. No setting rescues NZDUSD, and none was needed on gold in a trend.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does it compare with PMax and SuperTrend?
&lt;/h2&gt;

&lt;p&gt;On gold H1 it beat both. Same Exness data, same costs, default settings, long + short so the comparison is fair:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Gold H1, 2020–Sep 2026&lt;/th&gt;
&lt;th&gt;Trades&lt;/th&gt;
&lt;th&gt;PF&lt;/th&gt;
&lt;th&gt;Net&lt;/th&gt;
&lt;th&gt;Max drawdown&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Hull Suite&lt;/td&gt;
&lt;td&gt;1,784&lt;/td&gt;
&lt;td&gt;1.28&lt;/td&gt;
&lt;td&gt;+4,130&lt;/td&gt;
&lt;td&gt;614&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://moonthetrain.com/lab/tradingview-pmax-strategy-backtest" rel="noopener noreferrer"&gt;PMax&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;448&lt;/td&gt;
&lt;td&gt;1.37&lt;/td&gt;
&lt;td&gt;+2,638&lt;/td&gt;
&lt;td&gt;1,321&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SuperTrend&lt;/td&gt;
&lt;td&gt;935&lt;/td&gt;
&lt;td&gt;1.09&lt;/td&gt;
&lt;td&gt;+1,071&lt;/td&gt;
&lt;td&gt;924&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;On gold H4 it's the other way round: SuperTrend made 1.90, Hull Suite 1.25 and PMax 0.98. None of the three is the best everywhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  Risk structure
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No stop loss.&lt;/strong&gt; A long only ends when the Hull line turns. The worst gold H1 trade lost 138 USD per 0.01 lot: bought at 4,721.70 on 20 March 2026, sold at 4,583.54 twelve hours later.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;All ten of the worst gold H1 trades happened between October 2025 and September 2026&lt;/strong&gt;, with gold at 4,000 to 5,200. A fixed lot risks more as the price rises. Size by ATR or by percent risk if you run it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Swap.&lt;/strong&gt; Gold H1 trades last 35 hours on average (longest 261). On a Raw account, swap at today's rate cuts the H1 long-only profit from +3,351 to +2,666 (+2,929 if swap scales with the price). Buy and hold pays more swap, so it drops further, to +1,288.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;In money:&lt;/strong&gt; 5,000 USD at a fixed 0.01 lot, gold H1 long only, swap included, grew to 7,666 with a worst drawdown of 7.1% on closed trades.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Losing streaks.&lt;/strong&gt; The longest run of losers on gold H1 was 13 trades. The win rate is 39%, normal for trend following.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What isn't a red flag:&lt;/strong&gt; no martingale, no grid, no averaging down.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Can you optimize Hull Suite for more profit?
&lt;/h2&gt;

&lt;p&gt;I tried, and I couldn't. I tested three common upgrades on gold H1, long only:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;A trend filter&lt;/strong&gt;: only buy when price is above a longer moving average. 24 versions: EMA 100 to 800 on H1, EMA 20 to 200 on D1, and the slope of the D1 EMA. Each version ran in two modes: block new buys only, or also close the open long when the filter turns off.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Several copies at once&lt;/strong&gt;: lengths 40, 55 and 90, each on H1 bars cut at :00, :15, :30 and :45. That's 12 copies, each with 1/12 of the account.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Position size by ATR&lt;/strong&gt;: bigger when the market is quiet, smaller when it's wild.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I skipped stop losses, take profits and trailing stops. On &lt;a href="https://moonthetrain.com/lab/tradingview-pmax-strategy-optimization" rel="noopener noreferrer"&gt;PMax&lt;/a&gt; none of the 89 exit variants I tried beat the original out of sample. Swap I left out too: that's an account choice, not a strategy change.&lt;/p&gt;

&lt;p&gt;To avoid fooling myself, I wrote the rules down before running anything. All choices were made on 2004–2015 only. The winner would then get &lt;strong&gt;one&lt;/strong&gt; run on 2016 to July 2026 (Dukascopy) and on November 2020 to September 2026 (Exness ticks), and it had to beat the default on both. The yardstick was &lt;strong&gt;MAR&lt;/strong&gt;: compounded annual return divided by the worst drawdown. Doubling the lot doubles both, so MAR measures the strategy, not the bet size.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;On the training years, only the 12 copies won:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv90cvg8seukrk3qdcefy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv90cvg8seukrk3qdcefy.png" alt="Hull Suite optimization on gold H1, training period 2004 to 2015: MAR of the default 0.40, best trend filter 0.38, median of 24 trend filters 0.24, 12 copies 0.46, 12 copies with ATR sizing 0.32" width="800" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;None of the 24 trend filters beat the default.&lt;/strong&gt; The best, D1 EMA 200, reached 0.38 against 0.40. This surprised me, because a 200 EMA filter doubled return-to-drawdown on &lt;a href="https://moonthetrain.com/lab/tradingview-pmax-strategy-optimization" rel="noopener noreferrer"&gt;PMax&lt;/a&gt;. The difference is that Hull Suite is already long only. It steps aside when gold falls, so a filter mostly makes it late at the start of each new trend.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ATR sizing made it worse&lt;/strong&gt; (0.32). It puts on the biggest size when gold is quiet, which is exactly when Hull Suite gets chopped up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;12 copies looked better&lt;/strong&gt;: MAR 0.46, drawdown 17% instead of 23%, return 7.9% a year instead of 9.4%.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Then the one run on unseen years:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Gold H1, long only&lt;/th&gt;
&lt;th&gt;Annual return&lt;/th&gt;
&lt;th&gt;Max drawdown&lt;/th&gt;
&lt;th&gt;MAR&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Dukascopy 2016 – Jul 2026, default&lt;/td&gt;
&lt;td&gt;8.8%&lt;/td&gt;
&lt;td&gt;18.9%&lt;/td&gt;
&lt;td&gt;0.465&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dukascopy 2016 – Jul 2026, 12 copies&lt;/td&gt;
&lt;td&gt;8.1%&lt;/td&gt;
&lt;td&gt;16.9%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.481&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Exness Nov 2020 – Sep 2026, default&lt;/td&gt;
&lt;td&gt;14.6%&lt;/td&gt;
&lt;td&gt;18.2%&lt;/td&gt;
&lt;td&gt;0.799&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Exness Nov 2020 – Sep 2026, 12 copies&lt;/td&gt;
&lt;td&gt;12.8%&lt;/td&gt;
&lt;td&gt;16.4%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.776&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Compounded, 100% of the account per position, spread, commission and price-scaled swap included.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fau8ibna58blr7go0mlc8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fau8ibna58blr7go0mlc8.png" alt="Optimized Hull Suite versus default on gold H1 out of sample: account growth 2016 to 2026 on Dukascopy data and 2020 to 2026 on Exness ticks, default, 12 copies and 12 copies with ATR sizing, lines almost on top of each other" width="800" height="364"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The 12 copies came out 3% better on one dataset and 3% worse on the other. Month by month, at the same drawdown, the difference is noise (t = 0.30 and −0.12). So it fails the rule I set: it gives up return for a smaller drawdown at about the same rate a smaller lot would.&lt;/p&gt;

&lt;p&gt;The copies also diversify less than you'd hope. On Exness, five of the ten worst trades in the 12-copy version closed on the same afternoon, 17 June 2026, each from a different copy, when gold dropped about 150 USD in a few hours. The copies use the same idea on the same market, so they get hit together.&lt;/p&gt;

&lt;p&gt;So the edge in Hull Suite is the plain rule itself: catch gold's trends. The extra layers I tried didn't add to it. The only remaining dial is risk. A bigger lot scales profit and drawdown together. It won't make the strategy better.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who should use it?
&lt;/h2&gt;

&lt;p&gt;If you trade gold and want one line that tells you when to be long and when to stand aside, Hull Suite on H1 with the defaults is a reasonable pick, and it beat PMax and SuperTrend there over 2020–2026. Use it as a filter or as an exit for another entry. If you run it on its own, be ready for years like 2012–2019 when it goes nowhere, and keep it long only. I wouldn't use it on EURUSD, GBPUSD or NZDUSD, and I wouldn't use it below H1 anywhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I couldn't verify
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TradingView itself.&lt;/strong&gt; My "no costs" numbers come from my port with the script's defaults, not from TradingView's tester.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Forex swap.&lt;/strong&gt; It isn't in the forex numbers. On USDJPY longs it would probably have helped.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Other brokers and slippage.&lt;/strong&gt; Fills are on the first tick of the next bar, Exness data only for 2020–2026.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Daily candles.&lt;/strong&gt; Mine close at UTC midnight; TradingView's forex daily bars usually close at 17:00 New York.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stocks, indices and crypto.&lt;/strong&gt; I only tested forex and gold.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Bottom line
&lt;/h2&gt;

&lt;p&gt;The TradingView Hull Suite strategy doesn't repaint, and on gold H1 it times trends better than chance: PF 1.47 since 2020, 1.15 since 2004. But it only pays when gold trends, it lost money from 2012 to 2019, and forex lost money on M15 and H1. Trend filters, extra copies and ATR sizing didn't improve it on unseen data. Keep it long only and treat it as a trend filter, not a robot.&lt;/p&gt;

&lt;p&gt;This is part of a series where I take the most-boosted open-source TradingView strategies, port them exactly and test them on broker ticks with real costs. The &lt;a href="https://moonthetrain.com/lab/tradingview-pmax-strategy-backtest" rel="noopener noreferrer"&gt;PMax backtest&lt;/a&gt; uses the same data and the same five markets if you want to compare.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm not affiliated with TradingView, DashTrader or InSilico. Past results, including backtests, don't guarantee future results.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>backtesting</category>
      <category>trading</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>QuantDinger Jev Filter Backtest: 0 of 1,324</title>
      <dc:creator>Truong Pham | Moon The Train</dc:creator>
      <pubDate>Mon, 02 Nov 2026 06:37:46 +0000</pubDate>
      <link>https://dev.to/moonthetrain/quantdinger-jev-filter-backtest-0-of-1324-32l3</link>
      <guid>https://dev.to/moonthetrain/quantdinger-jev-filter-backtest-0-of-1324-32l3</guid>
      <description>&lt;p&gt;&lt;strong&gt;Does QuantDinger's Jev filter help?&lt;/strong&gt; In my replay it never got the chance. With the platform's default settings, Jev's answers didn't clear the confidence bar once in 1,324 requests, so every trade went through exactly as if the filter were off. When I removed the thresholds and let Jev's own answers decide, it did no better than blocking trades at random.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I ran this
&lt;/h2&gt;

&lt;p&gt;In &lt;a href="https://moonthetrain.com/lab/quantdinger-jev-trade-filter" rel="noopener noreferrer"&gt;part 4&lt;/a&gt; I read QuantDinger's Jev gate and ended on a complaint: it only runs on live strategies, so nobody can backtest it. That wasn't quite true. The gate only needs a JSON state and six answers from Jev, and the &lt;a href="https://moonthetrain.com/lab/jev-does-not-remember-the-past" rel="noopener noreferrer"&gt;Polymarket memory test&lt;/a&gt; showed Jev doesn't recall how past events turned out. So I rebuilt the state for every historical signal, asked Jev, and applied QuantDinger's own rule to the answers.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I rebuilt the gate
&lt;/h2&gt;

&lt;p&gt;I didn't retype anything I could import. From QuantDinger at commit &lt;code&gt;96cec2d&lt;/code&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Piece&lt;/th&gt;
&lt;th&gt;Where it came from&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;The six questions and their choices&lt;/td&gt;
&lt;td&gt;parsed straight out of &lt;code&gt;ai_decision_filter.py&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RSI, MACD, ATR, moving averages, support/resistance&lt;/td&gt;
&lt;td&gt;QuantDinger's own &lt;code&gt;technical_indicators.py&lt;/code&gt;, imported&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Order budget&lt;/td&gt;
&lt;td&gt;their &lt;code&gt;order_budget.py&lt;/code&gt;, imported&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The state sent to Jev&lt;/td&gt;
&lt;td&gt;a line-by-line copy of &lt;code&gt;ai_decision_context.py&lt;/code&gt;; the only change is that "now" is the signal's time, not today&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Answer checks and the pass rule&lt;/td&gt;
&lt;td&gt;a line-by-line copy of &lt;code&gt;_evaluate_jev()&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The request body is the same one the platform sends (&lt;code&gt;model&lt;/code&gt;, &lt;code&gt;state&lt;/code&gt;, &lt;code&gt;questions&lt;/code&gt;) to the same endpoint, with &lt;code&gt;jev-latest&lt;/code&gt;, which answered as &lt;strong&gt;jev-1.14.0&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The strategy is QuantDinger's official example, &lt;code&gt;strategy_v2_dual_ema_long.py&lt;/code&gt;: on every bar close, if the 20-bar average is above the 50-bar average, hold 95% of equity; if not, hold nothing; 5% stop loss. While it's flat in an uptrend it asks to enter on every bar, so a rejected entry gets asked again an hour later. Exits never go through the gate, same as the platform.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Data&lt;/th&gt;
&lt;th&gt;Period&lt;/th&gt;
&lt;th&gt;Trades without the gate&lt;/th&gt;
&lt;th&gt;Return&lt;/th&gt;
&lt;th&gt;Max drawdown&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;BTC 1h&lt;/td&gt;
&lt;td&gt;Exness BTCUSD ticks, shown to Jev as &lt;code&gt;BTC/USDT&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;30 Apr 2024 – 11 Oct 2026&lt;/td&gt;
&lt;td&gt;246&lt;/td&gt;
&lt;td&gt;−20.7%&lt;/td&gt;
&lt;td&gt;−53.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gold 1h&lt;/td&gt;
&lt;td&gt;Exness XAUUSD ticks&lt;/td&gt;
&lt;td&gt;17 Jun 2020 – 5 Oct 2026&lt;/td&gt;
&lt;td&gt;416&lt;/td&gt;
&lt;td&gt;+96.2%&lt;/td&gt;
&lt;td&gt;−19.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Buys fill at the next bar's open plus the real spread, with 0.05% fees per side on BTC and 0.01% on gold. One losing strategy and one winning one, on purpose: a useful filter should cut the first's losses without wrecking the second.&lt;/p&gt;

&lt;p&gt;Before running the gated version I wrote down what would count as "the filter helps": beat the unfiltered return &lt;strong&gt;and&lt;/strong&gt; beat at least 95% of random gates that block the same share of requests.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happens with QuantDinger's defaults?
&lt;/h2&gt;

&lt;p&gt;Nothing. The filter never makes a decision.&lt;/p&gt;

&lt;p&gt;QuantDinger only trusts Jev's answer when three of the six questions (&lt;code&gt;entry_decision&lt;/code&gt;, &lt;code&gt;risk_check&lt;/code&gt;, &lt;code&gt;execution_quality&lt;/code&gt;) each come back with a &lt;code&gt;confidence&lt;/code&gt; of 0.55 or more. Below that it treats Jev as failed and hands the decision to an ordinary LLM. With no LLM configured, the trade goes through.&lt;/p&gt;

&lt;p&gt;For the 1,324 trades in the chart below (both markets, at two position sizes), all three cleared 0.55 &lt;strong&gt;zero times&lt;/strong&gt;, and &lt;code&gt;execution_quality&lt;/code&gt; never went above 0.49. Across every response I collected for this post, 41,693 of them, all three never cleared together once.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvxe7ez2pmq18r5wtpr2t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvxe7ez2pmq18r5wtpr2t.png" alt="Histograms of Jev's confidence on entry_decision, risk_check and execution_quality across 1,324 gate requests, BTC and gold 1h; execution_quality never reaches the 0.55 threshold" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Part of this is how the API answers. Jev returns a probability for each choice and a separate &lt;code&gt;confidence&lt;/code&gt; field, and they're not the same number. On one BTC entry it chose &lt;code&gt;pass&lt;/code&gt; with probability 0.60 and confidence 0.20. QuantDinger reads &lt;code&gt;confidence&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So in this replay the filter changed nothing: the same 246 BTC trades at −20.7%, the same 416 gold trades at +96.2%. If you've switched it on without an LLM, my numbers say it isn't filtering. If you have an LLM configured, that LLM is the one making the calls, not Jev. You pay one credit per check either way.&lt;/p&gt;

&lt;h2&gt;
  
  
  What does Jev actually think?
&lt;/h2&gt;

&lt;p&gt;To see Jev's own opinion, I took the thresholds out and applied the rule to its chosen answers. That's not how QuantDinger behaves; it's the most generous reading of Jev.&lt;/p&gt;

&lt;p&gt;It blocked almost everything: 99.85% of entry requests on BTC (10,396 asked) and 99.69% on gold (17,512 asked). The reason was nearly always &lt;code&gt;risk_check = block&lt;/code&gt;, on 232 of 246 BTC entries. Jev objects to putting 95% of equity into one position, which is a fair point about QuantDinger's own example, but it's a point about sizing, not about the market.&lt;/p&gt;

&lt;p&gt;Blocking that much changes the results, so the test is whether Jev picked &lt;em&gt;which&lt;/em&gt; trades to keep better than chance. I ran 1,000 random gates that block the same share of requests:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;No filter&lt;/th&gt;
&lt;th&gt;Jev decides&lt;/th&gt;
&lt;th&gt;Random gates, median (5th–95th pct)&lt;/th&gt;
&lt;th&gt;Random gates as good or better&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;BTC 1h&lt;/td&gt;
&lt;td&gt;−20.7%, 246 trades&lt;/td&gt;
&lt;td&gt;−9.1%, 16 trades, PF 0.55&lt;/td&gt;
&lt;td&gt;−1.6% (−14.7% to +20.2%)&lt;/td&gt;
&lt;td&gt;80%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gold 1h&lt;/td&gt;
&lt;td&gt;+96.2%, 416 trades&lt;/td&gt;
&lt;td&gt;+4.3%, 55 trades, PF 1.17&lt;/td&gt;
&lt;td&gt;+4.0% (−10.7% to +21.9%)&lt;/td&gt;
&lt;td&gt;48%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9ym5h377zbfkzhjljcke.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9ym5h377zbfkzhjljcke.png" alt="Distribution of 1,000 random-gate returns for BTC and gold 1h, with Jev's result and the unfiltered result marked; Jev sits inside the random spread" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On BTC, Jev lost less than the unfiltered strategy only because it was hardly ever in the market, and most coin flips did that better. On gold it threw away almost all of a +96% run and landed right on the random median. Neither result meets the bar I set beforehand.&lt;/p&gt;

&lt;h2&gt;
  
  
  With a smaller position, can it tell good trades from bad?
&lt;/h2&gt;

&lt;p&gt;The sizing objection was drowning everything else out, so I cut the position to 10% of equity and asked Jev about every trade of the unfiltered strategy once. Now it blocks about one entry in five, mostly for &lt;code&gt;signal_conflict&lt;/code&gt;, which is the market reading I actually wanted to test.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;10% size&lt;/th&gt;
&lt;th&gt;Trades passed&lt;/th&gt;
&lt;th&gt;Trades blocked&lt;/th&gt;
&lt;th&gt;Passed minus blocked, avg per trade (95% CI)&lt;/th&gt;
&lt;th&gt;AUC of P(pass) vs winning trade&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;BTC 1h&lt;/td&gt;
&lt;td&gt;197, avg −0.04%&lt;/td&gt;
&lt;td&gt;49, avg −0.07%&lt;/td&gt;
&lt;td&gt;+0.02 pts (−0.72 to +0.79)&lt;/td&gt;
&lt;td&gt;0.50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gold 1h&lt;/td&gt;
&lt;td&gt;329, avg +0.20%&lt;/td&gt;
&lt;td&gt;87, avg +0.11%&lt;/td&gt;
&lt;td&gt;+0.09 pts (−0.25 to +0.41)&lt;/td&gt;
&lt;td&gt;0.53&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6gsdzoibreofdr83dq9a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6gsdzoibreofdr83dq9a.png" alt="Difference in average return per trade between trades Jev passed and trades it blocked, with 95% confidence intervals crossing zero for BTC and gold 1h, 10% position size" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The trades it blocked weren't worse than the ones it let through. Every interval crosses zero, and an AUC of 0.50–0.53 is a coin flip. I'd set 0.55 in advance as the minimum to say Jev separates good entries from bad. It didn't get there, and its market answers (&lt;code&gt;aligned&lt;/code&gt;, &lt;code&gt;conflict&lt;/code&gt;, &lt;code&gt;favorable&lt;/code&gt;, &lt;code&gt;adverse&lt;/code&gt;) stayed between 0.47 and 0.55.&lt;/p&gt;

&lt;p&gt;That matches &lt;a href="https://moonthetrain.com/lab/can-jev-predict-bitcoin" rel="noopener noreferrer"&gt;part 5&lt;/a&gt;, where Jev read clean indicators accurately but couldn't say where Bitcoin was going next.&lt;/p&gt;

&lt;h2&gt;
  
  
  What would I do with this?
&lt;/h2&gt;

&lt;p&gt;If you run QuantDinger: don't treat the Jev filter as a safety layer. With the defaults it's off in practice, and with the thresholds removed it's a coin flip that mostly says no. The parts of the platform I'd keep relying on are the plain-code ones from &lt;a href="https://moonthetrain.com/lab/quantdinger-review" rel="noopener noreferrer"&gt;part 2&lt;/a&gt;: the order budget and the rule that exits never wait on an AI.&lt;/p&gt;

&lt;p&gt;And for any AI gate, mine included: replay it before it touches money. This whole test cost about $5 in Jev credits.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I didn't check
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The LLM fallback.&lt;/strong&gt; With an LLM configured, every decision in this replay would have gone to it. I didn't test any LLM.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One strategy.&lt;/strong&gt; It's QuantDinger's own example, on two markets, 1h only. A strategy with smaller positions and different signals could get different answers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The 10% size as a live gate.&lt;/strong&gt; I asked about each 10% trade once, but the bar-by-bar run at 10% stopped when my Jev credits ran out.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dates in the state.&lt;/strong&gt; QuantDinger sends bar timestamps, so Jev could see the date. The Polymarket test found no memory of outcomes, but I didn't test memory of price paths.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data details.&lt;/strong&gt; Volume is Exness tick count, not exchange volume. Only completed bars go into the state; the live platform may include the forming bar. No swap on gold.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Versions.&lt;/strong&gt; QuantDinger at commit &lt;code&gt;96cec2d&lt;/code&gt;, Jev 1.14.0 in early November 2026. The hosted version may be configured differently, and either side may change.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this replay, QuantDinger's Jev filter either did nothing or did no better than chance.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>trading</category>
      <category>backtesting</category>
    </item>
    <item>
      <title>We let a profitable breakout strategy flip a coin for direction. It kept making money.</title>
      <dc:creator>Truong Pham | Moon The Train</dc:creator>
      <pubDate>Sun, 01 Nov 2026 06:54:29 +0000</pubDate>
      <link>https://dev.to/moonthetrain/we-let-a-profitable-breakout-strategy-flip-a-coin-for-direction-it-kept-making-money-3emf</link>
      <guid>https://dev.to/moonthetrain/we-let-a-profitable-breakout-strategy-flip-a-coin-for-direction-it-kept-making-money-3emf</guid>
      <description>&lt;p&gt;&lt;strong&gt;Take a daily breakout strategy on gold that has been profitable for five years. Keep the exact moments it enters the market. Replace its direction with a coin flip. Keep its trade management.&lt;/strong&gt; Run it 100 times with 100 different coins. All 100 runs are profitable, median profit factor 2.06, about half the profit of the original. &lt;strong&gt;Now keep the coin flip and remove the trade management.&lt;/strong&gt; On real ticks, every single run loses.&lt;/p&gt;

&lt;p&gt;That pair of results is what this article is about. A profitable breakout system turns out to be three separable things, &lt;em&gt;when&lt;/em&gt; it trades, &lt;em&gt;which way&lt;/em&gt; it trades, and &lt;em&gt;how it handles the trade afterwards&lt;/em&gt;, and they do not contribute to the profit the way most of us assume. The rest of the post is the method, the numbers, what I think they mean, and a backtest-only EA so you can check the main result against your own broker's data (&lt;a href="https://moonthetrain.com/lab/breakout-timing-direction-management-experiment#:~:text=Downloads%3A%20repeat%20the%20experiment" rel="noopener noreferrer"&gt;free download for MT4, MT5 and cTrader&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  The question
&lt;/h2&gt;

&lt;p&gt;For two months I reverse-engineered commercial gold EAs from their trade lists, rebuilt the common engine behind a family of them as my own cBot/EA, and matched it trade for trade against the originals (195 of 195 trades over five years on one parameter set). Once the engine matched, I could start taking it apart. The first question was the obvious one:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Where does the profit come from, the entry or the management of the trade after entry?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I had a hypothesis, and it was the fashionable one: the entry barely matters. Three pieces of evidence pointed that way. Measured fifteen minutes after a fill, with no management, the strategy's entries were a coin flip: median move about zero, 44–55 % winners. A machine-learning model I trained to predict the &lt;strong&gt;direction&lt;/strong&gt; of gold over the next 100 minutes scored AUC 0.47–0.52, which is noise. The same features predicting whether a &lt;strong&gt;large move&lt;/strong&gt; was coming, in either direction, scored 0.85. So: you can tell &lt;em&gt;that&lt;/em&gt; something is about to happen, you cannot tell &lt;em&gt;which way&lt;/em&gt;, and a good exit should be able to monetise the first without the second.&lt;/p&gt;

&lt;p&gt;The hypothesis was half right. The experiment is more interesting than the hypothesis.&lt;/p&gt;

&lt;h2&gt;
  
  
  Method
&lt;/h2&gt;

&lt;p&gt;Everything runs on one dataset: XAUUSD, raw-spread account, July 2021 to October 2026, 10,000 USD, 0.1 lots scaled by price (about 0.05 lots at 4,000 USD gold). Two data modes: 1-minute bars with four ticks per bar for the 100-seed runs, and the full 257-million-tick archive with real spread for a confirmation pass.&lt;/p&gt;

&lt;p&gt;The strategy is a daily-level breakout with a rich management layer. Parameters are the published defaults of a widely sold EA family; I did not tune anything.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Rule&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Entry&lt;/td&gt;
&lt;td&gt;Daily swing highs and lows (higher than 24 bars to the left, not lower than 3 to the right). Buy stop placed 275 pips &lt;em&gt;inside&lt;/em&gt; the high, sell stop 160 pips inside the low. Up to 5 pending orders per side, 35-hour expiry. All distances scale with the price level.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stop / target&lt;/td&gt;
&lt;td&gt;Stop 3.05 % of price, target 0.725 %.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Breakeven&lt;/td&gt;
&lt;td&gt;At +0.93 % profit the stop moves to entry +0.12 %.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Trailing stop&lt;/td&gt;
&lt;td&gt;From +1.8 % profit, trail 1.8 % behind price.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pulled target&lt;/td&gt;
&lt;td&gt;When a trade is 1.6 % under water, the target is pulled to price +0.7 %: exit on the first bounce.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reversal cut&lt;/td&gt;
&lt;td&gt;If the M1 or M15 candle containing the fill closes against the trade, close it.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Filter&lt;/td&gt;
&lt;td&gt;No trading around the monthly US jobs report.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;"Management on" means all of it. "Management off" means the original stop and target only. The entry was then replaced by three alternatives, each run with management on and off:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Coin flip, full.&lt;/strong&gt; At each 15-minute bar, enter with a probability calibrated to the original's frequency (37 trades a year). Direction by coin flip. Market order.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Original timing, coin-flip direction.&lt;/strong&gt; Keep the exact instants the original's stop orders fill. At each one, with probability 0.5, open the &lt;em&gt;opposite&lt;/em&gt; trade instead, with stop and target distances mirrored.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Original timing, opposite direction.&lt;/strong&gt; Probability 1. Every breakout is faded.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Random variants run 100 seeds on bars, 10 on ticks. The generator is a deterministic xorshift that produces the same sequence in the C#, MQL5 and MQL4 builds, so seed 7 is the same experiment on every platform. Before any of this, the engine's "no change" configuration was checked to reproduce the original trade list exactly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 1 — management does not turn noise into money
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiw724s6t4cgmf17y00oh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiw724s6t4cgmf17y00oh.png" alt="Coin-flip entry, 100 seeds" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Random timing, random direction, full management: median PF &lt;strong&gt;0.95&lt;/strong&gt;, 45 % of seeds positive, median result −132 USD on 10,000. Win rate 19 %. The management layer does what it is designed to do, it cuts losers at breakeven or on the first bounce, which is why a 19 % win rate is nearly break-even rather than a catastrophe. It is not a source of profit.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgjyup36ob9lozwu49cbh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgjyup36ob9lozwu49cbh.png" alt="Coin-flip equity curves" width="799" height="444"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The blue cloud is 100 random seeds, the red line is the original strategy. No seed approaches it. Over 2025 in isolation the cloud drifts positive (median PF 1.16, 60 % of seeds), because gold rose 60 % that year and the trailing stop rode part of it. That is the market, not the method. So the first thing the experiment did was refute my own hypothesis: "any entry plus good management" does not work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 2 — timing alone is worth half the profit, even with a coin flip for direction
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnzbv3kvzzt5xcbtog6ho.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnzbv3kvzzt5xcbtog6ho.png" alt="Original timing, coin-flip direction" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Keep the 195 moments the original entered, flip a coin for direction: &lt;strong&gt;100 of 100 seeds profitable&lt;/strong&gt;, median PF 2.06, median profit +3,663 USD. Original timing, original direction: PF 2.45, +7,414. Original timing, every trade faded: PF 0.74, −409.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fewk84yd1rx24diuia9ae.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fewk84yd1rx24diuia9ae.png" alt="Original timing, three directions" width="799" height="444"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The three lines decompose the edge. With the break: +7,414. Against it: −409. Coin flip: +3,663, almost exactly the average, as arithmetic says it must be. The entry's value therefore splits into two roughly equal halves:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Timing&lt;/strong&gt; — being in the market right after a daily level breaks, when a large move is likely. This half survives the coin flip entirely. It is also the half the volatility model could predict.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Direction&lt;/strong&gt; — trading with the break rather than against it. Worth another +3,700 over five years. Real, but it is the thin half, and the fade line is what getting it wrong looks like.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note the win rates. The fade wins &lt;strong&gt;77 %&lt;/strong&gt; of its trades and loses. The coin flip wins 69 %. The original wins 61 %. Win rate ranks these three in exactly the wrong order.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 3 — management is what converts timing into money
&lt;/h2&gt;

&lt;p&gt;Same three entries, management off, stop and target only:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx6n5lc1vgi39w7rq1rj6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx6n5lc1vgi39w7rq1rj6.png" alt="Eight configurations, profit and drawdown" width="800" height="349"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Original timing, coin-flip direction, no management: median PF &lt;strong&gt;0.72&lt;/strong&gt;, median result &lt;strong&gt;−6,088 USD&lt;/strong&gt;, 6 of 100 seeds positive, median drawdown 9,738 USD on a 10,000 account. Same entries with management: +3,663, 100 of 100 seeds, drawdown 622.&lt;/p&gt;

&lt;p&gt;This is the finding. &lt;strong&gt;Trade management does not create an edge. It is the mechanism that lets you collect an edge you can only half see.&lt;/strong&gt; You know a move is coming and not its direction. Without breakeven, pulled targets and reversal cuts, the wrong-way half of your trades runs to the 3 % stop and consumes the right-way half. With them, the wrong-way half costs a fraction of a percent and the right-way half pays.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 4 — when the entry is already right, management buys drawdown with profit
&lt;/h2&gt;

&lt;p&gt;The original strategy with management off makes &lt;em&gt;more&lt;/em&gt;: +11,494 against +7,414. It also holds trades for a median 22 hours instead of 3.8, rarely reaches its 3 % stop, and takes a 2,683 USD drawdown instead of 674. Profit per unit of drawdown falls from 11.0 to 4.3. At equal drawdown you could run the managed version at roughly four times the size.&lt;/p&gt;

&lt;p&gt;Two cautions. These bars have no spread and no swap, so a 22-hour hold is free here and is not free in a live account. And the drawdown ratio, not the profit, is the number that decides position size. Which brings us to the tick data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Confirmation on 257 million real ticks
&lt;/h2&gt;

&lt;p&gt;Same account, same lots, same period, the full tick archive with real spread. Fewer seeds because each run takes longer.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Entry&lt;/th&gt;
&lt;th&gt;Management on: PF · net · DD · % runs positive&lt;/th&gt;
&lt;th&gt;Management off: PF · net · DD · % runs positive&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Coin flip, full (10 seeds, median)&lt;/td&gt;
&lt;td&gt;0.98 · −71 · 866 · 40 %&lt;/td&gt;
&lt;td&gt;0.78 · −3,302 · 4,806 · 0 %&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Original timing, coin-flip direction&lt;/strong&gt; (10 seeds, median)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.70 · +2,896 · 825 · 100 %&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;0.78 · −4,830 · 9,138 · 0 %&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Original timing, original direction&lt;/td&gt;
&lt;td&gt;2.36 · +7,292 · 674&lt;/td&gt;
&lt;td&gt;2.40 · +11,879 · 2,683&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Original timing, faded&lt;/td&gt;
&lt;td&gt;0.22 · −1,936 · 2,077&lt;/td&gt;
&lt;td&gt;0.34 · −22,998 · 23,938&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Real ticks are harsher on everything except the original with management, which is unchanged (+7,292 against +7,414 on bars). The coin-flip-direction variant keeps all 10 seeds profitable but drops from PF 2.06 to 1.70: spread and slippage come out of the wrong-way half. The fade collapses to PF 0.22. The conclusion sharpens: &lt;strong&gt;on real ticks, every run without management lost money, including all 16 random seeds.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While the ticks were loaded, I removed the management layers one at a time, original entries, original direction:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer removed&lt;/th&gt;
&lt;th&gt;Net&lt;/th&gt;
&lt;th&gt;PF&lt;/th&gt;
&lt;th&gt;Drawdown&lt;/th&gt;
&lt;th&gt;Win rate&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;none (full strategy)&lt;/td&gt;
&lt;td&gt;+7,292&lt;/td&gt;
&lt;td&gt;2.36&lt;/td&gt;
&lt;td&gt;674&lt;/td&gt;
&lt;td&gt;60 %&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;breakeven&lt;/td&gt;
&lt;td&gt;+7,793&lt;/td&gt;
&lt;td&gt;2.18&lt;/td&gt;
&lt;td&gt;674&lt;/td&gt;
&lt;td&gt;55 %&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;trailing stop&lt;/td&gt;
&lt;td&gt;+7,292&lt;/td&gt;
&lt;td&gt;2.36&lt;/td&gt;
&lt;td&gt;674&lt;/td&gt;
&lt;td&gt;60 %&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pulled target&lt;/td&gt;
&lt;td&gt;+8,092&lt;/td&gt;
&lt;td&gt;2.53&lt;/td&gt;
&lt;td&gt;1,178&lt;/td&gt;
&lt;td&gt;65 %&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;reversal cut&lt;/td&gt;
&lt;td&gt;+9,516&lt;/td&gt;
&lt;td&gt;2.62&lt;/td&gt;
&lt;td&gt;1,223&lt;/td&gt;
&lt;td&gt;80 %&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;swing trailing&lt;/td&gt;
&lt;td&gt;+7,000&lt;/td&gt;
&lt;td&gt;2.24&lt;/td&gt;
&lt;td&gt;686&lt;/td&gt;
&lt;td&gt;60 %&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;jobs-report filter&lt;/td&gt;
&lt;td&gt;+6,808&lt;/td&gt;
&lt;td&gt;2.17&lt;/td&gt;
&lt;td&gt;826&lt;/td&gt;
&lt;td&gt;59 %&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Three observations. The trailing stop &lt;strong&gt;never fires&lt;/strong&gt;: its activation level (1.8 %) lies above the take-profit (0.725 %), so the published defaults ship a dead parameter that no backtest would ever reveal. The two layers that do the work are the pulled target and the reversal cut: remove either and drawdown nearly doubles while profit &lt;em&gt;rises&lt;/em&gt;. And every layer in the table costs profit and buys drawdown. That is what trade management is for, and it is why it cannot be evaluated with a profit figure.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I take from this
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Direction is the thin half.&lt;/strong&gt; Neither the strategy's own logic nor my models predict it at these horizons. Spend the optimisation budget on &lt;em&gt;when&lt;/em&gt; to be in the market.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Win rate measures nothing here.&lt;/strong&gt; 77 % won and lost money; so did a night-scalping EA I examined that wins 96 % of its tester trades and made +605 USD on 10,000 in 5.8 years.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"Any entry plus a trailing stop" is false.&lt;/strong&gt; 100 seeds on bars, 10 on ticks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Evaluate management by drawdown.&lt;/strong&gt; Switching it off looked better on profit and was four times worse on drawdown.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check which layers actually fire.&lt;/strong&gt; One of the five in this system never did.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A related observation from the same reverse-engineering work: one EA I took apart matched its own published backtest on 90 % of entries in live trading and kept 24 % of the backtested profit. Entries identical, exit layer behaving differently live, three quarters of the money gone. Exits are where backtests and live accounts diverge.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations and the objections I expect
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;"So entries do matter."&lt;/strong&gt; Timing does, a lot; the first chart is the evidence against my own starting hypothesis. Direction matters much less than the attention it receives.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"This needs a trending market."&lt;/strong&gt; Yes. The second half of 2021 was negative for every configuration including the original. The method needs volatility, not direction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"The parameters are in-sample."&lt;/strong&gt; They are the vendor's published defaults, tuned on data that overlaps this period. I tuned nothing. The coin-flip and flipped-direction runs are, by construction, something no vendor optimised for, and they are where the result lives.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"One parameter set, one instrument."&lt;/strong&gt; Correct. The next post repeats this on H4 and H1 variants of the same engine and on the two layers that carried the table, with their parameters swept on real ticks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Bars, not ticks."&lt;/strong&gt; The 100-seed charts are bars. The tick table is not, and it says the same thing more sharply.&lt;/p&gt;

&lt;h2&gt;
  
  
  Downloads: repeat the experiment
&lt;/h2&gt;

&lt;p&gt;The engine used in every test above is available as a free, backtest-only build for cTrader, MetaTrader 5 and MetaTrader 4, with this article's settings built in. It runs in the strategy tester (backtest and optimisation); on a live or demo chart it refuses to start.&lt;/p&gt;

&lt;p&gt;Free, no account needed, one download per terminal (MT5, MT4, cTrader): &lt;strong&gt;&lt;a href="https://moonthetrain.com/lab/breakout-timing-direction-management-experiment#:~:text=Downloads%3A%20repeat%20the%20experiment" rel="noopener noreferrer"&gt;download Notus from the original article&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;To check the main result, run XAUUSD 2021–2026 with the default inputs, tick data if your broker provides it. That is the red line. Daily bars start at 00:00 UTC; on MT4/MT5 enter your broker's UTC offset if its server isn't on UTC. If your curve disagrees with mine, I want to see it in the comments.&lt;/p&gt;

&lt;p&gt;The coin-flip and management-off runs used a research build of the same engine with every layer exposed as a switch. That build isn't distributed.&lt;/p&gt;

</description>
      <category>backtesting</category>
      <category>trading</category>
      <category>algorithms</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Does Turtle Trading Still Work? What 6.7 Years Showed</title>
      <dc:creator>Truong Pham | Moon The Train</dc:creator>
      <pubDate>Wed, 28 Oct 2026 01:02:58 +0000</pubDate>
      <link>https://dev.to/moonthetrain/does-turtle-trading-still-work-what-67-years-showed-2ijm</link>
      <guid>https://dev.to/moonthetrain/does-turtle-trading-still-work-what-67-years-showed-2ijm</guid>
      <description>&lt;p&gt;&lt;strong&gt;The short version.&lt;/strong&gt; On the data I have, no: the original Turtle trading rules lost 37.9% on 11 Exness markets and 57.7% on 26, from January 2020 to September 2026, with the code checked three ways. But 6.7 years is a short window for a trend system, and the result is mostly one-sided: long trades made money in every market group, short trades lost in every group. The tempting fix, dropping the shorts, is exactly the kind of decision you can't make after seeing the results. Here's what I think the test does show, what it doesn't, and what I didn't do.&lt;/p&gt;

&lt;p&gt;This is the last of 5 parts: &lt;a href="https://dev.to/moonthetrain/turtle-trading-rules-the-1983-experiment-tested-in-2026-1iop"&gt;the 1983 experiment&lt;/a&gt;, &lt;a href="https://dev.to/moonthetrain/turtle-trading-rules-explained-n-units-breakouts-stops-25hg"&gt;the rules&lt;/a&gt;, &lt;a href="https://dev.to/moonthetrain/turtle-trading-backtest-in-python-building-the-simulator-120h"&gt;the simulator&lt;/a&gt;, &lt;a href="https://dev.to/moonthetrain/turtle-trading-backtest-results-26-markets-577-55b1"&gt;the results&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does Turtle trading still work in 2026?
&lt;/h2&gt;

&lt;p&gt;Not as published, on Exness CFDs, from 2020 to 2026. The numbers, briefly:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;11 markets&lt;/th&gt;
&lt;th&gt;26 markets&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Return&lt;/td&gt;
&lt;td&gt;−37.9%&lt;/td&gt;
&lt;td&gt;−57.7%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Max drawdown&lt;/td&gt;
&lt;td&gt;58.3%&lt;/td&gt;
&lt;td&gt;75.6%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Profit factor&lt;/td&gt;
&lt;td&gt;0.89&lt;/td&gt;
&lt;td&gt;0.83&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Long trades&lt;/td&gt;
&lt;td&gt;+$26,899&lt;/td&gt;
&lt;td&gt;+$28,279&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Short trades&lt;/td&gt;
&lt;td&gt;−$64,779&lt;/td&gt;
&lt;td&gt;−$85,989&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That's a narrow claim, and I want to keep it narrow. It says these exact rules didn't make money on these markets in this period. It doesn't say trend following is dead, and it doesn't say the 1980s results were wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lesson 1: the rules are good engineering
&lt;/h2&gt;

&lt;p&gt;The 2003 PDF is unusually complete. Every rule has a number, most have a worked example, and only six points are left open (I listed them in &lt;a href="https://dev.to/moonthetrain/turtle-trading-rules-explained-n-units-breakouts-stops-25hg"&gt;part 2&lt;/a&gt;). That made the system testable in a way most trading folklore isn't, and it meant I could write tests straight from the document's own examples.&lt;/p&gt;

&lt;p&gt;The risk side held up too. Switching off the filter, the unit limits or the drawdown rule each made the result clearly worse (in &lt;a href="https://dev.to/moonthetrain/turtle-trading-backtest-results-26-markets-577-55b1"&gt;part 4&lt;/a&gt;, the yearly loss went from −6.8% to between −10.5% and −16.2%). The layers do what they were designed to do: they cut losses when the entries aren't working.&lt;/p&gt;

&lt;p&gt;But risk management can't create an edge that the entries don't have. It only decides how much you lose while you wait for one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lesson 2: more markets only help if they have an edge
&lt;/h2&gt;

&lt;p&gt;Diversification is the standard answer to "the basket is too narrow", and it's what the original Turtles had. I tested it: 15 more markets across oil, gas, metals and six stock indices. The result went from −37.9% to −57.7%.&lt;/p&gt;

&lt;p&gt;Adding uncorrelated markets smooths the curve when each market has a small positive expectation. When the extra markets lose too, you just get more losing trades, and the shared unit limits mean the good signals compete with the bad ones for the same risk budget.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lesson 3: why I didn't just drop the shorts
&lt;/h2&gt;

&lt;p&gt;This is the one I had to think about most.&lt;/p&gt;

&lt;p&gt;Long trades made money in all five groups: forex, metals, energy, indices and bitcoin. Short trades lost in all five. 20 of the 26 markets ended the period higher than they started. So a long-only Turtle system would have looked fine on this data, and it's the obvious next step.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgk6oaqnt6jyy7lmlvoew.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgk6oaqnt6jyy7lmlvoew.png" alt="20 of 26 markets ended higher than they started, 2020 to 2026, first versus last daily close" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The problem is that I'd be choosing the rule after seeing which half of the results was good. Of course long-only looks better on a period where most markets went up: that's what the period was. Testing long-only on the same 2020–2026 data would only confirm what I'd already looked at. It proves nothing about the next six years.&lt;/p&gt;

&lt;p&gt;A fair test of that idea needs data the rules haven't seen, and the pass criteria written down before it runs. My Exness archive starts in 2020, so there's no unseen stretch left in it. I decided not to run the long-only version at all rather than run it on data I'd already looked at.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lesson 4: 6.7 years is short for a trend system
&lt;/h2&gt;

&lt;p&gt;The rules document itself warns that Turtle traders went through losing stretches of a year or two, and that the traders who did worst were the ones who started skipping signals during them. In my data the 11-market basket had four losing years out of seven, with one +40% year (2022) in the middle.&lt;/p&gt;

&lt;p&gt;A trend system lives on a few large moves. Six and a half years contains only so many of them, and which ones you get depends a lot on where the window starts. So I'd treat this as one sample, not a verdict on the method.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lesson 5: CFDs aren't the 1983 futures
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Swap.&lt;/strong&gt; Turtle positions are held for weeks. On the 11-market run, where swap is measured on just 3 markets (gold among them), swap already cost $19,499. On the other markets it's set to zero, so the real result would likely be a bit worse.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spread.&lt;/strong&gt; Paid on every entry and exit. Doubling it took another 1.7% a year off the 11-market result.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The market list.&lt;/strong&gt; The Turtles traded Treasury bonds and notes, Eurodollars, coffee, cocoa, sugar and cotton, none of which I have as CFDs. My basket is heavier in forex crosses, which spent long stretches going sideways.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Lesson 6: shorter bars make it worse, not better
&lt;/h2&gt;

&lt;p&gt;The intuitive fix for "markets are faster now" is a faster chart. The cost side says no: on gold, the spread is 0.30% of a daily N, 1.33% of an hourly N and 2.68% of a 15-minute N, and a breakout system trades much more often on short bars. Published research also finds trend effects over months, not hours. Details in &lt;a href="https://dev.to/moonthetrain/turtle-trading-rules-explained-n-units-breakouts-stops-25hg"&gt;part 2&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I didn't do
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No parameter optimisation.&lt;/strong&gt; I didn't try 30-day breakouts, 3N stops or a different add interval. With seven years of data and that many knobs, I'd find a setting that worked on 2020–2026, and it would tell me nothing about 2027.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No long-only version&lt;/strong&gt;, for the reasons above.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No Whipsaw stop&lt;/strong&gt;, the PDF's alternative half-N stop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No live trading.&lt;/strong&gt; Everything here is a simulation on archive data.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The limits of this test
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Swap measured on 3 of 26 markets; commission on commodity and index CFDs unconfirmed; both set to zero where unknown.&lt;/li&gt;
&lt;li&gt;Some contract sizes for commodities and indices unconfirmed (with N-based sizing this mostly affects lot rounding).&lt;/li&gt;
&lt;li&gt;Data gaps: UKOIL and XPTUSD have missing months; XNGUSD, JP225 and XCUUSD start in 2022–2023.&lt;/li&gt;
&lt;li&gt;One broker, one period, CFDs instead of futures.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If anything, the costs I couldn't measure would make the results a bit worse, not better.&lt;/p&gt;

&lt;h2&gt;
  
  
  So what is the Turtle system good for today?
&lt;/h2&gt;

&lt;p&gt;As a teaching system, a lot. It's the clearest example I know of a complete trading plan: what to trade, how much, when to enter, when to get out of losers, when to get out of winners, and how much total risk to carry. Volatility-based sizing and hard portfolio limits are worth copying into almost anything.&lt;/p&gt;

&lt;p&gt;As a ready-made system to switch on, not on this evidence. If I come back to it, it'll be with data the rules haven't seen and the pass mark written down first.&lt;/p&gt;

&lt;p&gt;Thanks for reading the series. There's a &lt;a href="https://youtu.be/PO_4rIQtF1I" rel="noopener noreferrer"&gt;7-minute video version on YouTube&lt;/a&gt;, with the same numbers drawn from the same data.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Research, not financial advice. Past results do not predict future results.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>backtesting</category>
      <category>trading</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>Turtle Trading Backtest Results: 26 Markets, -57.7%</title>
      <dc:creator>Truong Pham | Moon The Train</dc:creator>
      <pubDate>Tue, 27 Oct 2026 01:54:50 +0000</pubDate>
      <link>https://dev.to/moonthetrain/turtle-trading-backtest-results-26-markets-577-55b1</link>
      <guid>https://dev.to/moonthetrain/turtle-trading-backtest-results-26-markets-577-55b1</guid>
      <description>&lt;p&gt;&lt;strong&gt;The short version.&lt;/strong&gt; I ran the original Turtle trading rules, unchanged, on Exness tick data from January 2020 to September 2026. On 11 markets (forex, gold, S&amp;amp;P 500, bitcoin) a $100,000 account ended at &lt;strong&gt;$62,136 (−37.9%, max drawdown 58.3%)&lt;/strong&gt;. Switching off the filter, the unit limits or the drawdown rule made it worse; none of the variants made money. On 26 markets it got worse again: &lt;strong&gt;$42,299 (−57.7%, max drawdown 75.6%)&lt;/strong&gt;. The split by direction is the clearest finding: long trades made money in every market group, short trades lost money in every group.&lt;/p&gt;

&lt;p&gt;This is part 4 of 5. &lt;a href="https://dev.to/moonthetrain/turtle-trading-rules-explained-n-units-breakouts-stops-25hg"&gt;Part 2&lt;/a&gt; has the rules and &lt;a href="https://dev.to/moonthetrain/turtle-trading-backtest-in-python-building-the-simulator-120h"&gt;part 3&lt;/a&gt; the simulator and its checks.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup, in one paragraph
&lt;/h2&gt;

&lt;p&gt;Original rules as published in 2003: N = 20-day Wilder ATR updated on Mondays, 1% risk per unit, System 1 (20/10 days, with the filter and 55-day failsafe) and System 2 (55/20 days) each on half the capital, adds every half N up to 4 units, 2N stops, 4/6/10/12 unit limits, the 10% drawdown rule. Daily signals, fills minute by minute on Exness Raw Spread data, real spreads, one shared account. No parameter was changed or optimised. "Positions" below count one trade with all its units; profit factor is per position; drawdown is on daily equity.&lt;/p&gt;

&lt;h2&gt;
  
  
  How did Turtle trading do on 11 markets?
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;11 markets&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Markets&lt;/td&gt;
&lt;td&gt;EURUSD, GBPUSD, NZDUSD, USDJPY, AUDCAD, NZDCAD, AUDNZD, EURCHF, XAUUSD, US500, BTCUSD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Period&lt;/td&gt;
&lt;td&gt;29 Jan 2020 – 23 Sep 2026 (6.7 years)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;End equity&lt;/td&gt;
&lt;td&gt;$62,136&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Return&lt;/td&gt;
&lt;td&gt;−37.9% (−6.9% a year)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Max drawdown&lt;/td&gt;
&lt;td&gt;58.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Positions / units&lt;/td&gt;
&lt;td&gt;834 / 1,498&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Winning positions&lt;/td&gt;
&lt;td&gt;27.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Profit factor&lt;/td&gt;
&lt;td&gt;0.89&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Average win / loss&lt;/td&gt;
&lt;td&gt;+$1,392 / −$586&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Commission / swap&lt;/td&gt;
&lt;td&gt;−$3,090 / −$19,499&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5p3ardqxkb6o5eh7wzxo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5p3ardqxkb6o5eh7wzxo.png" alt="Equity of the original Turtle rules on 11 Exness markets, 2020 to 2026, with the maximum drawdown marked" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A 27% win rate with winners more than twice the size of losers is exactly what a trend system is supposed to look like. It just wasn't enough: winners need to be roughly 2.7 times the losers at that win rate to break even, and these were 2.4 times.&lt;/p&gt;

&lt;p&gt;By year, on equity at the start of each year:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;2020&lt;/th&gt;
&lt;th&gt;2021&lt;/th&gt;
&lt;th&gt;2022&lt;/th&gt;
&lt;th&gt;2023&lt;/th&gt;
&lt;th&gt;2024&lt;/th&gt;
&lt;th&gt;2025&lt;/th&gt;
&lt;th&gt;2026 (to Sep)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;−26.5%&lt;/td&gt;
&lt;td&gt;−13.8%&lt;/td&gt;
&lt;td&gt;+40.1%&lt;/td&gt;
&lt;td&gt;−37.5%&lt;/td&gt;
&lt;td&gt;+23.8%&lt;/td&gt;
&lt;td&gt;−16.6%&lt;/td&gt;
&lt;td&gt;+8.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh9robn93r1q39rzydjel.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh9robn93r1q39rzydjel.png" alt="Return by year for the 11-market basket" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By market, the money came from a few long trends and was lost in pairs that went sideways:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Made money&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Lost money&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;USDJPY&lt;/td&gt;
&lt;td&gt;+$13,589&lt;/td&gt;
&lt;td&gt;AUDCAD&lt;/td&gt;
&lt;td&gt;−$22,539&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BTCUSD&lt;/td&gt;
&lt;td&gt;+$13,359&lt;/td&gt;
&lt;td&gt;NZDCAD&lt;/td&gt;
&lt;td&gt;−$18,132&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XAUUSD&lt;/td&gt;
&lt;td&gt;+$12,927&lt;/td&gt;
&lt;td&gt;GBPUSD&lt;/td&gt;
&lt;td&gt;−$16,387&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EURUSD&lt;/td&gt;
&lt;td&gt;+$9,092&lt;/td&gt;
&lt;td&gt;NZDUSD&lt;/td&gt;
&lt;td&gt;−$13,088&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;EURCHF&lt;/td&gt;
&lt;td&gt;−$8,842&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;AUDNZD&lt;/td&gt;
&lt;td&gt;−$5,092&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;US500&lt;/td&gt;
&lt;td&gt;−$2,768&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Both systems lost: System 1 −$7,268 on 478 positions, System 1 via the 55-day failsafe −$7,182 on 108, System 2 −$23,430 on 248.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which Turtle rules actually helped?
&lt;/h2&gt;

&lt;p&gt;I switched off one rule at a time on the 11 markets. (This set was run before I switched currency conversion to real daily FX rates, so the base line is −37.5% instead of −37.9%; the difference doesn't change any comparison.)&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Configuration&lt;/th&gt;
&lt;th&gt;End equity&lt;/th&gt;
&lt;th&gt;Return a year&lt;/th&gt;
&lt;th&gt;Max drawdown&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Full rules&lt;/td&gt;
&lt;td&gt;$62,473&lt;/td&gt;
&lt;td&gt;−6.8%&lt;/td&gt;
&lt;td&gt;58.6%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No System 1 filter&lt;/td&gt;
&lt;td&gt;$34,934&lt;/td&gt;
&lt;td&gt;−14.6%&lt;/td&gt;
&lt;td&gt;71.5%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No unit limits&lt;/td&gt;
&lt;td&gt;$30,861&lt;/td&gt;
&lt;td&gt;−16.2%&lt;/td&gt;
&lt;td&gt;80.8%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No drawdown rule&lt;/td&gt;
&lt;td&gt;$47,933&lt;/td&gt;
&lt;td&gt;−10.5%&lt;/td&gt;
&lt;td&gt;76.8%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;System 1 only&lt;/td&gt;
&lt;td&gt;$25,231&lt;/td&gt;
&lt;td&gt;−18.7%&lt;/td&gt;
&lt;td&gt;85.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;System 2 only&lt;/td&gt;
&lt;td&gt;$30,955&lt;/td&gt;
&lt;td&gt;−16.2%&lt;/td&gt;
&lt;td&gt;90.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;N updated daily&lt;/td&gt;
&lt;td&gt;$64,013&lt;/td&gt;
&lt;td&gt;−6.5%&lt;/td&gt;
&lt;td&gt;55.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Spread × 2&lt;/td&gt;
&lt;td&gt;$55,259&lt;/td&gt;
&lt;td&gt;−8.5%&lt;/td&gt;
&lt;td&gt;59.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F330vckxzzd97vk2s4272.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F330vckxzzd97vk2s4272.png" alt="Yearly return for each configuration with one rule switched off" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every safety layer did its job: without the filter, the limits or the drawdown rule, losses grew. Running only one system (with all the capital on it, so twice the risk per unit) was much worse. Updating N daily instead of weekly made no real difference. Doubling the spread cost about 1.7% a year. And none of the eight configurations made money.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does a bigger basket fix it?
&lt;/h2&gt;

&lt;p&gt;The original Turtles traded more than 20 futures markets across rates, currencies, metals, energy, softs and stock indices. Eleven mostly-forex markets is a narrow basket, so I added 15 more: AUDUSD, USDCAD, USDCHF, US and UK oil, natural gas, silver, platinum, copper, and six stock indices (DE30, STOXX50, UK100, JP225, AUS200, HK50).&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;11 markets&lt;/th&gt;
&lt;th&gt;26 markets&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;End equity&lt;/td&gt;
&lt;td&gt;$62,136&lt;/td&gt;
&lt;td&gt;$42,299&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Return&lt;/td&gt;
&lt;td&gt;−37.9%&lt;/td&gt;
&lt;td&gt;−57.7%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Return a year&lt;/td&gt;
&lt;td&gt;−6.9%&lt;/td&gt;
&lt;td&gt;−12.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Max drawdown&lt;/td&gt;
&lt;td&gt;58.3%&lt;/td&gt;
&lt;td&gt;75.6%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Positions / units&lt;/td&gt;
&lt;td&gt;834 / 1,498&lt;/td&gt;
&lt;td&gt;1,232 / 1,945&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Winning positions&lt;/td&gt;
&lt;td&gt;27.3%&lt;/td&gt;
&lt;td&gt;29.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Profit factor&lt;/td&gt;
&lt;td&gt;0.89&lt;/td&gt;
&lt;td&gt;0.83&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fep3a5qyvmjpx8vn4woml.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fep3a5qyvmjpx8vn4woml.png" alt="Equity of the 26-market basket against the 11-market basket" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By year on 26 markets: 2020 −34.4%, 2021 −24.0%, 2022 +2.7%, 2023 −37.0%, 2024 +6.8%, 2025 +16.6%, 2026 to September +5.3%.&lt;/p&gt;

&lt;p&gt;The unit limits worked hard: they blocked 6,670 entries, and 5,645 adds were skipped. With more markets competing for the same 12 units per direction, the basket isn't 26 independent bets, it's the same risk budget spread across more signals. And most of the new markets lost money too.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flrtlmrq7myxbfj5dy3x3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flrtlmrq7myxbfj5dy3x3.png" alt="Profit per market for the 26-market basket, grouped by asset class" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Do Turtle long trades and short trades behave differently?
&lt;/h2&gt;

&lt;p&gt;This is the clearest result in the whole test.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Group&lt;/th&gt;
&lt;th&gt;Positions&lt;/th&gt;
&lt;th&gt;Total&lt;/th&gt;
&lt;th&gt;Long trades&lt;/th&gt;
&lt;th&gt;Short trades&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Forex (11)&lt;/td&gt;
&lt;td&gt;637&lt;/td&gt;
&lt;td&gt;−$27,743&lt;/td&gt;
&lt;td&gt;+$1,513&lt;/td&gt;
&lt;td&gt;−$29,256&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Metals (4)&lt;/td&gt;
&lt;td&gt;132&lt;/td&gt;
&lt;td&gt;−$264&lt;/td&gt;
&lt;td&gt;+$12,352&lt;/td&gt;
&lt;td&gt;−$12,616&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Energy (3)&lt;/td&gt;
&lt;td&gt;141&lt;/td&gt;
&lt;td&gt;−$5,118&lt;/td&gt;
&lt;td&gt;+$6,093&lt;/td&gt;
&lt;td&gt;−$11,212&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stock indices (7)&lt;/td&gt;
&lt;td&gt;296&lt;/td&gt;
&lt;td&gt;−$30,205&lt;/td&gt;
&lt;td&gt;+$2,658&lt;/td&gt;
&lt;td&gt;−$32,863&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bitcoin&lt;/td&gt;
&lt;td&gt;26&lt;/td&gt;
&lt;td&gt;+$5,620&lt;/td&gt;
&lt;td&gt;+$5,662&lt;/td&gt;
&lt;td&gt;−$42&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;All 26&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1,232&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−$57,710&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+$28,279&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−$85,989&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Long trades made money in every group. Short trades lost money in every group. Part of the reason is the period: 20 of the 26 markets ended higher than they started (comparing the first and last daily close in the data), several by a lot: silver +266%, gold +172%, the S&amp;amp;P 500 +136%. A breakout system sells new lows, and in a market that keeps recovering, new lows tend to be followed by a bounce that hits the stop.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsaflxz073burggdh9axo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsaflxz073burggdh9axo.png" alt="Long trades against short trades on 26 markets, and which markets ended higher than they started" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's what that looks like on one trade. Gold, June 2020: System 1 sold a new 20-day low on 5 June at 1,687.58 and added a second unit at 1,674.09. By 10 June the rebound hit the stop at 1,728.05. Loss: &lt;strong&gt;−$1,322.95&lt;/strong&gt; for both units together.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgdqwdgqzfysdxwyvrt65.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgdqwdgqzfysdxwyvrt65.png" alt="A gold short in June 2020: sold at a new 20-day low and stopped out on the rebound within days" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's tempting to read this table and conclude "just trade the longs". Part 5 explains why I didn't.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I can't verify
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Swap on 23 of the 26 markets&lt;/strong&gt; is not measured and is set to zero, and commission on the commodity and index CFDs is unconfirmed. Turtle trades are held for weeks, so real results would likely be somewhat worse. On the 11 markets, where three swaps are measured, swap already cost $19,499.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Slippage&lt;/strong&gt; at breakouts beyond the spread isn't modelled.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data gaps&lt;/strong&gt;: UKOIL is missing November 2020 to February 2022, XPTUSD November 2020 to November 2023, and XNGUSD, JP225 and XCUUSD start in 2022–2023.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Earlier periods.&lt;/strong&gt; My data starts in 2020. These results say nothing about how the rules did in the 1980s or 2000s.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next, &lt;a href="https://moonthetrain.com/lab/does-turtle-trading-still-work" rel="noopener noreferrer"&gt;part 5: what I learned&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Research, not financial advice. Past results do not predict future results.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>backtesting</category>
      <category>trading</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>Turtle Trading Backtest in Python: Building the Simulator</title>
      <dc:creator>Truong Pham | Moon The Train</dc:creator>
      <pubDate>Mon, 26 Oct 2026 02:22:03 +0000</pubDate>
      <link>https://dev.to/moonthetrain/turtle-trading-backtest-in-python-building-the-simulator-120h</link>
      <guid>https://dev.to/moonthetrain/turtle-trading-backtest-in-python-building-the-simulator-120h</guid>
      <description>&lt;p&gt;&lt;strong&gt;The short version.&lt;/strong&gt; A Turtle backtest is harder to get right than it looks, because the rules live at three levels at once: daily channels for signals, intraday prices for fills and stops, and one shared account for unit limits across every market. I built the simulator in Python on Exness tick data from 2020 to 2026, checked fills minute by minute, and then tested the code three ways before trusting any result: 8 tests rebuilt from the worked examples in the original PDF, a look-ahead check at three cut dates, and an independent daily-bar version that matched trade for trade on three markets.&lt;/p&gt;

&lt;p&gt;This is part 3 of 5. &lt;a href="https://dev.to/moonthetrain/turtle-trading-rules-explained-n-units-breakouts-stops-25hg"&gt;Part 2&lt;/a&gt; went through the rules. &lt;a href="https://moonthetrain.com/lab/turtle-trading-backtest-results" rel="noopener noreferrer"&gt;Part 4&lt;/a&gt; has the results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why not just use a backtesting library?
&lt;/h2&gt;

&lt;p&gt;Most backtesting tools run one symbol at a time. The Turtle system doesn't work that way. Its unit limits (6 units across closely related markets, 10 across loosely related ones, 12 per direction) and its drawdown rule all depend on what every other market is doing at that minute. A 26-market portfolio has to be simulated as one account, with events from all markets interleaved in time order.&lt;/p&gt;

&lt;p&gt;So I wrote a small dedicated simulator. It still writes its trades in the same format as my single-symbol tools, so the same reports and comparisons work on it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz9gr2l6vyhm6ei5xtuhr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz9gr2l6vyhm6ei5xtuhr.png" alt="The simulator: Exness ticks, M1 and D1 bars, levels from yesterday's daily bar, fills minute by minute, portfolio limits, trade list" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What data does it run on?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Prices:&lt;/strong&gt; the Exness Raw Spread tick archive, January 2020 to September 2026, built into M1 and D1 bid bars with the spread kept per bar.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Daily bars:&lt;/strong&gt; Exness server time is UTC, so forex, gold and indices get a short Sunday bar of a few hours. Counting that as a full day would shorten every 20-day channel by about 4 real days a month, so I merge Sunday into Monday (crypto keeps its 7-day calendar).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Currency:&lt;/strong&gt; profits in JPY, CAD, CHF, EUR and other currencies are converted to USD with the real daily close of the matching pair, not a fixed rate.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gaps in the archive:&lt;/strong&gt; a few markets have missing months (UKOIL, XPTUSD) or start late (XNGUSD, JP225, XCUUSD). Positions are closed on the last bar before a gap, and the market only trades again after 56 fresh daily bars.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why check fills minute by minute?
&lt;/h2&gt;

&lt;p&gt;Because a daily bar can't tell you the order things happened in. Here's a real example from the backtest: crude oil on 3 March 2026.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fc8o6cd301x2wxgh1pbe4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fc8o6cd301x2wxgh1pbe4.png" alt="Crude oil on 3 March 2026: the daily bar on the left, the minute path on the right with breakout, add and stop" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The daily bar runs from 70.63 to 77.21. From that alone you can't tell whether the low or the high came first. The minute data says:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Time (UTC)&lt;/th&gt;
&lt;th&gt;Event&lt;/th&gt;
&lt;th&gt;Price&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;07:27&lt;/td&gt;
&lt;td&gt;System 1 breakout, unit 1&lt;/td&gt;
&lt;td&gt;73.105&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10:52&lt;/td&gt;
&lt;td&gt;add, next unit&lt;/td&gt;
&lt;td&gt;76.094&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;19:41&lt;/td&gt;
&lt;td&gt;the added unit's stop is hit&lt;/td&gt;
&lt;td&gt;72.109&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Unit 1 survived, because its own stop was lower, and it was finally closed on 14 April at 85.986 for +$1,288. The added unit lost $399. A daily-bar test has to guess this order, and over 1,232 positions those guesses add up. That's why my independent daily-bar version (below) disagreed on crude oil and only on crude oil.&lt;/p&gt;

&lt;p&gt;Signal levels, on the other hand, only use &lt;strong&gt;completed&lt;/strong&gt; daily bars: the 20-day and 55-day highs are calculated up to yesterday's close, and N is the value from the last Monday. Nothing inside the day can change today's levels.&lt;/p&gt;

&lt;h2&gt;
  
  
  What does the code look like?
&lt;/h2&gt;

&lt;p&gt;The pyramiding rule is a good example of how small the core is. This is the function that adds a unit to a position:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lots&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ms&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;comm_in&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;half&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;dir&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add_n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;units&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stop&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;half&lt;/span&gt;
    &lt;span class="n"&gt;stop&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stop_n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;units&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Unit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lots&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stop&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ms&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;comm_in&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sl0&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;stop&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;next_add&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;half&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three lines carry the whole rule: raise the old stops by half N, put the new unit's stop 2N below its real fill, and set the next add level half N further on. Because each unit keeps its own stop, the gap case from part 2 (a unit filling at 30.80 instead of 30.10) falls out naturally.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8vmsbq4u4tguhl3ca209.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8vmsbq4u4tguhl3ca209.png" alt="The add function with the new-unit stop highlighted" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The harder code is everything around it: the order of events within one minute (imaginary filter trades first, then stops, then channel exits, then new entries, then adds), the strongest-market rule when several markets trigger in the same minute, and the bookkeeping for swap (charged triple on Wednesdays, every night for bitcoin).&lt;/p&gt;

&lt;h2&gt;
  
  
  How do I know the code is right?
&lt;/h2&gt;

&lt;p&gt;I don't trust a backtest number until the code has been checked in ways that don't depend on the result. Three checks:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Tests from the original PDF.&lt;/strong&gt; Eight tests rebuild the worked examples in the rules document: the heating oil unit size, the N table, the crude oil stops including the gap case, the gold add levels, and the drawdown rule's 10%/20% steps. If the code disagrees with the PDF's own numbers, a test fails.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. A look-ahead check.&lt;/strong&gt; The simulator is run twice: once on the full data, once with the data cut off at a date (17 March 2021, 2 August 2021, 12 January 2022), so nothing after that date is even loaded. Every trade that opened or closed before the cut has to be identical in both runs: same time, direction, price and size. They are. If any future price leaked into a decision, this would break.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. An independent second version.&lt;/strong&gt; I wrote a separate, much simpler implementation that only uses daily bars, on one market at a time, and compared trades:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Market&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;XAUUSD&lt;/td&gt;
&lt;td&gt;same trades, same direction, same entries&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;USDCAD&lt;/td&gt;
&lt;td&gt;same trades&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DE30&lt;/td&gt;
&lt;td&gt;same trades&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;USOIL&lt;/td&gt;
&lt;td&gt;35 vs 32 trades, from the order of prices inside the day&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Long entries differ by exactly the spread, because the daily version ignores it. The only real disagreement is crude oil, which is the intraday-order problem above.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn6is7fkkwnki3qnhpm49.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn6is7fkkwnki3qnhpm49.png" alt="The three checks: tests, the cut-date look-ahead check, and the daily-bar cross-check" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All 11 tests (the 8 rule tests plus 3 cut dates) pass in about 14 seconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  What does a real Turtle trade look like?
&lt;/h2&gt;

&lt;p&gt;Textbook examples are tidy. Here's a real System 2 long on gold from the 26-market run:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Unit&lt;/th&gt;
&lt;th&gt;Entry&lt;/th&gt;
&lt;th&gt;Exit&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;3 Feb 2025 at 2,817.34&lt;/td&gt;
&lt;td&gt;14 May at 3,201.92 (20-day low)&lt;/td&gt;
&lt;td&gt;+$1,326.99&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;4 Feb at 2,832.65&lt;/td&gt;
&lt;td&gt;14 May at 3,201.92&lt;/td&gt;
&lt;td&gt;+$950.92&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;30 Mar at 3,092.86&lt;/td&gt;
&lt;td&gt;stopped 4 Apr at 3,031.63&lt;/td&gt;
&lt;td&gt;−$193.38&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;10 Apr at 3,169.39&lt;/td&gt;
&lt;td&gt;14 May at 3,201.92&lt;/td&gt;
&lt;td&gt;+$31.93&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Total: &lt;strong&gt;+$2,116.46&lt;/strong&gt;, after swap and commission. Two things are not in any textbook. Unit 3 came in eight weeks after unit 2, far beyond half N, because adds were blocked by the portfolio's unit limits while other markets held risk, and each blocked add moved the next level half N further out. And unit 3 was stopped on its own in early April while units 1 and 2 kept running, because its stop was 2N below its own, much higher fill.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fevkdn1c2e4t78rxzikxq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fevkdn1c2e4t78rxzikxq.png" alt="A real System 2 gold trade from February to May 2025 with four units and one stopped on its own" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I can't verify
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Real execution.&lt;/strong&gt; This is a simulation on archive data. Real fills at breakouts would see slippage the spread doesn't capture.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Swap and some commissions.&lt;/strong&gt; Swap is measured on 3 of 26 markets; commission on the commodity and index CFDs isn't confirmed. Both are set to zero where unknown.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Contract sizes&lt;/strong&gt; for some commodities and indices. With risk sized by N this mostly affects lot rounding, not the result in dollars per unit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The archive itself.&lt;/strong&gt; I've compared Exness archive ticks against a live MT5 feed before: about 23% of gold ticks are shifted by up to roughly 30 cents, in both directions. That doesn't matter at 2N stops measured in tens of dollars, but it's worth knowing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next, &lt;a href="https://moonthetrain.com/lab/turtle-trading-backtest-results" rel="noopener noreferrer"&gt;part 4: the results&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Research, not financial advice. Past results do not predict future results.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>backtesting</category>
      <category>trading</category>
      <category>algorithms</category>
    </item>
  </channel>
</rss>
