<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Truong Pham | Moon The Train on Medium]]></title>
        <description><![CDATA[Stories by Truong Pham | Moon The Train on Medium]]></description>
        <link>https://medium.com/@moonthetrain?source=rss-6e40fe3c7276------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*URX3Rfl7x7wfLDyrPh1WIg.png</url>
            <title>Stories by Truong Pham | Moon The Train on Medium</title>
            <link>https://medium.com/@moonthetrain?source=rss-6e40fe3c7276------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 12:44:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@moonthetrain/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ICT Trading Strategy Backtest: 79 Setups on ES and NQ]]></title>
            <link>https://medium.com/@moonthetrain/ict-trading-strategy-backtest-79-setups-on-es-and-nq-4c3f36a06b4f?source=rss-6e40fe3c7276------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c3f36a06b4f</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[backtesting]]></category>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[day-trading]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <dc:creator><![CDATA[Truong Pham | Moon The Train]]></dc:creator>
            <pubDate>Sun, 22 Nov 2026 14:02:44 GMT</pubDate>
            <atom:updated>2026-11-22T15:16:45.001Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>The short version.</strong> 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.</p><ul><li><strong>None of the three setups made money.</strong> 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.</li><li><strong>It isn’t the spread.</strong> With trading costs set to zero, five of six runs were still below break-even.</li><li><strong>A higher-timeframe bias helped a little and not enough.</strong> Daily bias, H4 bias, both together: 33 more setups, best profit factor 0.96.</li><li><strong>The win rate tells the story.</strong> With a 2R target you need 33.3% winners to break even. The 2R setups won 26% to 41% of the time.</li></ul><p>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.</p><h3>What is the ICT trading strategy?</h3><p>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.</p><p>The pieces I used:</p><ul><li><strong>Liquidity</strong>. How I defined it: 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</li><li><strong>Sweep</strong>. How I defined it: Price trades through one of those levels inside the session</li><li><strong>MSS (market structure shift)</strong>. How I defined it: After the sweep, a bar closes beyond the last swing point on the other side</li><li><strong>FVG (fair value gap)</strong>. How I defined it: Three bars where bar 3’s low is above bar 1’s high (or the mirror for shorts)</li><li><strong>Killzone</strong>. How I defined it: New York morning, 08:30 to 11:00. London, 02:00 to 05:00</li><li><strong>Bias</strong>. How I defined it: Direction on a higher timeframe. I tested daily, H4, and both agreeing</li></ul><p>All times are New York time and follow daylight saving.</p><h3>Which ICT setups did I test?</h3><p>Three, each written so a computer can’t argue with it.</p><p><strong>The 2022 model.</strong> 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.</p><p><strong>The London version.</strong> Same rules, 02:00 to 05:00.</p><p><strong>The Silver Bullet.</strong> 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.</p><p>Here’s one trade so you can check my reading. On 31 July 2026 the Asia low on the S&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.</p><h3>How did I test it?</h3><ul><li><strong>Data:</strong> Dukascopy one-minute bars for the S&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.</li><li><strong>Risk:</strong> a fixed $100 per trade, no compounding. So every result below is in R, where 1 R is the amount risked.</li><li><strong>Fills:</strong> limit orders fill when price touches them, which flatters the result a bit.</li><li><strong>Look-ahead:</strong> 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 <a href="https://moonthetrain.com/lab/mql5-ea-backtest-sees-the-future">this post on backtests that see the future</a>.</li></ul><p>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.</p><p>The code is on GitHub: <a href="https://github.com/truongxxxx/ict-backtest">github.com/truongxxxx/ict-backtest</a>. 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).</p><h3>Is the ICT strategy profitable in a backtest?</h3><p>Not in mine. Here are the default rules, 2014 to August 2026:</p><pre>Market                      Setup  Trades   Win%    PF  Result  Win yrs<br>-----------------------------------------------------------------------<br>ES                     2022 model     337  35.3%  0.87   −26 R  5 of 13<br>ES                         London     420  32.1%  0.94   −17 R  7 of 13<br>ES      Silver Bullet (first FVG)   2,403  26.5%  0.72  −501 R  0 of 13<br>NQ                     2022 model     322  35.4%  0.74   −51 R  3 of 13<br>NQ                         London     395  25.8%  0.66  −101 R  3 of 13<br>NQ      Silver Bullet (first FVG)   2,391  27.9%  0.77  −391 R  2 of 13</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YgElqNoqTibxCcf7.png" /></figure><p>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.</p><p>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.</p><h3>Which part of the setup matters?</h3><p>This surprised me more than the losses. I switched the layers off one at a time on ES:</p><pre>2022 model, ES                              Trades    PF<br>--------------------------------------------------------<br>All rules                                      337  0.87<br>No liquidity sweep needed                    2,832  0.82<br>No MSS needed                                  840  0.85<br>No killzone (any time until 16:00)           2,791  0.88<br>Enter at the middle of the gap                 319  0.88<br>Move stop to break-even at 1R                  337  0.89<br>Target at opposite liquidity instead of 2R     244  0.85</pre><p>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.</p><h3>Does a higher-timeframe bias fix it?</h3><p>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.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6Ic7uDAhrjcMo87O.png" /></figure><p>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.</p><h3>What I couldn’t test</h3><ul><li><strong>Discretion.</strong> 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.</li><li><strong>Real futures.</strong> These are index CFDs. They track ES and NQ closely, but not tick for tick.</li><li><strong>Other concepts.</strong> Order blocks, breakers, SMT divergence and the Unicorn model aren’t in here yet.</li><li><strong>Other definitions.</strong> There’s more than one way to define a swing, a valid gap or a daily bias. I picked the plainest reading each time.</li></ul><h3>Where this leaves me</h3><p>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.</p><p>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 <a href="https://moonthetrain.com/lab/turtle-trading-rules-explained">my Turtle trading rules post</a>, and I’ll keep at this one too.</p><p><em>Originally published at </em><a href="https://moonthetrain.com/lab/ict-trading-strategy-backtest"><em>https://moonthetrain.com</em></a><em> on November 22, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c3f36a06b4f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TradingView AlphaTrend Strategy: Best Settings, Backtest]]></title>
            <link>https://medium.com/@moonthetrain/tradingview-alphatrend-strategy-best-settings-backtest-3ecf58b45273?source=rss-6e40fe3c7276------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ecf58b45273</guid>
            <category><![CDATA[backtesting]]></category>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[tradingview]]></category>
            <dc:creator><![CDATA[Truong Pham | Moon The Train]]></dc:creator>
            <pubDate>Sat, 21 Nov 2026 02:31:30 GMT</pubDate>
            <atom:updated>2026-11-21T02:36:57.194Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>The short version.</strong> 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.</p><ul><li><strong>As a stand-alone long + short strategy, it has no edge of its own.</strong> EURUSD, GBPUSD and NZDUSD lost on every timeframe from M5 to H4 after costs.</li><li><strong>Where it made money, the long side did the work.</strong> 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.</li><li><strong>Long only, it kept pace with buy and hold at half the drawdown.</strong> 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.</li><li><strong>The volume in MFI barely matters.</strong> 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.</li><li><strong>On old data it went flat.</strong> Dukascopy gold 2004–2019, H4 long + short: PF 1.03.</li></ul><p>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.</p><h3>What is the AlphaTrend strategy on TradingView?</h3><p>It’s the <a href="https://www.tradingview.com/script/3wdQu7P3-AlphaTrend-Strategy/">open-source strategy version</a> of Kıvanç Özbilgiç’s AlphaTrend indicator, version 2.0 published 9 January 2023. Here’s all of the code that trades:</p><pre>ATR   = ta.sma(ta.tr, AP)                 // AP = 14<br>upT   = low  - ATR * coeff                // coeff = 1<br>downT = high + ATR * coeff<br>AlphaTrend := (novolumedata ? ta.rsi(src, AP) &gt;= 50 : ta.mfi(hlc3, AP) &gt;= 50) ?<br>              (upT &lt; nz(AlphaTrend[1]) ? nz(AlphaTrend[1]) : upT) :<br>              (downT &gt; nz(AlphaTrend[1]) ? nz(AlphaTrend[1]) : downT)</pre><pre>buySignalk  = ta.crossover(AlphaTrend, AlphaTrend[2])<br>sellSignalk = ta.crossunder(AlphaTrend, AlphaTrend[2])<br>if (buySignalk)<br>    strategy.entry(&quot;Long&quot;, strategy.long)<br>if (sellSignalk)<br>    strategy.entry(&quot;Short&quot;, strategy.short)</pre><p>Two things in there aren’t obvious from the chart.</p><p><strong>The line is a ratchet.</strong> While MFI is at or above 50, the line can only move up to low − ATR, never down. When MFI drops below 50, it can only move down to high + ATR. That&#39;s why it sits flat for long stretches: the new level wasn&#39;t better than the one it already held.</p><p><strong>The second line is the same line, two bars ago.</strong> 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.</p><p>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.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ELAoaZJYynoI--eC.png" /></figure><p>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.</p><h3>Does AlphaTrend repaint?</h3><p>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.</p><h3>How I tested it</h3><ul><li><strong>Port:</strong> Python, signal on the close, fill at the next open, stop-and-reverse like strategy.entry. Default settings: ATR period 14, multiplier 1, MFI on hlc3.</li><li><strong>Volume:</strong> MFI needs volume, so I used the number of ticks per bar. That’s what retail forex volume is on TradingView and MetaTrader too.</li><li><strong>Data:</strong> Exness Raw Spread ticks for XAUUSD, USDJPY, EURUSD, GBPUSD, NZDUSD and US500, January 2020 to September 2026. BTCUSD from January 2024.</li><li><strong>Costs:</strong> 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.</li><li><strong>Swap:</strong> checked separately for gold (below). Not included in the main tables.</li><li><strong>Older data:</strong> Dukascopy M1 via Tickstory, 2004 to 2026, for gold and four forex pairs, with Dukascopy’s own tick counts as volume.</li><li><strong>Size:</strong> 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.</li></ul><h3>The results</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TJwRU205hq1RYnMB.png" /></figure><p><strong>XAUUSD, Jan 2020 — Sep 2026, before swap.</strong> Buy and hold: +2,588, max drawdown 1,600.</p><ul><li><strong>M5</strong>. Trades: 12,041 · PF: 0.97 · Net: −1,260 · Max DD: 2,434 · Win rate: 34% · Long net: +663 · Short net: −1,923 · Long only: PF / net / DD: 1.03 / +663 / 958</li><li><strong>M15</strong>. Trades: 3,823 · PF: 1.09 · Net: +2,040 · Max DD: 868 · Win rate: 35% · Long net: +2,312 · Short net: −272 · Long only: PF / net / DD: 1.21 / +2,312 / 710</li><li><strong>M30</strong>. Trades: 1,885 · PF: 1.13 · Net: +2,095 · Max DD: 926 · Win rate: 35% · Long net: +2,341 · Short net: −247 · Long only: PF / net / DD: 1.30 / +2,341 / 763</li><li><strong>H1</strong>. Trades: 940 · PF: 1.22 · Net: +2,438 · Max DD: 740 · Win rate: 37% · Long net: +2,510 · Short net: −72 · Long only: PF / net / DD: 1.49 / +2,510 / 526</li><li><strong>H4</strong>. Trades: <strong>265</strong> · PF: <strong>1.47</strong> · Net: <strong>+2,336</strong> · Max DD: <strong>820</strong> · Win rate: 39% · Long net: +2,484 · Short net: −148 · Long only: PF / net / DD: <strong>2.08 / +2,484 / 757</strong></li><li><strong>D1</strong>. Trades: 51 · PF: 2.53 · Net: +2,560 · Max DD: 809 · Win rate: 43% · Long net: +2,406 · Short net: +154 · Long only: PF / net / DD: 4.76 / +2,406 / 809</li></ul><p><em>USD per 0.01 lot.</em> 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.</p><p><strong>USDJPY, Jan 2020 — Sep 2026.</strong> Buy and hold: +4,845 pips.</p><ul><li><strong>M5</strong>. Trades: 13,193 · PF: 0.87 · Net: −15,318 · Max DD: 15,892 · Win rate: 33% · Long net: −5,239 · Short net: −10,079 · Long only: PF / net / DD: 0.91 / −5,239 / 5,589</li><li><strong>M15</strong>. Trades: 4,074 · PF: 1.05 · Net: +2,972 · Max DD: 2,385 · Win rate: 35% · Long net: +3,911 · Short net: −940 · Long only: PF / net / DD: 1.12 / +3,911 / 1,326</li><li><strong>M30</strong>. Trades: 1,981 · PF: 1.05 · Net: +2,098 · Max DD: 3,009 · Win rate: 36% · Long net: +3,489 · Short net: −1,391 · Long only: PF / net / DD: 1.16 / +3,489 / 1,840</li><li><strong>H1</strong>. Trades: <strong>970</strong> · PF: <strong>1.16</strong> · Net: <strong>+4,920</strong> · Max DD: 2,139 · Win rate: 38% · Long net: +4,854 · Short net: +66 · Long only: PF / net / DD: 1.31 / +4,854 / 1,689</li><li><strong>H4</strong>. Trades: 288 · PF: 0.97 · Net: −624 · Max DD: 3,957 · Win rate: 33% · Long net: +2,161 · Short net: −2,785 · Long only: PF / net / DD: 1.26 / +2,161 / 1,681</li><li><strong>D1</strong>. Trades: 44 · PF: 1.82 · Net: +4,291 · Max DD: 1,932 · Win rate: 43% · Long net: +4,799 · Short net: −508 · Long only: PF / net / DD: 4.61 / +4,799 / 1,191</li></ul><p><em>Pips per lot, swap not included.</em></p><p><strong>The other five markets, long + short:</strong></p><pre>Market     M5   M15   M30    H1    H4    D1  Buy and hold<br>---------------------------------------------------------<br>EURUSD   0.83  0.87  0.93  0.95  0.87  1.13     +304 pips<br>GBPUSD   0.81  0.90  0.93  0.89  0.81  1.22     +214 pips<br>NZDUSD   0.71  0.85  0.99  0.88  0.74  0.96     −821 pips<br>US500    0.97  1.00  1.02  0.92  0.89  1.05    +4,437 pts<br>BTCUSD*  0.93  0.96  1.02  1.04  1.23  0.85   +41,139 USD</pre><p><em>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.</em></p><p>The forex majors went sideways for six years, and AlphaTrend lost on them. Gold, yen, the S&amp;P and Bitcoin went up, and AlphaTrend made money on the long side. That’s the whole pattern.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bFdlIgFTl9hPsuul.png" /></figure><p>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.</p><h3>Should you turn on “no volume data”?</h3><p>It barely matters. That surprised me more than anything else in this test.</p><p>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.</p><p>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).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jpKyfbEb9WcF24p5.png" /></figure><ul><li>Positions matched on <strong>96–99.5% of bars</strong> between the two brokers’ tick volume, and <strong>96–98%</strong> with no volume at all.</li><li>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.</li><li>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.</li></ul><p>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.</p><h3>What are the best AlphaTrend settings?</h3><p>The defaults are fine, and the choice of timeframe matters far more than the numbers.</p><p>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.</p><p><strong>The D1 numbers are the trap.</strong> 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.</p><p>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.</p><h3>Is the gold result an edge or just gold going up?</h3><p>Mostly gold going up. Three tests point the same way.</p><p><strong>By year.</strong> Gold H4, long + short, USD per 0.01 lot:</p><pre>Exness gold H4  2020  2021  2022  2023  2024    2025  2026 (to Sep)<br>-------------------------------------------------------------------<br>Trades            31    44    42    40    45      36             27<br>PF              0.79  1.18  1.03  1.31  1.21    2.37           1.83<br>Net             −140   +87   +21  +152  +144  +1,026         +1,044</pre><p>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.</p><p><strong>Random timing.</strong> 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.</p><p><strong>Older data.</strong> This one settles it. Dukascopy gold, 2004 to 2019, with spread, commission and swap:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3pfrme-8x96BmcLd.png" /></figure><pre>PF                                    2004–2019           2020–2026<br>-------------------------------------------------------------------<br>Gold H1, long + short                      1.01                1.12<br>Gold H4, long + short                      1.03                1.27<br>Gold H4, long only                         1.23                1.78<br>USDJPY H1, long + short                    0.98                1.14<br>EURUSD / GBPUSD / NZDUSD H1  0.95 / 1.01 / 0.98  0.96 / 0.89 / 0.86</pre><p>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.</p><h3>What it costs to hold gold longs</h3><p>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.</p><h3>Risk structure</h3><ul><li><strong>No stop loss.</strong> 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.</li><li><strong>Win rate 39% on gold H4</strong>, 37% on H1. The longest losing streak on gold H4 was 7 trades.</li><li><strong>The ten worst gold H4 trades</strong> (long + short, USD per 0.01 lot, before swap). Seven of them opened in 2026, when gold moved 100+ USD in a day:</li><li><strong>9 Feb 2026 20:00</strong>. Exit: 17 Feb 16:00 · Side: Buy · Entry → exit price: 5,074.8 → 4,878.4 · Loss: −196.4 · Worst point against: 233.6 · Held: 188 h</li><li><strong>19 Aug 2026 00:00</strong>. Exit: 19 Aug 20:00 · Side: Sell · Entry → exit price: 4,333.1 → 4,511.2 · Loss: −178.2 · Worst point against: 194.6 · Held: 20 h</li><li><strong>17 Feb 2026 16:00</strong>. Exit: 20 Feb 00:00 · Side: Sell · Entry → exit price: 4,878.4 → 4,988.0 · Loss: −109.6 · Worst point against: 144.0 · Held: 56 h</li><li><strong>18 Sep 2026 12:00</strong>. Exit: 23 Sep 20:00 · Side: Buy · Entry → exit price: 4,381.4 → 4,284.1 · Loss: −97.4 · Worst point against: 106.8 · Held: 128 h</li><li><strong>29 May 2026 12:00</strong>. Exit: 3 Jun 20:00 · Side: Buy · Entry → exit price: 4,538.5 → 4,444.0 · Loss: −94.5 · Worst point against: 114.7 · Held: 128 h</li><li><strong>2 Jul 2026 20:00</strong>. Exit: 8 Jul 16:00 · Side: Buy · Entry → exit price: 4,121.5 → 4,034.2 · Loss: −87.3 · Worst point against: 99.8 · Held: 140 h</li><li><strong>27 May 2025 12:00</strong>. Exit: 2 Jun 16:00 · Side: Sell · Entry → exit price: 3,288.5 → 3,374.4 · Loss: −86.0 · Worst point against: 93.9 · Held: 148 h</li><li><strong>29 Dec 2025 20:00</strong>. Exit: 5 Jan 08:00 · Side: Sell · Entry → exit price: 4,337.1 → 4,422.0 · Loss: −85.0 · Worst point against: 103.0 · Held: 156 h</li><li><strong>3 Sep 2026 12:00</strong>. Exit: 8 Sep 20:00 · Side: Buy · Entry → exit price: 4,444.1 → 4,359.6 · Loss: −84.6 · Worst point against: 98.8 · Held: 128 h</li><li><strong>2 Feb 2023 00:00</strong>. Exit: 3 Feb 16:00 · Side: Buy · Entry → exit price: 1,953.1 → 1,873.1 · Loss: −80.1 · Worst point against: 91.7 · Held: 40 h</li></ul><p>At today’s gold prices one bad H4 trade costs 100–200 USD per 0.01 lot. Size for that.</p><ul><li><strong>No martingale, no grid, no averaging down.</strong> One position at a time.</li></ul><h3>Who should use it?</h3><p>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.</p><p>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.</p><h3>What I couldn’t verify</h3><ul><li><strong>TradingView’s own report.</strong> My numbers come from my port, not TradingView’s tester.</li><li><strong>Forex swap.</strong> Not included for USDJPY or the other pairs.</li><li><strong>Live fills.</strong> 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.</li><li><strong>Markets outside these seven.</strong> I didn’t test crypto other than Bitcoin, stocks, or exotic pairs.</li></ul><h3>Bottom line</h3><p>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;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.</p><p>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 <a href="https://moonthetrain.com/lab/tradingview-super-scalper-strategy-backtest">Super Scalper backtest</a>. For another Kıvanç Özbilgiç script with the same long-side pattern on gold, see the <a href="https://moonthetrain.com/lab/tradingview-pmax-strategy-backtest">PMax backtest</a> and the <a href="https://moonthetrain.com/lab/tradingview-supertrend-strategy-backtest">SuperTrend backtest</a>.</p><p><em>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.</em></p><p><em>Originally published at </em><a href="https://moonthetrain.com/lab/tradingview-alphatrend-strategy-backtest"><em>https://moonthetrain.com</em></a><em> on November 21, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ecf58b45273" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TradingView Super Scalper Strategy: Best Settings, Backtest]]></title>
            <link>https://medium.com/@moonthetrain/tradingview-super-scalper-strategy-best-settings-backtest-b8faea460a7e?source=rss-6e40fe3c7276------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8faea460a7e</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[backtesting]]></category>
            <category><![CDATA[tradingview]]></category>
            <dc:creator><![CDATA[Truong Pham | Moon The Train]]></dc:creator>
            <pubDate>Wed, 18 Nov 2026 03:02:14 GMT</pubDate>
            <atom:updated>2026-11-20T08:42:52.665Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>The short version.</strong> 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.</p><ul><li><strong>As a scalper, it loses.</strong> 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.</li><li><strong>Put the same code on H1 and it’s the steadiest result I’ve had in this series.</strong> 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.</li><li><strong>It held on data I never looked at.</strong> 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.</li><li><strong>USDJPY M30 and H1 also worked</strong> (PF 1.11 and 1.18). EURUSD, GBPUSD and NZDUSD lost.</li><li><strong>The stop loss and take profit in the code are never used</strong>, and neither is the golden cross. The part doing the work is a double RSI filter.</li></ul><p>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%.</p><h3>What is the Super Scalper strategy on TradingView?</h3><p>It’s an <a href="https://www.tradingview.com/script/4ORGCiTh-Super-Scalper-5-Min-15-Min/">open-source strategy</a> 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.”</p><p>Here’s the part of the code that trades:</p><pre>atr_slen   = ta.wma(ta.tr(true), 14)        // &quot;ATR Smoothing&quot; = WMA by default<br>upper_band = atr_slen * 1 + close<br>lower_band = close - atr_slen * 1</pre><pre>longCondition  = open &lt; lower_band<br>shortCondition = open &gt; upper_band<br>RSILong  = ta.rsi(close, 25) &gt; ta.rsi(close, 100)<br>RSIShort = ta.rsi(close, 25) &lt; ta.rsi(close, 100)</pre><pre>if (longCondition)<br>    stopLoss   = low - atr * 2<br>    takeProfit = high + atr * 5<br>    strategy.entry(&quot;long&quot;, strategy.long, when = RSILong)<br>if (shortCondition)<br>    stopLoss   = high + atr * 2<br>    takeProfit = low - atr * 5<br>    strategy.entry(&quot;short&quot;, strategy.short, when = RSIShort)</pre><p>Three things about this aren’t obvious from the chart.</p><p><strong>“Open below the lower band” means a big green candle.</strong> The bands are built from the close of the <em>same</em> bar. So open &lt; close − ATR is just close − open &gt; ATR: the candle closed up by more than its average range. The &quot;Buy&quot; label looks like buying a dip under a band. It&#39;s actually buying after a strong up bar. That&#39;s momentum, not mean reversion.</p><p><strong>The stop loss and take profit do nothing.</strong> stopLoss and takeProfit are calculated and never passed to strategy.exit. The only exit is the opposite signal, so it&#39;s a stop-and-reverse system that&#39;s in the market about 98% of the time.</p><p><strong>The golden cross is decoration.</strong> 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.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MhZ7-Eqgf2P7QfMP.png" /></figure><p>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.</p><h3>Does Super Scalper repaint?</h3><p>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.</p><h3>How I tested it</h3><ul><li><strong>Port:</strong> Python, signals on the close, fills at the next open, stop-and-reverse like strategy.entry. Default settings: WMA of true range 14, multiplier 1, RSI 25 and 100.</li><li><strong>Data:</strong> 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.</li><li><strong>Costs:</strong> 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.</li><li><strong>Swap:</strong> included for gold (Exness Raw rates, scaled to the gold price at the time). Not included for the others.</li><li><strong>Older data:</strong> Dukascopy M1 via Tickstory, 2004 to 2026, for gold, USDJPY, EURUSD, GBPUSD, NZDUSD and the S&amp;P 500.</li><li><strong>Size:</strong> 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.</li></ul><h3>The results</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bZDyqEcJRsPohkRn.png" /></figure><p><strong>XAUUSD, Jan 2020 — Sep 2026, before swap.</strong> Buy and hold: +2,588, max drawdown 1,600.</p><ul><li><strong>M5</strong>. Trades: 14,490 · PF: 0.93 · Net: −3,010 · Max DD: 4,081 · Win rate: 30% · Long net: −212 · Short net: −2,798 · Long only: PF / net / DD: 0.99 / −212 / 1,467</li><li><strong>M15</strong>. Trades: 4,753 · PF: 0.95 · Net: −1,354 · Max DD: 2,057 · Win rate: 31% · Long net: +612 · Short net: −1,966 · Long only: PF / net / DD: 1.05 / +612 / 1,022</li><li><strong>M30</strong>. Trades: 2,266 · PF: <strong>1.23</strong> · Net: +3,746 · Max DD: 589 · Win rate: 34% · Long net: +3,166 · Short net: +579 · Long only: PF / net / DD: 1.42 / +3,166 / 532</li><li><strong>H1</strong>. Trades: <strong>1,116</strong> · PF: <strong>1.31</strong> · Net: <strong>+3,409</strong> · Max DD: <strong>778</strong> · Win rate: 35% · Long net: +2,999 · Short net: +411 · Long only: PF / net / DD: 1.60 / +2,999 / 532</li><li><strong>H4</strong>. Trades: 329 · PF: 1.16 · Net: +982 · Max DD: 1,016 · Win rate: 35% · Long net: +1,802 · Short net: −819 · Long only: PF / net / DD: 1.79 / +1,802 / 846</li></ul><p><em>USD per 0.01 lot. With swap: M30 1.21, H1 1.27 (+3,016), H1 long only 1.51.</em></p><p><strong>USDJPY, Jan 2020 — Sep 2026.</strong> Buy and hold: +4,845 pips.</p><ul><li><strong>M5</strong>. Trades: 15,549 · PF: 0.83 · Net: −22,503 · Max DD: 22,807 · Win rate: 28% · Long net: −8,832 · Short net: −13,671 · Long only: PF / net / DD: 0.86 / −8,832 / 9,044</li><li><strong>M15</strong>. Trades: 4,871 · PF: 1.00 · Net: +193 · Max DD: 2,499 · Win rate: 31% · Long net: +2,521 · Short net: −2,328 · Long only: PF / net / DD: 1.08 / +2,521 / 1,552</li><li><strong>M30</strong>. Trades: 2,334 · PF: <strong>1.11</strong> · Net: +5,343 · Max DD: 1,493 · Win rate: 34% · Long net: +5,104 · Short net: +239 · Long only: PF / net / DD: 1.24 / +5,104 / 950</li><li><strong>H1</strong>. Trades: <strong>1,153</strong> · PF: <strong>1.18</strong> · Net: <strong>+5,817</strong> · Max DD: 1,923 · Win rate: 35% · Long net: +5,298 · Short net: +519 · Long only: PF / net / DD: 1.37 / +5,298 / 1,553</li><li><strong>H4</strong>. Trades: 332 · PF: 0.74 · Net: −5,925 · Max DD: 7,500 · Win rate: 27% · Long net: −429 · Short net: −5,496 · Long only: PF / net / DD: 0.96 / −429 / 2,900</li></ul><p><em>Pips per lot, swap not included.</em></p><p><strong>The other five markets, long + short:</strong></p><pre>Market   Timeframe  Trades    PF       Net   Max DD  Long only PF / net<br>-----------------------------------------------------------------------<br>EURUSD          M5  16,260  0.80   −19,131   19,182       0.80 / −9,404<br>               M15   5,136  0.88    −6,587    6,673       0.88 / −3,146<br>               M30   2,604  0.91    −3,325    4,753       0.92 / −1,525<br>                H1   1,342  1.00       −95    3,023         1.01 / +150<br>                H4     325  0.83    −2,249    4,068         0.85 / −967<br>GBPUSD          M5  16,159  0.80   −24,697   25,398      0.80 / −12,239<br>               M15   5,218  0.86   −10,229   10,548       0.86 / −5,046<br>               M30   2,591  0.86    −7,186    9,323       0.86 / −3,471<br>                H1   1,346  0.92    −2,892    6,711       0.92 / −1,282<br>                H4     351  0.79    −3,995    6,375       0.84 / −1,581<br>NZDUSD          M5  17,417  0.66   −30,819   30,981      0.66 / −15,812<br>               M15   5,268  0.79    −9,935   10,221       0.77 / −5,353<br>               M30   2,606  0.84    −5,062    5,601       0.82 / −2,908<br>                H1   1,243  0.92    −1,728    3,069       0.89 / −1,195<br>                H4     277  1.11    +1,037    1,177         1.08 / +352<br>US500           M5  14,300  0.98    −1,784    3,788       1.04 / +1,315<br>               M15   4,693  0.97    −1,456    3,355       1.07 / +1,481<br>               M30   2,258  0.97    −1,026    2,236       1.12 / +1,691<br>                H1   1,216  1.01      +217    2,067       1.21 / +2,277<br>                H4     314  0.96      −477    2,408       1.53 / +2,260<br>BTCUSD*         M5   7,706  0.93  −116,995  124,451      0.95 / −38,110<br>               M15   2,565  0.97   −31,183   70,453       1.01 / +3,607<br>               M30   1,264  0.99    −4,798   71,587      1.05 / +17,547<br>                H1     653  1.03   +12,462   46,893      1.10 / +24,584<br>                H4     171  1.02    +5,525   88,666      1.21 / +23,228</pre><p><em>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.</em></p><p>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.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*inO-Wdn2TFDm3lnl.png" /></figure><h3>Why does a “5 Min 15 Min” scalper only work on H1?</h3><p>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 <em>before</em> costs, and spread plus commission add another 0.16. So the signal itself has nothing on M15, and costs just make it worse.</p><p>On H1 the average trade makes +3.21 before costs. Costs are still about 0.16, which barely dents it.</p><p>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.</p><h3>Is the gold H1 result real?</h3><p>I tried to break it four ways, and it held each time.</p><p><strong>Random timing test.</strong> 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.</p><p><strong>Moving the candle open.</strong> 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.</p><p><strong>Settings.</strong> 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.</p><p><strong>Older data.</strong> 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:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QaA-4ExSCcN2Kb32.png" /></figure><ul><li><strong>M15</strong>. 2004–2019 PF (after swap): 0.90 · 2020–2026 PF: 0.91</li><li><strong>M30</strong>. 2004–2019 PF (after swap): 0.97 · 2020–2026 PF: 1.16 · Random timing test, 2004–2019: beats 96%</li><li><strong>H1</strong>. 2004–2019 PF (after swap): <strong>1.10</strong> (+85% of price, 2,577 trades) · 2020–2026 PF: <strong>1.27</strong> · Random timing test, 2004–2019: <strong>beats 99.5%</strong></li><li><strong>H4</strong>. 2004–2019 PF (after swap): 0.98 · 2020–2026 PF: 1.04 · Random timing test, 2004–2019: beats 89.5%</li></ul><p>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.</p><p>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.</p><h3>What are the best Super Scalper settings?</h3><p>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.</p><p>Then I took each layer away to see which one matters:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iP-ORWamRCqPpV0-.png" /></figure><ul><li><strong>Remove the double RSI filter</strong> 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.</li><li><strong>Switch on the stop and target the author calculated</strong> (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.</li></ul><p>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.</p><h3>Gold H1 by year</h3><pre>Exness gold H1  2020  2021  2022  2023  2024    2025  2026 (to Sep)<br>-------------------------------------------------------------------<br>Trades           123   170   172   201   175     157            118<br>PF              1.69  1.24  1.00  0.83  1.32    1.63           1.32<br>Net             +611  +227    +4  −227  +407  +1,284         +1,103</pre><p>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.</p><h3>Risk structure</h3><ul><li><strong>No stop loss.</strong> A position only closes on the opposite signal. A wrong-way trade can run for days.</li><li><strong>Win rate is low:</strong> 35% on gold H1. Profits come from a few long rides.</li></ul><p><strong>The ten worst gold H1 trades</strong> were all in 2026, when gold moved 100+ USD in a day. USD per 0.01 lot, before swap:</p><ul><li><strong>23 Jan 2026 09:00</strong>. Exit: 26 Jan 15:00 · Side: Sell · Entry → exit price: 4,913.9 → 5,096.4 · Loss: −182.58 · Held: 78 h</li><li><strong>2 Jun 2026 05:00</strong>. Exit: 5 Jun 13:00 · Side: Buy · Entry → exit price: 4,517.3 → 4,406.4 · Loss: −110.96 · Held: 80 h</li><li><strong>9 Mar 2026 00:00</strong>. Exit: 10 Mar 02:00 · Side: Sell · Entry → exit price: 5,076.2 → 5,184.3 · Loss: −108.21 · Held: 26 h</li><li><strong>26 Jan 2026 19:00</strong>. Exit: 27 Jan 21:00 · Side: Sell · Entry → exit price: 5,069.1 → 5,176.7 · Loss: −107.72 · Held: 26 h</li><li><strong>17 Apr 2026 13:00</strong>. Exit: 21 Apr 15:00 · Side: Buy · Entry → exit price: 4,846.3 → 4,739.2 · Loss: −107.21 · Held: 98 h</li><li><strong>1 May 2026 14:00</strong>. Exit: 4 May 16:00 · Side: Buy · Entry → exit price: 4,625.3 → 4,521.6 · Loss: −103.71 · Held: 74 h</li><li><strong>4 Feb 2026 01:00</strong>. Exit: 4 Feb 16:00 · Side: Buy · Entry → exit price: 5,015.8 → 4,920.7 · Loss: −95.17 · Held: 15 h</li><li><strong>15 Jan 2026 14:00</strong>. Exit: 20 Jan 04:00 · Side: Sell · Entry → exit price: 4,588.5 → 4,680.2 · Loss: −91.78 · Held: 110 h</li><li><strong>21 Jan 2026 20:00</strong>. Exit: 22 Jan 16:00 · Side: Sell · Entry → exit price: 4,781.3 → 4,871.9 · Loss: −90.63 · Held: 20 h</li><li><strong>20 Mar 2026 08:00</strong>. Exit: 20 Mar 14:00 · Side: Buy · Entry → exit price: 4,706.4 → 4,616.3 · Loss: −90.16 · Held: 6 h</li></ul><p>At current gold prices, one bad trade costs around 180 USD per 0.01 lot. Size for that.</p><ul><li><strong>What isn’t a red flag:</strong> no martingale, no grid, no averaging down.</li></ul><h3>Who should use it?</h3><p>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.</p><p>Don’t run it on M5 or M15, whatever the name says. And don’t wire up the stop loss in the code.</p><h3>What I couldn’t verify</h3><ul><li><strong>TradingView’s own report.</strong> My numbers come from my port, not TradingView’s tester.</li><li><strong>NIFTY.</strong> 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.</li><li><strong>Forex swap.</strong> 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.</li><li><strong>Live fills.</strong> 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.</li></ul><h3>Bottom line</h3><p>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.</p><p>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 <a href="https://moonthetrain.com/lab/tradingview-macd-reloaded-strategy-backtest">MACD ReLoaded backtest</a>; for one where a chart setting creates fake profits, the <a href="https://moonthetrain.com/lab/tradingview-ut-bot-strategy-backtest">UT Bot backtest</a>.</p><p><em>I’m not affiliated with TradingView or VinayKumarKV. Past results, including backtests, don’t guarantee future results.</em></p><p><em>Originally published at </em><a href="https://moonthetrain.com/lab/tradingview-super-scalper-strategy-backtest"><em>https://moonthetrain.com</em></a><em> on November 18, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8faea460a7e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TradingView MACD ReLoaded Strategy: Best Settings, Backtest]]></title>
            <link>https://medium.com/@moonthetrain/tradingview-macd-reloaded-strategy-best-settings-backtest-6b426c03615e?source=rss-6e40fe3c7276------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b426c03615e</guid>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[backtesting]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[tradingview]]></category>
            <dc:creator><![CDATA[Truong Pham | Moon The Train]]></dc:creator>
            <pubDate>Fri, 13 Nov 2026 01:52:18 GMT</pubDate>
            <atom:updated>2026-11-18T01:24:40.489Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>The short version.</strong> 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.</p><ul><li><strong>Bitcoin H4 is one of the better results in this series.</strong> 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.</li><li><strong>And it held up after the script was published.</strong> 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.</li><li><strong>But it’s fading.</strong> By year: 2024 PF 1.64, 2025 1.23, 2026 so far 1.09.</li><li><strong>Gold H1 looked good (PF 1.21) until I split it by year.</strong> 2026 alone made 75% of the profit, and from 2004 to 2019 the same setup broke even.</li><li><strong>Forex lost.</strong> EURUSD, GBPUSD and NZDUSD: PF 0.69 to 1.07 from M5 to H4.</li><li><strong>The author’s tip “use SMA or WMA on daily charts” didn’t hold.</strong> 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.</li></ul><p>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.</p><h3>What is the MACD ReLoaded strategy on TradingView?</h3><p>It’s the <a href="https://www.tradingview.com/script/VO6DY8s1-MACD-ReLoaded-STRATEGY/">strategy version</a> 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.</p><p>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 <strong>VAR</strong>, 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.</p><p>The trading part is short:</p><pre>MA12 = getMA(close, 12)<br>MA26 = getMA1(close, 26)<br>src2 = MA12 - MA26              // MACD line<br>MATR = getMA2(src2, 9)          // signal line<br>hist = src2 - MATR</pre><pre>if ta.crossover(hist, 0)<br>    strategy.entry(&#39;MacdLong&#39;, strategy.long)<br>if ta.crossunder(hist, 0)<br>    strategy.entry(&#39;MacdShort&#39;, strategy.short)</pre><p>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 window() function that would use them is never called, so they do nothing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BTkOy-QxbZ5CnqZ4.png" /></figure><p>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.</p><h3>Does MACD ReLoaded repaint?</h3><p>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.</p><p>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.</p><h3>How I tested it</h3><ul><li><strong>Port:</strong> Python, signals on the close, fills at the next open, stop-and-reverse like strategy.entry. Default settings: VAR, 12/26/9, close.</li><li><strong>Data:</strong> 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.</li><li><strong>Costs:</strong> 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.</li><li><strong>Bitcoin swap:</strong> 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.</li><li><strong>Longer history:</strong> Dukascopy Bitcoin M5 from May 2017 and Dukascopy gold M1 from 2004.</li><li><strong>Size:</strong> fixed, no compounding. Gold in USD per 0.01 lot, forex in pips, Bitcoin in USD per 1 BTC.</li></ul><h3>The results</h3><p><strong>Profit factor after spread and commission, default settings:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SynX25BPiiBqqIvN.png" /></figure><p>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.</p><h3>Is MACD ReLoaded profitable on Bitcoin?</h3><p>On H4 so far, yes, including swap. This is the part that surprised me.</p><p><strong>BTCUSD, 1 Jan 2024–3 Nov 2026, long + short unless noted:</strong></p><ul><li><strong>H1</strong>. Trades: 918 · PF before swap: 1.03 · PF after swap: 1.02 · Net after swap: +10,627 · Max drawdown: 49,968</li><li><strong>H4</strong>. Trades: <strong>223</strong> · PF before swap: <strong>1.34</strong> · PF after swap: <strong>1.30</strong> · Net after swap: <strong>+76,316</strong> · Max drawdown: <strong>24,685</strong></li><li><strong>H4 long only</strong>. Trades: 111 · PF before swap: 1.54 · PF after swap: 1.45 · Net after swap: +51,477 · Max drawdown: 19,537</li><li><strong>D1</strong>. Trades: 27 · PF before swap: 1.66 · PF after swap: 1.57 · Net after swap: +50,393 · Max drawdown: 39,428</li><li><strong>Buy and hold</strong>. Trades: 1 · Net after swap: +18,063 · Max drawdown: 67,188 (before swap)</li></ul><p><em>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.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tIDrclFHlc0t0WKV.png" /></figure><p>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.</p><p>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.</p><p><strong>Now the worrying part:</strong></p><pre>BTCUSD H4 after swap  2024  2025  2026 (to 3 Nov)<br>-------------------------------------------------<br>Long + short          1.64  1.23             1.09<br>Long only             3.20  1.14             0.92</pre><p>The edge has shrunk every year. Long only is already losing in 2026.</p><h3>Did it work on Bitcoin after it was published?</h3><p>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:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sgbYrCMpDSrbZTod.png" /></figure><pre>PF, long + short   2017 – Jul 2021  Jul 2021 – Jun 2026<br>-------------------------------------------------------<br>H1, VAR                       1.24                 1.02<br>H4, VAR (default)             1.29                 1.26<br>D1, VAR                       1.38                 1.50<br>D1, SMA                       2.31                 1.16<br>D1, WMA                       1.53                 1.09</pre><p>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.</p><h3>What are the best MACD ReLoaded settings?</h3><p>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.</p><p><strong>Tip one holds.</strong> 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.</p><p><strong>Tip two doesn’t.</strong> Here’s Bitcoin, sorted by what looked best before publishing:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*woejFgKm1oTOASUK.png" /></figure><p>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.</p><p>So my answer for “best settings” is boring: leave the default. VAR 12/26/9 on H4.</p><h3>Is the gold result real?</h3><p>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:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bJPGQGV2WrFmXwRS.png" /></figure><pre>Gold H1, by year  2020  2021  2022  2023  2024  2025    2026<br>------------------------------------------------------------<br>PF                1.04  1.09  1.03  0.82  1.04  1.24    1.63<br>Net                +73  +110   +39  −260   +78  +726  +2,258</pre><p>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.</p><p>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.</p><p>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.</p><h3>Risk structure</h3><ul><li><strong>No stop loss.</strong> A trade ends only when the histogram crosses zero again. On Bitcoin H4 that means holding a wrong-way trade for days.</li><li><strong>The worst losses on Bitcoin were shorts during breakouts.</strong> Ten worst H4 trades after swap, USD per BTC:</li></ul><pre>Entry                      Exit  Side     Entry → exit price    Loss<br>--------------------------------------------------------------------<br>6 Mar 2024 00:00   11 Mar 12:00  Sell    63,756.7 → 71,510.8  −7,756<br>1 Dec 2025 04:00    2 Dec 20:00  Sell    86,358.9 → 91,932.4  −5,575<br>17 Nov 2024 04:00  20 Nov 16:00  Sell    90,255.5 → 94,836.0  −4,582<br>13 Oct 2025 20:00  14 Oct 12:00   Buy  115,902.0 → 111,400.4  −4,520<br>4 Mar 2025 12:00    5 Mar 16:00  Sell    83,972.1 → 88,338.6  −4,368<br>22 Aug 2025 20:00  24 Aug 20:00   Buy  116,672.8 → 112,575.5  −4,099<br>12 May 2025 16:00  19 May 00:00  Sell  102,513.3 → 106,465.8  −3,955<br>8 Jul 2025 04:00    9 Jul 20:00  Sell  107,923.1 → 111,755.9  −3,835<br>31 Oct 2024 16:00   6 Nov 04:00  Sell    70,531.1 → 74,330.3  −3,801<br>1 Jul 2025 16:00    2 Jul 20:00  Sell  106,089.3 → 109,749.0  −3,662</pre><p>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.</p><ul><li><strong>Win rate is low:</strong> 42% on Bitcoin H4, 35% on gold H1. Profits come from a few long trends.</li><li><strong>What isn’t a red flag:</strong> no martingale, no grid, no averaging down.</li></ul><h3>Is the Bitcoin result statistically real?</h3><p>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.</p><p>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.</p><h3>Who should use it?</h3><p>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.</p><p>I wouldn’t run it on forex, and I wouldn’t trust the gold H1 result to continue after the 2026 rally ends.</p><h3>What I couldn’t verify</h3><ul><li><strong>TradingView’s own report.</strong> My numbers come from my port, not from TradingView’s strategy tester.</li><li><strong>Binance BTCUSDT.</strong> The author’s chart is Binance spot; mine are Exness CFD ticks and Dukascopy. Spot has no swap but has different fees.</li><li><strong>The exact swap on Exness Raw.</strong> 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.</li><li><strong>Forex swap.</strong> Not included. It wouldn’t rescue PF 0.69–1.07.</li><li><strong>Out-of-sample on Exness Bitcoin.</strong> Only 2024–2026 exists. I’ll rerun it as new data comes in.</li></ul><h3>Bottom line</h3><p>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.</p><p>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 <a href="https://moonthetrain.com/lab/tradingview-tott-strategy-backtest">TOTT backtest</a>; for one where a backtest setting creates fake profits, the <a href="https://moonthetrain.com/lab/tradingview-ut-bot-strategy-backtest">UT Bot backtest</a>.</p><p><em>I’m not affiliated with TradingView or KivancOzbilgic. Past results, including backtests, don’t guarantee future results.</em></p><p><em>Originally published at </em><a href="https://moonthetrain.com/lab/tradingview-macd-reloaded-strategy-backtest"><em>https://moonthetrain.com</em></a><em> on November 13, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b426c03615e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TradingView TOTT Strategy: Best Settings, Repaint, Backtest]]></title>
            <link>https://medium.com/@moonthetrain/tradingview-tott-strategy-best-settings-repaint-backtest-c9c79fa7da22?source=rss-6e40fe3c7276------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9c79fa7da22</guid>
            <category><![CDATA[tradingview]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[backtesting]]></category>
            <dc:creator><![CDATA[Truong Pham | Moon The Train]]></dc:creator>
            <pubDate>Wed, 11 Nov 2026 08:37:59 GMT</pubDate>
            <atom:updated>2026-11-17T03:01:53.429Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>The short version.</strong> 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.</p><ul><li><strong>Gold since 2020 looks good.</strong> 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.</li><li><strong>Gold from 2004 to 2019 didn’t.</strong> The same M15 setup made PF 0.99 over sixteen years while gold rose 266%. H4 went backwards.</li><li><strong>Almost all of the profit came from the long side.</strong> Shorts lost money on gold H1, H4 and D1, on USDJPY and on Bitcoin.</li><li><strong>Forex mostly lost or broke even.</strong> 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.</li><li><strong>The “twin” part doesn’t help.</strong> Splitting OTT into two lines cut trades by about a quarter and raised PF in 11 of 18 cases, lowered it in 7.</li></ul><p>My verdict: TOTT is a slow trend follower that rode the 2020s gold rally. I didn’t find an edge beyond that.</p><h3>What is the TOTT strategy on TradingView?</h3><p>It’s a moving average that flips the trade when it crosses a trailing band set 1% away from itself. The <a href="https://www.tradingview.com/script/eENf7NpJ/">Twin Optimized Trend Tracker Strategy</a> 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”.</p><p>Here’s the core of the code with the defaults (OTT period 40, optimization constant 1, twin coefficient 0.001, VAR average):</p><pre>MAvg = getMA(src, length)            // VAR: EMA scaled by |CMO(9)|<br>fark = MAvg * percent * 0.01<br>longStop  := MAvg &gt; longStopPrev  ? math.max(longStop, longStopPrev)   : longStop<br>shortStop := MAvg &lt; shortStopPrev ? math.min(shortStop, shortStopPrev) : shortStop<br>MT  = dir == 1 ? longStop : shortStop<br>OTT = MAvg &gt; MT ? MT * (200 + percent) / 200 : MT * (200 - percent) / 200<br>OTTup = OTT * (1 + coeff)<br>OTTdn = OTT * (1 - coeff)<br>buySignalk  = ta.crossover(MAvg, OTTup[2])<br>sellSignalk = ta.crossunder(MAvg, OTTdn[2])</pre><p>In plain words:</p><ol><li><strong>The support line</strong> 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.</li><li><strong>The stop</strong> 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.</li><li><strong>The twin lines</strong> are that stop shifted up 0.1% and down 0.1%.</li><li><strong>The signals</strong> 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.</li></ol><p>So it’s a cousin of SuperTrend and <a href="https://moonthetrain.com/lab/tradingview-pmax-strategy-backtest">PMax</a>, not of Bollinger Bands: the band is a fixed percent of price, not volatility, and it ratchets in one direction.</p><p>Here’s what that looks like on gold H1:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0971hmdHEP9Qm8tl.png" /></figure><p>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.</p><p>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.</p><h3>Does TOTT repaint?</h3><p>No. It decides at the bar close and fills at the next bar’s open, and the [2] on the OTT lines looks back, not forward. The barssince calls only colour the chart and place labels; they don&#39;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&#39;s normal history that&#39;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.</p><h3>How I tested it</h3><ul><li><strong>Port:</strong> 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 strategy.entry. A repeated buy while already long is ignored, as in Pine.</li><li><strong>Data:</strong> Exness Raw Spread tick archives for XAUUSD, EURUSD, GBPUSD, USDJPY and NZDUSD, January 2020 to September 2026. BTCUSD from January 2024 to October 2026.</li><li><strong>Costs:</strong> 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.</li><li><strong>Older gold data:</strong> Dukascopy M1 bars via Tickstory, 2004 to July 2026, spread from the data, swap on longs scaled to the gold price of the time.</li><li><strong>Size:</strong> fixed, no compounding. Gold in USD per 0.01 lot (one ounce), forex in pips, Bitcoin in USD per 1 BTC.</li></ul><h3>Is the TradingView backtest accurate?</h3><p>For TOTT, mostly yes. The script has no commission and TradingView can’t model spread or swap (more on that in the <a href="https://moonthetrain.com/lab/tradingview-supertrend-strategy-backtest">SuperTrend backtest</a>), but TOTT trades so rarely that costs barely move it:</p><pre>Default settings, long + short  Trades  PF 0-cost  PF real<br>----------------------------------------------------------<br>Gold M15                           333       1.54     1.52<br>EURUSD M5                          355       0.91     0.89<br>USDJPY M5                          415       1.04     1.01<br>BTCUSD M5                          707       1.04     1.02</pre><p>Swap is the cost that matters here, because trades last days. It’s further down.</p><h3>The results</h3><p><strong>Profit factor after spread and commission, default settings:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HXViACpTqEw1quxV.png" /></figure><p>The D1 column has 5 to 19 trades per cell. Ignore it. USDJPY H4 (1.54) is 37 trades.</p><p><strong>Gold (XAUUSD Raw Spread), 29 Jan 2020 — Sep 2026, before swap:</strong></p><pre>Timeframe        Direction  Trades   Win%    PF     Net  Max DD<br>---------------------------------------------------------------<br>M5            long + short     656  38.1%  1.24  +2,443   1,095<br>M15           long + short     333  38.7%  1.52  +3,429   1,280<br>H1            long + short     141  37.6%  1.44  +1,871     969<br>H4            long + short      60  31.7%  1.25    +756   1,662<br>M15              long only     166  44.0%  2.03  +3,013     952<br>H1               long only      70  44.3%  2.14  +2,236   1,073<br>Buy and hold                     1               +2,588   1,629</pre><p><em>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.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lobipqd9pXgnNHty.png" /></figure><p>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.</p><p><strong>Forex, Bitcoin and USDJPY, long + short, after costs:</strong></p><pre>M5   M15    H1    H4<br>----------------------------------------<br>EURUSD            0.89  1.04  1.10  0.95<br>GBPUSD            0.93  0.91  1.30  0.90<br>NZDUSD            0.79  0.81  0.94  0.97<br>USDJPY            1.01  0.92  1.17  1.54<br>BTCUSD (2024–26)  1.02  0.96  1.10  0.99</pre><p>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.</p><h3>Is the gold M15 result real?</h3><p>It passed one test that most of these strategies fail, then failed the one that matters.</p><ul><li><strong>Every year was positive.</strong> 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.</li><li><strong>It beat random timing.</strong> 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.</li><li><strong>A handful of trades carry it.</strong> The ten best trades made +3,655. The other 323 lost 226 together.</li><li><strong>Before 2020 it broke even.</strong> Below.</li></ul><h3>Does TOTT work on gold before 2020?</h3><p>No. I ran the same defaults on Dukascopy gold from 2004 to 2019. I hadn’t looked at that data when I picked M15.</p><pre>Gold, 2004–2019   Trades  PF after swap  Summed return  Long / short<br>--------------------------------------------------------------------<br>M5 long + short    1,476           1.08           +62%   +86% / −25%<br>M15 long + short     808           0.99            −1%   +56% / −57%<br>H1 long + short      336           1.07           +61%   +87% / −27%<br>H4 long + short      144           1.14           −15%   +47% / −62%<br>H1 long only         168           1.23           +87%</pre><p><em>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.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VOY0AKYRdQ8wL-p3.png" /></figure><p>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.</p><h3>What are the best TOTT settings?</h3><p>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:</p><ul><li><strong>XAUUSD M15, 2020–26</strong>. Combos with PF &gt; 1: 82 / 90 · Profitable in both halves: 68 · Median PF: 1.27</li><li><strong>XAUUSD H1, 2020–26</strong>. Combos with PF &gt; 1: 78 / 90 · Profitable in both halves: 56 · Median PF: 1.34</li><li><strong>XAUUSD H4, 2020–26</strong>. Combos with PF &gt; 1: 74 / 90 · Profitable in both halves: 36 · Median PF: 1.46</li><li><strong>USDJPY H4</strong>. Combos with PF &gt; 1: 80 / 90 · Profitable in both halves: 58 · Median PF: 1.54</li><li><strong>EURUSD H1</strong>. Combos with PF &gt; 1: 37 / 90 · Profitable in both halves: 11 · Median PF: 0.97</li><li><strong>GBPUSD H1</strong>. Combos with PF &gt; 1: 55 / 90 · Profitable in both halves: 31 · Median PF: 1.06</li><li><strong>NZDUSD H1</strong>. Combos with PF &gt; 1: 30 / 90 · Profitable in both halves: 1 · Median PF: 0.87</li><li><strong>BTCUSD H1</strong>. Combos with PF &gt; 1: 49 / 90 · Profitable in both halves: 36 · Median PF: 1.02</li><li><strong>XAUUSD M15, 2004–19</strong>. Combos with PF &gt; 1: 68 / 90 · Profitable in both halves: 9 · Median PF: 1.04</li><li><strong>XAUUSD H4, 2004–19</strong>. Combos with PF &gt; 1: 32 / 90 · Profitable in both halves: 15 · Median PF: 0.96</li></ul><p><em>“Both halves” = profitable in the first and second half of the data. For 2004–19 the halves are 2004–2011 and 2012–2019.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kDndMH3oPl3Vfe9W.png" /></figure><p>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.</p><h3>Does the twin line help?</h3><p>Not in any consistent way. Setting the coefficient to 0 gives you plain OTT, one line. Here’s the default 0.001 against that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EwnB9HXAit-wOhUs.png" /></figure><p>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.</p><h3>How does it compare with UT Bot, Hull Suite, PMax and SuperTrend?</h3><p>On gold since 2020, TOTT has the best H1 number of the five. Same Exness data, same costs, default settings, long + short:</p><ul><li><strong>TOTT</strong>. H1 PF: 1.44 · H4 PF: 1.25</li><li><a href="https://moonthetrain.com/lab/tradingview-ut-bot-strategy-backtest"><strong>UT Bot</strong></a>. H1 PF: 1.04 · H4 PF: 1.17</li><li><a href="https://moonthetrain.com/lab/tradingview-hull-suite-strategy-backtest"><strong>Hull Suite</strong></a>. H1 PF: 1.28 · H4 PF: 1.25</li><li><a href="https://moonthetrain.com/lab/tradingview-pmax-strategy-backtest"><strong>PMax</strong></a>. H1 PF: 1.37 · H4 PF: 0.98</li><li><strong>SuperTrend</strong>. H1 PF: 1.09 · H4 PF: 1.90</li></ul><p>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.</p><h3>Risk structure</h3><ul><li><strong>No stop loss.</strong> 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.</li><li><strong>Whipsaws come in runs.</strong> That sell was followed by a buy that lost 165 and another sell that lost 129, −521 in twelve days:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mo8gZrhnIc8bUbF3.png" /></figure><ul><li><strong>Nine of the ten worst gold M15 trades were between October 2025 and August 2026</strong>, losing 121 to 227 each. A fixed lot risks more as gold gets more expensive.</li><li><strong>Swap.</strong> 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.</li><li><strong>Losing streaks.</strong> The longest on gold M15 was 10 trades. The win rate is 31–44% everywhere.</li><li><strong>What isn’t a red flag:</strong> no martingale, no grid, no averaging.</li></ul><h3>Who should use it?</h3><p>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.</p><h3>What I couldn’t verify</h3><ul><li><strong>TradingView’s own report.</strong> My numbers come from my port. I didn’t export TradingView’s strategy tester results to compare trade by trade.</li><li><strong>Turkish stocks.</strong> OTT was designed for BIST shares, often on daily bars. I only had forex, gold and Bitcoin ticks.</li><li><strong>Forex swap.</strong> Not included in the forex numbers. It wouldn’t rescue PF 0.79.</li><li><strong>Bitcoin before 2024.</strong> Under three years of Exness BTC ticks.</li><li><strong>Daily candles.</strong> 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.</li></ul><h3>Bottom line</h3><p>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.</p><p>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 <a href="https://moonthetrain.com/lab/tradingview-ut-bot-strategy-backtest">UT Bot backtest</a> uses the same data if you want to compare.</p><p><em>I’m not affiliated with TradingView, KivancOzbilgic or Anıl Özekşi. Past results, including backtests, don’t guarantee future results.</em></p><p><em>Originally published at </em><a href="https://moonthetrain.com/lab/tradingview-tott-strategy-backtest"><em>https://moonthetrain.com</em></a><em> on November 11, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9c79fa7da22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TradingView UT Bot Strategy: Heikin Ashi Backtest Is Fake]]></title>
            <link>https://medium.com/@moonthetrain/tradingview-ut-bot-strategy-heikin-ashi-backtest-is-fake-a8518bfd87c1?source=rss-6e40fe3c7276------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8518bfd87c1</guid>
            <category><![CDATA[backtesting]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[tradingview]]></category>
            <dc:creator><![CDATA[Truong Pham | Moon The Train]]></dc:creator>
            <pubDate>Wed, 11 Nov 2026 07:35:49 GMT</pubDate>
            <atom:updated>2026-11-17T01:23:55.768Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>The short version.</strong> 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.</p><ul><li><strong>The Heikin Ashi chart backtest is fake.</strong> 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.</li><li><strong>Forex lost money on every timeframe.</strong> EURUSD, GBPUSD, NZDUSD and USDJPY: profit factor 0.52 to 1.00 from M5 to D1 after costs.</li><li><strong>Gold H4 is the only real positive.</strong> 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.</li><li><strong>Gold 2004–2019, data I didn’t use to pick H4: PF 1.00.</strong> Sixteen years of break-even.</li><li><strong>M5 and M15 lose everywhere.</strong> About 35–40 trades a day, and the spread eats all of it.</li></ul><p>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.</p><h3>What is the UT Bot strategy on TradingView?</h3><p>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 <a href="https://www.tradingview.com/script/VKMgZdYr/">UT Bot Strategy</a> 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.</p><p>Three inputs: <strong>Key Value</strong> (default 1), <strong>ATR Period</strong> (default 10) and a checkbox <strong>Signals from Heikin Ashi Candles</strong> (off). Here’s the core of the Pine code:</p><pre>xATR  = atr(c)<br>nLoss = a * xATR<br>xATRTrailingStop := iff(src &gt; nz(xATRTrailingStop[1], 0) and src[1] &gt; nz(xATRTrailingStop[1], 0), max(nz(xATRTrailingStop[1]), src - nLoss),<br>   iff(src &lt; nz(xATRTrailingStop[1], 0) and src[1] &lt; nz(xATRTrailingStop[1], 0), min(nz(xATRTrailingStop[1]), src + nLoss),<br>   iff(src &gt; nz(xATRTrailingStop[1], 0), src - nLoss, src + nLoss)))<br>...<br>buy  = src &gt; xATRTrailingStop and crossover(ema(src, 1), xATRTrailingStop)<br>sell = src &lt; xATRTrailingStop and crossover(xATRTrailingStop, ema(src, 1))<br>strategy.entry(&quot;long&quot;,   true, when = buy)<br>strategy.entry(&quot;short&quot;, false, when = sell)</pre><p>In plain words: while price stays above the line, the line moves up to close − Key × ATR 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. ema(src, 1) is just the close itself. There&#39;s no stop loss or take profit. The line <em>is</em> the stop, but it&#39;s only checked at the candle close, and the strategy is always in the market, long or short.</p><p>Here’s what that looks like on gold H4 with the defaults:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7xcyEQPyvJbF-nel.png" /></figure><p>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.</p><p>In a range it’s worse:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*62N9D3wJWCY4Xyb4.png" /></figure><p>Twelve trades in three weeks, net −234. That’s the whole pattern of this strategy in two pictures.</p><h3>Should you use UT Bot on Heikin Ashi candles?</h3><p>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.</p><p>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:</p><pre>No costs    Strategy on an HA chart  Same signals at real prices<br>----------------------------------------------------------------<br>XAUUSD H1     PF 11.26, 67% winners         PF 1.12, 36% winners<br>XAUUSD H4             PF 10.81, 68%                 PF 1.19, 38%<br>EURUSD M15             PF 9.99, 67%                 PF 0.94, 36%<br>EURUSD H4             PF 11.52, 69%                 PF 1.05, 38%<br>BTCUSD M5              PF 9.39, 66%                 PF 1.04, 36%<br>BTCUSD H1             PF 10.15, 66%                 PF 1.01, 36%</pre><p><em>Exness ticks, gold and EURUSD Jan 2020 — Sep 2026, BTCUSD Jan 2024 — Nov 2026, Key 1 and ATR 10.</em></p><p>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:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*d316sgkH0abdDU0n.png" /></figure><p>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.</p><h3>Does UT Bot repaint?</h3><p>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 security() on the same timeframe with lookahead = false, so it doesn&#39;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&#39;t repainting. It&#39;s the HA chart fills above.</p><h3>What does the author claim?</h3><p>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.</p><h3>How I tested it</h3><ul><li><strong>Port:</strong> Python, line for line, including Pine’s nz(stop[1], 0) start-up and the RMA-based atr(). Signals at the bar close, fills at the next bar&#39;s open, stop-and-reverse like strategy.entry.</li><li><strong>Data:</strong> 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.</li><li><strong>Costs:</strong> 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.</li><li><strong>Older gold data:</strong> Dukascopy M1 bars via Tickstory, 2004 to July 2026, spread from the data, swap on longs scaled to the gold price of the time.</li><li><strong>Size:</strong> fixed, no compounding. Gold in USD per 0.01 lot (one ounce), forex in pips, Bitcoin in USD per 1 BTC.</li></ul><h3>Is the TradingView backtest accurate?</h3><p>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 <a href="https://moonthetrain.com/lab/tradingview-supertrend-strategy-backtest">SuperTrend backtest</a>). UT Bot trades a lot, so this matters more than usual:</p><ul><li><strong>Gold M5</strong>. Trades: 61,372 · PF, no costs: 1.00 · PF, real costs: 0.90 · Net, no costs → real: +286 → −9,527 USD</li><li><strong>Gold H4</strong>. Trades: 1,219 · PF, no costs: 1.19 · PF, real costs: 1.17 · Net, no costs → real: +2,437 → +2,245 USD</li><li><strong>EURUSD M5</strong>. Trades: 68,889 · PF, no costs: 0.90 · PF, real costs: 0.66 · Net, no costs → real: −17,660 → −76,718 pips</li><li><strong>USDJPY M15</strong>. Trades: 20,362 · PF, no costs: 1.00 · PF, real costs: 0.83 · Net, no costs → real: +587 → −26,370 pips</li><li><strong>BTCUSD M5</strong>. Trades: 36,295 · PF, no costs: 1.02 · PF, real costs: 0.90 · Net, no costs → real: +78,215 → −384,201 USD</li></ul><p>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.</p><h3>The results</h3><p><strong>Profit factor after spread and commission, default Key 1 / ATR 10:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*E1eYZam2sep9tdMU.png" /></figure><p>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.</p><p><strong>Gold (XAUUSD Raw Spread), 29 Jan 2020 — Sep 2026, before swap:</strong></p><pre>Timeframe        Direction  Trades   Win%    PF     Net  Max DD<br>---------------------------------------------------------------<br>M5            long + short  61,372  33.1%  0.90  −9,527  11,026<br>M15           long + short  19,483  34.2%  0.93  −4,100   4,383<br>H1            long + short   4,565  35.7%  1.04    +931   1,099<br>H4            long + short   1,219  37.2%  1.17  +2,245     809<br>H4               long only     609  39.2%  1.38  +2,413     816<br>D1            long + short     239  42.3%  1.07    +459   1,807<br>Buy and hold                     1               +2,591   1,579</pre><p><em>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.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mAFRbtNo3K-k1yua.png" /></figure><p>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.</p><h3>Is the gold H4 result real?</h3><p>Probably not, or at least not in a way you could count on. Four things point the same way:</p><ul><li><strong>It all came from two years.</strong> 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.</li><li><strong>A handful of trades carry it.</strong> The ten best trades made +2,460. The other 1,209 trades lost 216 together.</li><li><strong>Random timing comes close.</strong> 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.</li><li><strong>Before 2020 it broke even.</strong> Below.</li></ul><h3>Does it work on gold before 2020?</h3><p>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.</p><pre>Gold, 2004–2019    Trades  PF after swap  Summed return<br>-------------------------------------------------------<br>M5 long + short   134,789           0.61        −4,421%<br>M15 long + short   42,685           0.74        −1,523%<br>H1 long + short    10,297           0.89          −333%<br>H4 long + short     2,694           1.00         −11.5%<br>H4 long only        1,347           1.05           +50%<br>D1 long only          284           1.16           +67%</pre><p><em>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.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*t0V5qd_3Ps1wXb8p.png" /></figure><p>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.</p><h3>What are the best UT Bot settings?</h3><p>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:</p><ul><li><strong>XAUUSD M15 (long + short)</strong>. Combos with PF &gt; 1: 37 / 84 · Profitable in both halves: 6 · Median PF: 0.98</li><li><strong>XAUUSD H1</strong>. Combos with PF &gt; 1: 76 / 84 · Profitable in both halves: 39 · Median PF: 1.08</li><li><strong>XAUUSD H4</strong>. Combos with PF &gt; 1: 84 / 84 · Profitable in both halves: 48 · Median PF: 1.18</li><li><strong>EURUSD M15</strong>. Combos with PF &gt; 1: <strong>0 / 84</strong> · Profitable in both halves: 0 · Median PF: 0.84</li><li><strong>EURUSD H1</strong>. Combos with PF &gt; 1: 5 / 84 · Profitable in both halves: 3 · Median PF: 0.87</li><li><strong>USDJPY H1</strong>. Combos with PF &gt; 1: 57 / 84 · Profitable in both halves: 42 · Median PF: 1.03</li><li><strong>NZDUSD H1 and H4</strong>. Combos with PF &gt; 1: <strong>0 / 84</strong> · Profitable in both halves: 0 · Median PF: 0.87</li><li><strong>BTCUSD H1</strong>. Combos with PF &gt; 1: 9 / 84 · Profitable in both halves: 6 · Median PF: 0.95</li></ul><p><em>“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.</em></p><p>Gold H4 looks great until you split it. Here are the 42 settings without Heikin Ashi, each half on its own:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DLN-wh93j4HgFF7g.png" /></figure><p>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.</p><p>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.</p><h3>How does it compare with Hull Suite, PMax and SuperTrend?</h3><p>It’s the weakest of the four on gold. Same Exness data, same costs, default settings, long + short:</p><ul><li><strong>UT Bot</strong>. H1 PF: 1.04 · H4 PF: 1.17</li><li><a href="https://moonthetrain.com/lab/tradingview-hull-suite-strategy-backtest"><strong>Hull Suite</strong></a>. H1 PF: 1.28 · H4 PF: 1.25</li><li><a href="https://moonthetrain.com/lab/tradingview-pmax-strategy-backtest"><strong>PMax</strong></a>. H1 PF: 1.37 · H4 PF: 0.98</li><li><strong>SuperTrend</strong>. H1 PF: 1.09 · H4 PF: 1.90</li></ul><p>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.</p><h3>Risk structure</h3><ul><li><strong>No stop loss beyond the line, and the line only counts at the close.</strong> 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.</li><li><strong>Whipsaws come in pairs.</strong> On 29 January 2026 a short at 5,182.88 lost 123, and the buy that replaced it lost 109 by the next morning.</li><li><strong>Nine of the ten worst gold H4 trades were in 2026</strong>, with gold at 4,000 to 5,300. A fixed lot risks more as price rises.</li><li><strong>Swap.</strong> 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).</li><li><strong>Losing streaks.</strong> 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.</li><li><strong>What isn’t a red flag:</strong> no martingale, no grid, no averaging.</li></ul><h3>Who should use it?</h3><p>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, <a href="https://moonthetrain.com/lab/tradingview-hull-suite-strategy-backtest">Hull Suite</a> held up better on the same data.</p><h3>What I couldn’t verify</h3><ul><li><strong>TradingView itself.</strong> 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.</li><li><strong>Forex swap.</strong> Not included in the forex numbers. It wouldn’t turn PF 0.66 into a winner.</li><li><strong>Bitcoin before 2024.</strong> I only have Exness BTC ticks from January 2024, so the BTC results cover under three years.</li><li><strong>Other brokers, stocks and indices.</strong> Exness data only, forex, gold and Bitcoin only.</li><li><strong>Daily candles.</strong> Mine close at UTC midnight; TradingView forex daily bars usually close at 17:00 New York.</li></ul><h3>Bottom line</h3><p>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.</p><p>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 <a href="https://moonthetrain.com/lab/tradingview-hull-suite-strategy-backtest">Hull Suite backtest</a> uses the same data if you want to compare.</p><p><em>I’m not affiliated with TradingView, QuantNomad, Yo_adriiiiaan or HPotter. Past results, including backtests, don’t guarantee future results.</em></p><p><em>Originally published at </em><a href="https://moonthetrain.com/lab/tradingview-ut-bot-strategy-backtest"><em>https://moonthetrain.com</em></a><em> on November 11, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8518bfd87c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TradingView Hull Suite Strategy: Repaint, Settings, Backtest]]></title>
            <link>https://medium.com/@moonthetrain/tradingview-hull-suite-strategy-repaint-settings-backtest-5e821ac4e866?source=rss-6e40fe3c7276------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e821ac4e866</guid>
            <category><![CDATA[tradingview]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[backtesting]]></category>
            <category><![CDATA[trading]]></category>
            <dc:creator><![CDATA[Truong Pham | Moon The Train]]></dc:creator>
            <pubDate>Tue, 10 Nov 2026 01:39:37 GMT</pubDate>
            <atom:updated>2026-11-10T06:38:44.377Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>The short version.</strong> 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.</p><ul><li><strong>Gold H1 looks great since 2020.</strong> 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.</li><li><strong>It holds up under stress.</strong> Shifted candle times, 39 settings, a random-timing test. On gold H1 it passed all three.</li><li><strong>But it needs gold to trend.</strong> 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.</li><li><strong>Forex lost money.</strong> EURUSD, GBPUSD and NZDUSD lost on M15 and H1. The short side never earned its keep anywhere.</li><li><strong>I couldn’t improve it.</strong> Trend filters, running 12 copies and ATR position sizing all failed on years I hadn’t used to pick them.</li></ul><p>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.</p><h3>What is the Hull Suite strategy on TradingView?</h3><p>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 <a href="https://www.tradingview.com/script/Q9OQye4C/">Hull Suite Strategy</a> 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.</p><p>The default is a Hull MA of the close with length 55:</p><p>HULL = WMA(2 × WMA(close, 27) − WMA(close, 55), 7)</p><p>Then it compares the line with its own value two bars earlier. Here’s the trading part of the Pine code (Pine v4):</p><pre>HULL = Mode(modeSwitch, src, length)<br>if HULL[0] &gt; HULL[2] and testPeriod()<br>    strategy.entry(&quot;buy&quot;, strategy.long)<br>if HULL[0] &lt; HULL[2] and testPeriod()<br>    strategy.entry(&quot;sell&quot;, strategy.short)</pre><p>One detail that’s easy to miss: the <strong>Strategy Direction</strong> input defaults to “long”, and the script calls strategy.risk.allow_entry_in(long). With that set, the sell signal doesn&#39;t open a short. It just closes the long. So out of the box, Hull Suite is long or flat. Switch the input to &quot;all&quot; and it becomes a stop-and-reverse system that&#39;s always in the market. I tested both.</p><p>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:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*d-1ZgrkY_Ej7sSIx.png" /></figure><p>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:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6DlcV5pWjccBnfdJ.png" /></figure><p>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.</p><h3>Does Hull Suite repaint?</h3><p>No. The strategy decides at the bar close and fills at the next bar’s open, and it doesn’t call security() 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 calc_on_every_tick = false, the strategy ignores that and only acts once the bar has closed. What you see on a historical chart is what you&#39;d have got, before costs.</p><h3>What does the author claim?</h3><p>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.</p><h3>How I tested it</h3><ul><li><strong>Port:</strong> 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 allow_entry_in: a sell signal closes the long and opens nothing.</li><li><strong>Main data:</strong> 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).</li><li><strong>Costs:</strong> 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.</li><li><strong>Older gold data:</strong> 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.</li><li><strong>Size:</strong> fixed, no compounding. Gold is in USD per 0.01 lot (one ounce), forex in pips.</li></ul><h3>Is the TradingView backtest accurate?</h3><p>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 <a href="https://moonthetrain.com/lab/tradingview-supertrend-strategy-backtest">SuperTrend backtest</a>. On H1 gold the gap is small. On forex M15 it decides the result:</p><pre>Test (long only)  Trades  PF 0-cost  PF real     Net 0-cost → real<br>------------------------------------------------------------------<br>Gold M15           3,766       1.15     1.11   +2,384 → +1,774 USD<br>Gold H1              892       1.50     1.47   +3,490 → +3,351 USD<br>USDJPY M15         3,949       1.10     0.98    +4,416 → −832 pips<br>EURUSD M15         3,965       0.96     0.86  −1,332 → −4,605 pips<br>NZDUSD M15         3,994       0.92     0.76  −2,083 → −7,310 pips</pre><p>USDJPY M15 is the one to look at. Profitable on a TradingView-style test, losing once you pay the spread.</p><h3>The results</h3><p><strong>Gold (XAUUSD Raw Spread), 29 Jan 2020 — Sep 2026, default settings, after spread and commission, before swap:</strong></p><pre>Timeframe        Direction  Trades   Win%    PF     Net  Max DD<br>---------------------------------------------------------------<br>M15              long only   3,766  34.9%  1.11  +1,774     638<br>H1               long only     892  39.0%  1.47  +3,351     506<br>H1            long + short   1,784  36.7%  1.28  +4,130     614<br>H4               long only     239  43.5%  1.66  +2,246   1,146<br>D1               long only      51  37.3%  2.14  +1,737   1,197<br>Buy and hold                     1               +2,588   1,600</pre><p><em>Net and drawdown in USD per 0.01 lot. Drawdown is on open equity.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tcE8DKkfGSnaAfkM.png" /></figure><p><strong>All five markets, profit factor after costs:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1pIaL_BQb8Vt-a5l.png" /></figure><p>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.</p><p>Adding shorts made gold H1 more profitable (+4,130 vs +3,351) and everything else worse or flat.</p><h3>Is the gold H1 result real?</h3><p>On 2020–2026 data, yes. Three checks:</p><ul><li><strong>Shifted candles.</strong> I cut H1 bars at :15, :30 and :45 past the hour. Long-only PF stayed between 1.47 and 1.55.</li><li><strong>Random timing.</strong> 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.</li><li><strong>Not a few lucky trades.</strong> The five biggest winners made +1,120. The other 887 trades made +2,232.</li></ul><p>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.</p><p>And here’s the catch. Split gold H1 long-only by year, as a percentage of the gold price:</p><ul><li><strong>Return per trade, summed</strong>. 2020: +21.0% · 2021: −1.1% · 2022: +0.2% · 2023: +9.5% · 2024: +18.6% · 2025: +42.8% · 2026 (to Sep): +22.3%</li></ul><p>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.</p><h3>Does it work on gold before 2020?</h3><p>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.</p><pre>Gold, 2004–2019  Trades  PF after swap  Summed return  Shorts<br>-------------------------------------------------------------<br>M15 long only     9,405           0.85          −249%<br>H1 long only      2,181           1.15          +118%<br>H1 long + short   4,361           1.09          +122%   +4.6%<br>H4 long only        594           1.05           +38%<br>H4 long + short   1,188           0.96           −36%    −74%<br>D1 long only        122           1.35           +73%</pre><p><em>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.</em></p><p>H1 long-only is still positive. But look at where the money came from:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*B6FsJh2tu1Vq171c.png" /></figure><ul><li><strong>2004–2011</strong>, gold’s long bull run: +129%, PF 1.38.</li><li><strong>2012–2019</strong>, gold slides from about 1,700 to 1,050 by late 2015 and then ranges: <strong>−11%, PF 0.95</strong>. Eight years of nothing.</li><li><strong>2020–2026</strong> on the same Tickstory data: +93%, PF 1.42, close to the Exness result.</li></ul><p>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%.</p><h3>What are the best Hull Suite settings?</h3><p>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:</p><ul><li><strong>XAUUSD H1</strong>. Combos with PF &gt; 1: <strong>39 / 39</strong> · PF &gt; 1.2: 31 · Profitable in 2020–22 and 2023–26: 29 · Median PF: 1.42 · Default PF: 1.47</li><li><strong>XAUUSD H4</strong>. Combos with PF &gt; 1: <strong>39 / 39</strong> · PF &gt; 1.2: 38 · Profitable in 2020–22 and 2023–26: 38 · Median PF: 1.60 · Default PF: 1.66</li><li><strong>USDJPY H1</strong>. Combos with PF &gt; 1: 38 · PF &gt; 1.2: 26 · Profitable in 2020–22 and 2023–26: 36 · Median PF: 1.24 · Default PF: 1.24</li><li><strong>USDJPY H4</strong>. Combos with PF &gt; 1: 39 · PF &gt; 1.2: 27 · Profitable in 2020–22 and 2023–26: 36 · Median PF: 1.25 · Default PF: 1.28</li><li><strong>EURUSD H1</strong>. Combos with PF &gt; 1: 15 · PF &gt; 1.2: 0 · Profitable in 2020–22 and 2023–26: 10 · Median PF: 0.95 · Default PF: 0.87</li><li><strong>GBPUSD H1</strong>. Combos with PF &gt; 1: 13 · PF &gt; 1.2: 0 · Profitable in 2020–22 and 2023–26: 7 · Median PF: 0.97 · Default PF: 0.97</li><li><strong>NZDUSD H1</strong>. Combos with PF &gt; 1: <strong>0</strong> · PF &gt; 1.2: 0 · Profitable in 2020–22 and 2023–26: <strong>0</strong> · Median PF: 0.85 · Default PF: 0.86</li></ul><p><em>39 combinations per row. On H1 the trade count runs from about 240 (length 250) to 5,600 (length 9).</em></p><ul><li><strong>Hma, Ehma or Thma?</strong> It doesn’t matter. Across every test the median profit factor was 1.02, 1.01 and 1.00.</li><li><strong>55 or 180–200?</strong> 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.</li><li><strong>Short lengths are worse.</strong> 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.</li><li><strong>Long only beats long + short almost everywhere.</strong> If you trade it, leave the direction on the default.</li></ul><p>The market matters far more than the dials. No setting rescues NZDUSD, and none was needed on gold in a trend.</p><h3>How does it compare with PMax and SuperTrend?</h3><p>On gold H1 it beat both. Same Exness data, same costs, default settings, long + short so the comparison is fair:</p><ul><li><strong>Hull Suite</strong>. Trades: 1,784 · PF: 1.28 · Net: +4,130 · Max drawdown: 614</li><li><a href="https://moonthetrain.com/lab/tradingview-pmax-strategy-backtest"><strong>PMax</strong></a>. Trades: 448 · PF: 1.37 · Net: +2,638 · Max drawdown: 1,321</li><li><strong>SuperTrend</strong>. Trades: 935 · PF: 1.09 · Net: +1,071 · Max drawdown: 924</li></ul><p>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.</p><h3>Risk structure</h3><ul><li><strong>No stop loss.</strong> 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.</li><li><strong>All ten of the worst gold H1 trades happened between October 2025 and September 2026</strong>, 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.</li><li><strong>Swap.</strong> 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.</li><li><strong>In money:</strong> 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.</li><li><strong>Losing streaks.</strong> The longest run of losers on gold H1 was 13 trades. The win rate is 39%, normal for trend following.</li><li><strong>What isn’t a red flag:</strong> no martingale, no grid, no averaging down.</li></ul><h3>Can you optimize Hull Suite for more profit?</h3><p>I tried, and I couldn’t. I tested three common upgrades on gold H1, long only:</p><ol><li><strong>A trend filter</strong>: 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.</li><li><strong>Several copies at once</strong>: 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.</li><li><strong>Position size by ATR</strong>: bigger when the market is quiet, smaller when it’s wild.</li></ol><p>I skipped stop losses, take profits and trailing stops. On <a href="https://moonthetrain.com/lab/tradingview-pmax-strategy-optimization">PMax</a> 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.</p><p>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 <strong>one</strong> 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 <strong>MAR</strong>: compounded annual return divided by the worst drawdown. Doubling the lot doubles both, so MAR measures the strategy, not the bet size.</p><p><strong>On the training years, only the 12 copies won:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K4H5wDMa3OAxd-kh.png" /></figure><ul><li><strong>None of the 24 trend filters beat the default.</strong> The best, D1 EMA 200, reached 0.38 against 0.40. This surprised me, because a 200 EMA filter doubled return-to-drawdown on <a href="https://moonthetrain.com/lab/tradingview-pmax-strategy-optimization">PMax</a>. 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.</li><li><strong>ATR sizing made it worse</strong> (0.32). It puts on the biggest size when gold is quiet, which is exactly when Hull Suite gets chopped up.</li><li><strong>12 copies looked better</strong>: MAR 0.46, drawdown 17% instead of 23%, return 7.9% a year instead of 9.4%.</li></ul><p><strong>Then the one run on unseen years:</strong></p><pre>Gold H1, long only                     Annual return  Max DD    MAR<br>-------------------------------------------------------------------<br>Dukascopy 2016 – Jul 2026, default              8.8%   18.9%  0.465<br>Dukascopy 2016 – Jul 2026, 12 copies            8.1%   16.9%  0.481<br>Exness Nov 2020 – Sep 2026, default            14.6%   18.2%  0.799<br>Exness Nov 2020 – Sep 2026, 12 copies          12.8%   16.4%  0.776</pre><p><em>Compounded, 100% of the account per position, spread, commission and price-scaled swap included.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*P8cqADaO6ATCHdjt.png" /></figure><p>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.</p><p>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.</p><p>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.</p><h3>Who should use it?</h3><p>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.</p><h3>What I couldn’t verify</h3><ul><li><strong>TradingView itself.</strong> My “no costs” numbers come from my port with the script’s defaults, not from TradingView’s tester.</li><li><strong>Forex swap.</strong> It isn’t in the forex numbers. On USDJPY longs it would probably have helped.</li><li><strong>Other brokers and slippage.</strong> Fills are on the first tick of the next bar, Exness data only for 2020–2026.</li><li><strong>Daily candles.</strong> Mine close at UTC midnight; TradingView’s forex daily bars usually close at 17:00 New York.</li><li><strong>Stocks, indices and crypto.</strong> I only tested forex and gold.</li></ul><h3>Bottom line</h3><p>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.</p><p>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 <a href="https://moonthetrain.com/lab/tradingview-pmax-strategy-backtest">PMax backtest</a> uses the same data and the same five markets if you want to compare.</p><p><em>I’m not affiliated with TradingView, DashTrader or InSilico. Past results, including backtests, don’t guarantee future results.</em></p><p><em>Originally published at </em><a href="https://moonthetrain.com/lab/tradingview-hull-suite-strategy-backtest"><em>https://moonthetrain.com</em></a><em> on November 10, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e821ac4e866" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[QuantDinger Jev Filter Backtest: 0 of 1,324]]></title>
            <link>https://medium.com/@moonthetrain/quantdinger-jev-filter-backtest-0-of-1-324-233b4431c565?source=rss-6e40fe3c7276------2</link>
            <guid isPermaLink="false">https://medium.com/p/233b4431c565</guid>
            <category><![CDATA[backtesting]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[trading]]></category>
            <dc:creator><![CDATA[Truong Pham | Moon The Train]]></dc:creator>
            <pubDate>Mon, 02 Nov 2026 05:19:18 GMT</pubDate>
            <atom:updated>2026-11-02T06:40:45.893Z</atom:updated>
            <content:encoded><![CDATA[<p>Part 7 of 7 · Jev in trading, tested</p><p><strong>Does QuantDinger’s Jev filter help?</strong> 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.</p><h3>Why I ran this</h3><p>In <a href="https://moonthetrain.com/lab/quantdinger-jev-trade-filter">part 4</a> 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 <a href="https://moonthetrain.com/lab/jev-does-not-remember-the-past">Polymarket memory test</a> 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.</p><h3>How I rebuilt the gate</h3><p>I didn’t retype anything I could import. From QuantDinger at commit 96cec2d:</p><ul><li><strong>The six questions and their choices</strong>. Where it came from: parsed straight out of ai_decision_filter.py</li><li><strong>RSI, MACD, ATR, moving averages, support/resistance</strong>. Where it came from: QuantDinger’s own technical_indicators.py, imported</li><li><strong>Order budget</strong>. Where it came from: their order_budget.py, imported</li><li><strong>The state sent to Jev</strong>. Where it came from: a line-by-line copy of ai_decision_context.py; the only change is that &quot;now&quot; is the signal&#39;s time, not today</li><li><strong>Answer checks and the pass rule</strong>. Where it came from: a line-by-line copy of _evaluate_jev()</li></ul><p>The request body is the same one the platform sends (model, state, questions) to the same endpoint, with jev-latest, which answered as <strong>jev-1.14.0</strong>.</p><p>The strategy is QuantDinger’s official example, strategy_v2_dual_ema_long.py: 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&#39;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.</p><ul><li><strong>BTC 1h</strong>. Data: Exness BTCUSD ticks, shown to Jev as BTC/USDT · Period: 30 Apr 2024 – 11 Oct 2026 · Trades without the gate: 246 · Return: −20.7% · Max drawdown: −53.3%</li><li><strong>Gold 1h</strong>. Data: Exness XAUUSD ticks · Period: 17 Jun 2020–5 Oct 2026 · Trades without the gate: 416 · Return: +96.2% · Max drawdown: −19.0%</li></ul><p>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.</p><p>Before running the gated version I wrote down what would count as “the filter helps”: beat the unfiltered return <strong>and</strong> beat at least 95% of random gates that block the same share of requests.</p><h3>What happens with QuantDinger’s defaults?</h3><p>Nothing. The filter never makes a decision.</p><p>QuantDinger only trusts Jev’s answer when three of the six questions (entry_decision, risk_check, execution_quality) each come back with a confidence 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.</p><p>For the 1,324 trades in the chart below (both markets, at two position sizes), all three cleared 0.55 <strong>zero times</strong>, and execution_quality never went above 0.49. Across every response I collected for this post, 41,693 of them, all three never cleared together once.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0fsvmM3KaVf6Cw39.png" /></figure><p>Part of this is how the API answers. Jev returns a probability for each choice and a separate confidence field, and they&#39;re not the same number. On one BTC entry it chose pass with probability 0.60 and confidence 0.20. QuantDinger reads confidence.</p><p>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.</p><h3>What does Jev actually think?</h3><p>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.</p><p>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 risk_check = block, on 232 of 246 BTC entries. Jev objects to putting 95% of equity into one position, which is a fair point about QuantDinger&#39;s own example, but it&#39;s a point about sizing, not about the market.</p><p>Blocking that much changes the results, so the test is whether Jev picked <em>which</em> trades to keep better than chance. I ran 1,000 random gates that block the same share of requests:</p><ul><li><strong>BTC 1h</strong>. No filter: −20.7%, 246 trades · Jev decides: −9.1%, 16 trades, PF 0.55 · Random gates, median (5th–95th pct): −1.6% (−14.7% to +20.2%) · Random gates as good or better: 80%</li><li><strong>Gold 1h</strong>. No filter: +96.2%, 416 trades · Jev decides: +4.3%, 55 trades, PF 1.17 · Random gates, median (5th–95th pct): +4.0% (−10.7% to +21.9%) · Random gates as good or better: 48%</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1Ogcf_Vcg8XlXXzX.png" /></figure><p>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.</p><h3>With a smaller position, can it tell good trades from bad?</h3><p>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 signal_conflict, which is the market reading I actually wanted to test.</p><ul><li><strong>BTC 1h</strong>. Trades passed: 197, avg −0.04% · Trades blocked: 49, avg −0.07% · Passed minus blocked, avg per trade (95% CI): +0.02 pts (−0.72 to +0.79) · AUC of P(pass) vs winning trade: 0.50</li><li><strong>Gold 1h</strong>. Trades passed: 329, avg +0.20% · Trades blocked: 87, avg +0.11% · Passed minus blocked, avg per trade (95% CI): +0.09 pts (−0.25 to +0.41) · AUC of P(pass) vs winning trade: 0.53</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9sISOQFTjOkENcBQ.png" /></figure><p>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 (aligned, conflict, favorable, adverse) stayed between 0.47 and 0.55.</p><p>That matches <a href="https://moonthetrain.com/lab/can-jev-predict-bitcoin">part 5</a>, where Jev read clean indicators accurately but couldn’t say where Bitcoin was going next.</p><h3>What would I do with this?</h3><p>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 <a href="https://moonthetrain.com/lab/quantdinger-review">part 2</a>: the order budget and the rule that exits never wait on an AI.</p><p>And for any AI gate, mine included: replay it before it touches money. This whole test cost about $5 in Jev credits.</p><h3>What I didn’t check</h3><ul><li><strong>The LLM fallback.</strong> With an LLM configured, every decision in this replay would have gone to it. I didn’t test any LLM.</li><li><strong>One strategy.</strong> It’s QuantDinger’s own example, on two markets, 1h only. A strategy with smaller positions and different signals could get different answers.</li><li><strong>The 10% size as a live gate.</strong> I asked about each 10% trade once, but the bar-by-bar run at 10% stopped when my Jev credits ran out.</li><li><strong>Dates in the state.</strong> 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.</li><li><strong>Data details.</strong> 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.</li><li><strong>Versions.</strong> QuantDinger at commit 96cec2d, Jev 1.14.0 in early November 2026. The hosted version may be configured differently, and either side may change.</li></ul><p>In this replay, QuantDinger’s Jev filter either did nothing or did no better than chance.</p><p><em>Originally published at </em><a href="https://moonthetrain.com/lab/quantdinger-jev-filter-backtest"><em>https://moonthetrain.com</em></a><em> on November 2, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=233b4431c565" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[We let a profitable breakout strategy flip a coin for direction. It kept making money.]]></title>
            <link>https://medium.com/@moonthetrain/we-let-a-profitable-breakout-strategy-flip-a-coin-for-direction-it-kept-making-money-a6f1da61f629?source=rss-6e40fe3c7276------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6f1da61f629</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[gold]]></category>
            <category><![CDATA[backtesting]]></category>
            <category><![CDATA[trading]]></category>
            <dc:creator><![CDATA[Truong Pham | Moon The Train]]></dc:creator>
            <pubDate>Sun, 01 Nov 2026 00:36:56 GMT</pubDate>
            <atom:updated>2026-11-01T09:24:05.276Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>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.</strong> 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. <strong>Now keep the coin flip and remove the trade management.</strong> On real ticks, every single run loses.</p><p>That pair of results is what this article is about. A profitable breakout system turns out to be three separable things, <em>when</em> it trades, <em>which way</em> it trades, and <em>how it handles the trade afterwards</em>, 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 (<a href="https://moonthetrain.com/lab/breakout-timing-direction-management-experiment#:~:text=Downloads%3A%20repeat%20the%20experiment">free download for MT4, MT5 and cTrader</a>).</p><h3>The question</h3><p>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:</p><blockquote><em>Where does the profit come from, the entry or the management of the trade after entry?</em></blockquote><p>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 <strong>direction</strong> of gold over the next 100 minutes scored AUC 0.47–0.52, which is noise. The same features predicting whether a <strong>large move</strong> was coming, in either direction, scored 0.85. So: you can tell <em>that</em> something is about to happen, you cannot tell <em>which way</em>, and a good exit should be able to monetise the first without the second.</p><p>The hypothesis was half right. The experiment is more interesting than the hypothesis.</p><h3>Method</h3><p>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.</p><p>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.</p><ul><li><strong>Entry</strong>. Rule: Daily swing highs and lows (higher than 24 bars to the left, not lower than 3 to the right). Buy stop placed 275 pips <em>inside</em> 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.</li><li><strong>Stop / target</strong>. Rule: Stop 3.05 % of price, target 0.725 %.</li><li><strong>Breakeven</strong>. Rule: At +0.93 % profit the stop moves to entry +0.12 %.</li><li><strong>Trailing stop</strong>. Rule: From +1.8 % profit, trail 1.8 % behind price.</li><li><strong>Pulled target</strong>. Rule: When a trade is 1.6 % under water, the target is pulled to price +0.7 %: exit on the first bounce.</li><li><strong>Reversal cut</strong>. Rule: If the M1 or M15 candle containing the fill closes against the trade, close it.</li><li><strong>Filter</strong>. Rule: No trading around the monthly US jobs report.</li></ul><p>“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:</p><ol><li><strong>Coin flip, full.</strong> 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.</li><li><strong>Original timing, coin-flip direction.</strong> Keep the exact instants the original’s stop orders fill. At each one, with probability 0.5, open the <em>opposite</em> trade instead, with stop and target distances mirrored.</li><li><strong>Original timing, opposite direction.</strong> Probability 1. Every breakout is faded.</li></ol><p>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.</p><h3>Result 1 — management does not turn noise into money</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KMOfvpah8pItldfu.png" /></figure><p>Random timing, random direction, full management: median PF <strong>0.95</strong>, 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.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v22sCLvX_7Lo6Jo5.png" /></figure><p>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.</p><h3>Result 2 — timing alone is worth half the profit, even with a coin flip for direction</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5FSYoLgpEhhqCz0X.png" /></figure><p>Keep the 195 moments the original entered, flip a coin for direction: <strong>100 of 100 seeds profitable</strong>, 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.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LARs0eAHIJ2G7Acn.png" /></figure><p>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:</p><ul><li><strong>Timing</strong> — 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.</li><li><strong>Direction</strong> — 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.</li></ul><p>Note the win rates. The fade wins <strong>77 %</strong> of its trades and loses. The coin flip wins 69 %. The original wins 61 %. Win rate ranks these three in exactly the wrong order.</p><h3>Result 3 — management is what converts timing into money</h3><p>Same three entries, management off, stop and target only:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wsZ2YdvN-tbeGBUP.png" /></figure><p>Original timing, coin-flip direction, no management: median PF <strong>0.72</strong>, median result <strong>−6,088 USD</strong>, 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.</p><p>This is the finding. <strong>Trade management does not create an edge. It is the mechanism that lets you collect an edge you can only half see.</strong> 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.</p><h3>Result 4 — when the entry is already right, management buys drawdown with profit</h3><p>The original strategy with management off makes <em>more</em>: +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.</p><p>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.</p><h3>Confirmation on 257 million real ticks</h3><p>Same account, same lots, same period, the full tick archive with real spread. Fewer seeds because each run takes longer.</p><ul><li><strong>Coin flip, full (10 seeds, median)</strong>. Management on: PF · net · DD · % runs positive: 0.98 · −71 · 866 · 40 % · Management off: PF · net · DD · % runs positive: 0.78 · −3,302 · 4,806 · 0 %</li><li><strong>Original timing, coin-flip direction (10 seeds, median)</strong>. Management on: PF · net · DD · % runs positive: <strong>1.70 · +2,896 · 825 · 100 %</strong> · Management off: PF · net · DD · % runs positive: 0.78 · −4,830 · 9,138 · 0 %</li><li><strong>Original timing, original direction</strong>. Management on: PF · net · DD · % runs positive: 2.36 · +7,292 · 674 · Management off: PF · net · DD · % runs positive: 2.40 · +11,879 · 2,683</li><li><strong>Original timing, faded</strong>. Management on: PF · net · DD · % runs positive: 0.22 · −1,936 · 2,077 · Management off: PF · net · DD · % runs positive: 0.34 · −22,998 · 23,938</li></ul><p>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: <strong>on real ticks, every run without management lost money, including all 16 random seeds.</strong></p><p>While the ticks were loaded, I removed the management layers one at a time, original entries, original direction:</p><pre>Layer removed            Net    PF  Drawdown  Win%<br>--------------------------------------------------<br>none (full strategy)  +7,292  2.36       674  60 %<br>breakeven             +7,793  2.18       674  55 %<br>trailing stop         +7,292  2.36       674  60 %<br>pulled target         +8,092  2.53     1,178  65 %<br>reversal cut          +9,516  2.62     1,223  80 %<br>swing trailing        +7,000  2.24       686  60 %<br>jobs-report filter    +6,808  2.17       826  59 %</pre><p>Three observations. The trailing stop <strong>never fires</strong>: 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 <em>rises</em>. 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.</p><h3>What I take from this</h3><ul><li><strong>Direction is the thin half.</strong> Neither the strategy’s own logic nor my models predict it at these horizons. Spend the optimisation budget on <em>when</em> to be in the market.</li><li><strong>Win rate measures nothing here.</strong> 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.</li><li><strong>“Any entry plus a trailing stop” is false.</strong> 100 seeds on bars, 10 on ticks.</li><li><strong>Evaluate management by drawdown.</strong> Switching it off looked better on profit and was four times worse on drawdown.</li><li><strong>Check which layers actually fire.</strong> One of the five in this system never did.</li></ul><p>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.</p><h3>Limitations and the objections I expect</h3><p><strong>“So entries do matter.”</strong> Timing does, a lot; the first chart is the evidence against my own starting hypothesis. Direction matters much less than the attention it receives.</p><p><strong>“This needs a trending market.”</strong> Yes. The second half of 2021 was negative for every configuration including the original. The method needs volatility, not direction.</p><p><strong>“The parameters are in-sample.”</strong> 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.</p><p><strong>“One parameter set, one instrument.”</strong> 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.</p><p><strong>“Bars, not ticks.”</strong> The 100-seed charts are bars. The tick table is not, and it says the same thing more sharply.</p><h3>Downloads: repeat the experiment</h3><p>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.</p><p>Free, no account needed, one download per terminal (MT5, MT4, cTrader): <a href="https://moonthetrain.com/lab/breakout-timing-direction-management-experiment#:~:text=Downloads%3A%20repeat%20the%20experiment"><strong>download Notus from the original article</strong></a>.</p><p>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.</p><p>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.</p><p><em>Originally published at </em><a href="https://moonthetrain.com/lab/breakout-timing-direction-management-experiment"><em>https://moonthetrain.com</em></a><em> on November 1, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6f1da61f629" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Does Turtle Trading Still Work? What 6.7 Years Showed]]></title>
            <link>https://medium.com/@moonthetrain/does-turtle-trading-still-work-what-6-7-years-showed-c390b6737d6f?source=rss-6e40fe3c7276------2</link>
            <guid isPermaLink="false">https://medium.com/p/c390b6737d6f</guid>
            <category><![CDATA[trend-following]]></category>
            <category><![CDATA[backtesting]]></category>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Truong Pham | Moon The Train]]></dc:creator>
            <pubDate>Thu, 22 Oct 2026 03:32:12 GMT</pubDate>
            <atom:updated>2026-10-28T01:05:03.759Z</atom:updated>
            <content:encoded><![CDATA[<p>Part 5 of 5 · Turtle trading rules, tested</p><p><strong>The short version.</strong> 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.</p><p>This is the last of 5 parts: <a href="https://medium.com/@moonthetrain/turtle-trading-rules-the-1983-experiment-tested-in-2026-55c95eb52a5e">the 1983 experiment</a>, <a href="https://medium.com/@moonthetrain/turtle-trading-rules-explained-n-units-breakouts-stops-317ef22cea7f">the rules</a>, <a href="https://medium.com/@moonthetrain/turtle-trading-backtest-in-python-building-the-simulator-705e89fb8e28">the simulator</a>, <a href="https://medium.com/@moonthetrain/turtle-trading-backtest-results-26-markets-57-7-c876c1065a60">the results</a>.</p><h3>Does Turtle trading still work in 2026?</h3><p>Not as published, on Exness CFDs, from 2020 to 2026. The numbers, briefly:</p><pre>11 markets  26 markets<br>------------------------------------<br>Return            −37.9%      −57.7%<br>Max DD             58.3%       75.6%<br>PF                  0.89        0.83<br>Long trades     +$26,899    +$28,279<br>Short trades    −$64,779    −$85,989</pre><p>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.</p><h3>Lesson 1: the rules are good engineering</h3><p>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 <a href="https://medium.com/@moonthetrain/turtle-trading-rules-explained-n-units-breakouts-stops-317ef22cea7f">part 2</a>). 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.</p><p>The risk side held up too. Switching off the filter, the unit limits or the drawdown rule each made the result clearly worse (in <a href="https://medium.com/@moonthetrain/turtle-trading-backtest-results-26-markets-57-7-c876c1065a60">part 4</a>, 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.</p><p>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.</p><h3>Lesson 2: more markets only help if they have an edge</h3><p>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%.</p><p>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.</p><h3>Lesson 3: why I didn’t just drop the shorts</h3><p>This is the one I had to think about most.</p><p>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.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*I1K5C0naVq1cPvP4.png" /></figure><p>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.</p><p>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.</p><h3>Lesson 4: 6.7 years is short for a trend system</h3><p>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.</p><p>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.</p><h3>Lesson 5: CFDs aren’t the 1983 futures</h3><ul><li><strong>Swap.</strong> 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.</li><li><strong>Spread.</strong> Paid on every entry and exit. Doubling it took another 1.7% a year off the 11-market result.</li><li><strong>The market list.</strong> 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.</li></ul><h3>Lesson 6: shorter bars make it worse, not better</h3><p>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 <a href="https://medium.com/@moonthetrain/turtle-trading-rules-explained-n-units-breakouts-stops-317ef22cea7f">part 2</a>.</p><h3>What I didn’t do</h3><ul><li><strong>No parameter optimisation.</strong> 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.</li><li><strong>No long-only version</strong>, for the reasons above.</li><li><strong>No Whipsaw stop</strong>, the PDF’s alternative half-N stop.</li><li><strong>No live trading.</strong> Everything here is a simulation on archive data.</li></ul><h3>The limits of this test</h3><ul><li>Swap measured on 3 of 26 markets; commission on commodity and index CFDs unconfirmed; both set to zero where unknown.</li><li>Some contract sizes for commodities and indices unconfirmed (with N-based sizing this mostly affects lot rounding).</li><li>Data gaps: UKOIL and XPTUSD have missing months; XNGUSD, JP225 and XCUUSD start in 2022–2023.</li><li>One broker, one period, CFDs instead of futures.</li></ul><p>If anything, the costs I couldn’t measure would make the results a bit worse, not better.</p><h3>So what is the Turtle system good for today?</h3><p>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.</p><p>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.</p><p>Thanks for reading the series. There’s a <a href="https://youtu.be/PO_4rIQtF1I">7-minute video version on YouTube</a>, with the same numbers drawn from the same data.</p><p><em>Research, not financial advice. Past results do not predict future results.</em></p><p><em>Originally published at </em><a href="https://moonthetrain.com/lab/does-turtle-trading-still-work"><em>https://moonthetrain.com</em></a><em> on October 22, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c390b6737d6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>