<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Quantreo]]></title><description><![CDATA[Real-life quant trading tips.
All Friday by mail.]]></description><link>https://www.newsletter.quantreo.com</link><image><url>https://substackcdn.com/image/fetch/$s_!fxnv!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc983c18-4d20-41a3-b0c9-997ec5a905a3_1024x1024.png</url><title>Quantreo</title><link>https://www.newsletter.quantreo.com</link></image><generator>Substack</generator><lastBuildDate>Wed, 02 Dec 2026 12:17:01 GMT</lastBuildDate><atom:link href="https://www.newsletter.quantreo.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Lucas]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[quantreo@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[quantreo@substack.com]]></itunes:email><itunes:name><![CDATA[Lucas]]></itunes:name></itunes:owner><itunes:author><![CDATA[Lucas]]></itunes:author><googleplay:owner><![CDATA[quantreo@substack.com]]></googleplay:owner><googleplay:email><![CDATA[quantreo@substack.com]]></googleplay:email><googleplay:author><![CDATA[Lucas]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[What I Actually Let Claude Do in My Research]]></title><description><![CDATA[Eight agents run most of my pipeline. None of them gets the final call.]]></description><link>https://www.newsletter.quantreo.com/p/what-i-actually-let-claude-do-in</link><guid isPermaLink="false">https://www.newsletter.quantreo.com/p/what-i-actually-let-claude-do-in</guid><dc:creator><![CDATA[Lucas]]></dc:creator><pubDate>Fri, 20 Nov 2026 15:31:05 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/26b654e5-4d13-4d8d-b9af-6b14a85e3939_1600x900.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Earlier this year, a researcher left an AI agent alone with his crypto backtester for two hours. It wrote strategies, ran them, fixed them, tried again. Somewhere along the way, without being asked, it moved the start date of the backtest to get more history.</p><p>Nobody told it to cheat. It just found a lever that made the numbers better, and pulled it.</p><p>Mine did something similar in August. I asked for one momentum test. It came back with three lookback horizons I had never asked for. The result looked like one test. It was three.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Subscribe to obtain the news tips !</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h2>1. Most of the work can be delegated, and that&#8217;s where the hours go</h2><p>My research runs on eight agents, one per seat, the way a small desk would split the work. One reads papers and turns them into testable ideas. <strong>One writes the spec</strong>. One codes the backtest. One checks the data. Others look at risk and at how a strategy fits the rest of the book.</p><p>That covers most of the hours in a research week: reading, writing, coding, checking, documenting. None of it requires judgment about whether an idea is real, and all of it used to eat my evenings.</p><blockquote><p><strong>A word of caution on speed</strong>, though. In a 2025 randomised study by METR, experienced developers believed AI made them 20% faster. Measured on the clock, they were 19% slower. The feeling of speed is not the same as speed, so measure your own before you trust it.</p></blockquote><div><hr></div><h2>2. Every failure of the agents became a rule</h2><p>The first versions were not trustworthy. They reported a Sharpe ratio that no script had computed, a number that sounded exactly like a result. <strong>They approved ideas that should have died on paper as &#8220;promising&#8221;</strong>. And as in August, they ran more tests than they reported.</p><p>None of it looked wrong, which was the problem. A language model fills gaps with whatever is most plausible, and a plausible number doesn&#8217;t crash or throw an error. It just sits in your notes until you build on it.</p><p>So each failure became a rule.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!IMR3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdef8cd38-333e-4159-b318-070f8c895e3a_1745x532.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!IMR3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdef8cd38-333e-4159-b318-070f8c895e3a_1745x532.png 424w, https://substackcdn.com/image/fetch/$s_!IMR3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdef8cd38-333e-4159-b318-070f8c895e3a_1745x532.png 848w, https://substackcdn.com/image/fetch/$s_!IMR3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdef8cd38-333e-4159-b318-070f8c895e3a_1745x532.png 1272w, https://substackcdn.com/image/fetch/$s_!IMR3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdef8cd38-333e-4159-b318-070f8c895e3a_1745x532.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!IMR3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdef8cd38-333e-4159-b318-070f8c895e3a_1745x532.png" width="1456" height="444" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/def8cd38-333e-4159-b318-070f8c895e3a_1745x532.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:444,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:93617,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.newsletter.quantreo.com/i/225311558?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdef8cd38-333e-4159-b318-070f8c895e3a_1745x532.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!IMR3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdef8cd38-333e-4159-b318-070f8c895e3a_1745x532.png 424w, https://substackcdn.com/image/fetch/$s_!IMR3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdef8cd38-333e-4159-b318-070f8c895e3a_1745x532.png 848w, https://substackcdn.com/image/fetch/$s_!IMR3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdef8cd38-333e-4159-b318-070f8c895e3a_1745x532.png 1272w, https://substackcdn.com/image/fetch/$s_!IMR3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdef8cd38-333e-4159-b318-070f8c895e3a_1745x532.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Before anything is coded, the spec has to state the hypothesis, the cost budget and the numbers that would kill the idea. One agent exists only to read that spec and say no. Every backtest is logged, every trial goes in the registry, and every idea that dies leaves a written reason.</p><p><strong>None of this makes the agents smart. It makes them checkable.</strong></p><div><hr></div><h2>3. The verdict stays mine</h2><p>What I never delegate is the decision. The registry tells me <strong>how many times I have really tried:</strong> my crypto pool sits at five trials, the whole programme at around thirteen, and both counts go into a Deflated Sharpe in every strategy file. The final test window stays sealed, and no agent ever sees it.</p><p><strong>On my last full run, 32 strategies went in. 29 were killed, each with a reason written down.</strong> 3 were kept. That ratio is the point. A pipeline that kills almost everything is doing its job.</p><p>It has limits. The rules make the agents checkable, not right. They don&#8217;t find an edge, and the registry can&#8217;t count the ideas I dismissed in my head before an agent ever ran them.</p><blockquote><p><strong>One rule anyone can apply tomorrow</strong>: if a number in your notes can&#8217;t be traced back to the script that produced it, treat it as fiction.</p></blockquote><p></p><p><strong>The agents made my research faster. The rules made sure that faster didn&#8217;t mean wrong. Let the machine do the work, and keep the verdict for yourself.</strong></p><p>The complete setup, the eight agents and the process they run, is in AI QuantPod. It&#8217;s $497 until Black Friday, and $797 after.</p><p><strong>&#8594; <a href="https://www.quantreo.com/ai-quant-pod/">See what&#8217;s inside AI QuantPod</a></strong></p>]]></content:encoded></item><item><title><![CDATA[The Hidden Cost of Letting an Agent Search]]></title><description><![CDATA[The best Sharpe of the night says more about the number of tries than about the strategy.]]></description><link>https://www.newsletter.quantreo.com/p/the-hidden-cost-of-letting-an-agent</link><guid isPermaLink="false">https://www.newsletter.quantreo.com/p/the-hidden-cost-of-letting-an-agent</guid><dc:creator><![CDATA[Lucas]]></dc:creator><pubDate>Fri, 13 Nov 2026 15:31:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/7fca8790-6b03-419b-8832-858548421ac2_1600x900.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You leave an agent working on your strategy overnight. In the morning it has tested <strong>60 variants, and the best one shows a Sharpe of 1.9</strong> with a clean equity curve. You look at the curve. You don&#8217;t ask how many variants came before it, or how many it would take to find something that good by pure luck.</p><p><strong>The agent made your research faster. It also made your false positives cheaper.</strong></p><p>Over the last two issues we looked at the model as a trader, then as a research assistant that has already read the future. This one is about the agent as a search engine: what it really saves you, <strong>why every extra backtest raises the bar</strong>, and the one failure that no amount of statistics will catch.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Subscribe to obtain the news tips !</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h2>1. The real gain is time, and nobody serious claims more</h2><p>The firms that use agents most heavily describe the same benefit: throughput. Code gets written faster, papers get summarised faster, more ideas get tested in a week. None of them claims that the agent produces alpha on its own.</p><p><strong>Man Group is the clearest example</strong>. Its agent proposes trading signals, and those signals face exactly the same thresholds as ideas from human researchers. The firm reports how many were approved. It does not report how many were tried, and that second number is the one that tells you how much luck went into the first.</p><div><hr></div><h2>2. Every extra backtest raises the bar</h2><p>Test enough strategies with no edge at all and one of them will look good. That is not a flaw in your code, it is arithmetic. To see how fast it happens, I simulated strategies with zero true edge on five years of daily returns and tracked the best Sharpe found as the number of tests grows.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!afYO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81f286c8-942c-419c-a7fd-69c6d939a45c_1705x908.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!afYO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81f286c8-942c-419c-a7fd-69c6d939a45c_1705x908.png 424w, https://substackcdn.com/image/fetch/$s_!afYO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81f286c8-942c-419c-a7fd-69c6d939a45c_1705x908.png 848w, https://substackcdn.com/image/fetch/$s_!afYO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81f286c8-942c-419c-a7fd-69c6d939a45c_1705x908.png 1272w, https://substackcdn.com/image/fetch/$s_!afYO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81f286c8-942c-419c-a7fd-69c6d939a45c_1705x908.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!afYO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81f286c8-942c-419c-a7fd-69c6d939a45c_1705x908.png" width="1456" height="775" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/81f286c8-942c-419c-a7fd-69c6d939a45c_1705x908.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:775,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:95126,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.newsletter.quantreo.com/i/224276607?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81f286c8-942c-419c-a7fd-69c6d939a45c_1705x908.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!afYO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81f286c8-942c-419c-a7fd-69c6d939a45c_1705x908.png 424w, https://substackcdn.com/image/fetch/$s_!afYO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81f286c8-942c-419c-a7fd-69c6d939a45c_1705x908.png 848w, https://substackcdn.com/image/fetch/$s_!afYO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81f286c8-942c-419c-a7fd-69c6d939a45c_1705x908.png 1272w, https://substackcdn.com/image/fetch/$s_!afYO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81f286c8-942c-419c-a7fd-69c6d939a45c_1705x908.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>After about 45 tests, a Sharpe of 1 is what you should expect from noise alone. That matches the bound Bailey, Borwein, L&#243;pez de Prado and Zhu gave a decade ago: with five years of data, no more than about 45 independent configurations before an in-sample Sharpe of 1 means nothing. An agent working overnight crosses that line before breakfast.</p><p>A recent working paper by Gen&#231;ay shows what this looks like with a real agent. A GPT-4.1 agent designed 100 strategies, with every attempt logged. Its best one scored a Sharpe of 1.69 during design, failed the Deflated Sharpe test once the 100 attempts were counted, and delivered 0.18 out of sample.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!q_Zj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ca844ec-dad7-4f1c-8469-e9901b7ab82d_1590x579.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!q_Zj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ca844ec-dad7-4f1c-8469-e9901b7ab82d_1590x579.png 424w, https://substackcdn.com/image/fetch/$s_!q_Zj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ca844ec-dad7-4f1c-8469-e9901b7ab82d_1590x579.png 848w, https://substackcdn.com/image/fetch/$s_!q_Zj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ca844ec-dad7-4f1c-8469-e9901b7ab82d_1590x579.png 1272w, https://substackcdn.com/image/fetch/$s_!q_Zj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ca844ec-dad7-4f1c-8469-e9901b7ab82d_1590x579.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!q_Zj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ca844ec-dad7-4f1c-8469-e9901b7ab82d_1590x579.png" width="1456" height="530" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0ca844ec-dad7-4f1c-8469-e9901b7ab82d_1590x579.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:530,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:77729,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.newsletter.quantreo.com/i/224276607?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ca844ec-dad7-4f1c-8469-e9901b7ab82d_1590x579.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!q_Zj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ca844ec-dad7-4f1c-8469-e9901b7ab82d_1590x579.png 424w, https://substackcdn.com/image/fetch/$s_!q_Zj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ca844ec-dad7-4f1c-8469-e9901b7ab82d_1590x579.png 848w, https://substackcdn.com/image/fetch/$s_!q_Zj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ca844ec-dad7-4f1c-8469-e9901b7ab82d_1590x579.png 1272w, https://substackcdn.com/image/fetch/$s_!q_Zj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ca844ec-dad7-4f1c-8469-e9901b7ab82d_1590x579.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>A Sharpe of 1.9 after 3 tries and a Sharpe of 1.9 after 60 are not the same finding.</strong></p><div><hr></div><h2>3. Counting trials fixes selection, not leakage</h2><p>The answer to section 2 is a registry: every backtest the agent runs gets logged, and the Deflated Sharpe Ratio is computed with that count. It works, and it is the first thing I would put in place.</p><p><strong>It has a blind spot</strong>. In the same paper, Gen&#231;ay plants a deliberate look-ahead leak in one strategy. It reaches a Sharpe of 34.7 and passes the Deflated Sharpe test with a perfect score. The statistics correct for how many times you searched. They cannot see that the code is reading tomorrow&#8217;s data.</p><p>That risk grows with agents, because they write most of the code. A normaliser computed over the full day, a feature shifted the wrong way, and the test passes while the backtest lies. That part is caught by reading and testing the code, not by any p-value. The registry also misses the ideas you dismissed in your head before the agent ever ran them.</p><p></p><p></p><p>Next time an agent hands you its best result, ask for the denominator before you look at the curve.</p><p><em>The registry, the sealed test window and the code checks are part of the process I run with my own agents, and this newsletter only shows pieces of it.</em></p><p>The complete workflow is in <strong><a href="https://www.quantreo.com/ai-quant-pod/">AI QuantPod</a></strong>.</p><p></p>]]></content:encoded></item><item><title><![CDATA[Your Model Has Already Read the Future]]></title><description><![CDATA[It doesn't need to place a trade to contaminate your backtest.]]></description><link>https://www.newsletter.quantreo.com/p/your-model-has-already-read-the-future</link><guid isPermaLink="false">https://www.newsletter.quantreo.com/p/your-model-has-already-read-the-future</guid><dc:creator><![CDATA[Lucas]]></dc:creator><pubDate>Fri, 06 Nov 2026 15:31:12 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/ad150265-4545-4bba-86f7-550d07dca358_1600x900.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You ask a language model to help you build a crypto momentum strategy. Start of 2022, ten liquid coins, nothing exotic. It gives you a clean list with a sensible reason for each pick, you run the backtest, and the result looks solid.</p><p>What the model doesn&#8217;t mention is that it already knows how 2022 ends. It knows which top-ten coin collapsed in May, and which exchange token went to zero in November. Nobody asked it to use that knowledge. Nobody asked it not to, either, and it couldn&#8217;t comply if you did.</p><p><strong>The model doesn&#8217;t need to trade to contaminate your backtest. It only needs to help you choose.</strong></p><p>Last week we looked at what happens when you hand a model the trading itself. This issue looks at the quieter case, the one that affects anyone using an LLM in research: <strong>what the model remembers</strong>, how that memory leaks into a backtest it never touches, and where the bias turns out to be smaller than you would expect.</p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Subscribe if you want more tips about AI in quant Trading !</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h2>1. It doesn&#8217;t forecast the past, it remembers it</h2><p>A language model is trained on text up to a fixed date, its training cutoff. Ask it about anything before that date and it is not predicting. It is recalling.</p><p>Lopez-Lira, Tang and Zhu measured this directly with GPT-4o, whose training data stops in October 2023. They asked it a simple question, quarter after quarter: would US GDP growth come in above 2.5%? <strong>Then they told the model to ignore everything it knew after 2010, as if it were living in 2010 and forecasting forward.</strong></p><p>The instruction changed nothing. <strong>The model was right 97.6%</strong> of the time before 2010, and 98.0% of the time on the period it had been told to forget. Only after its real cutoff, on quarters it had never read about, <strong>did accuracy fall to 40%</strong>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zhUs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fece757dc-91c6-4c8d-a1df-44f1cc25a911_1590x502.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zhUs!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fece757dc-91c6-4c8d-a1df-44f1cc25a911_1590x502.png 424w, https://substackcdn.com/image/fetch/$s_!zhUs!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fece757dc-91c6-4c8d-a1df-44f1cc25a911_1590x502.png 848w, https://substackcdn.com/image/fetch/$s_!zhUs!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fece757dc-91c6-4c8d-a1df-44f1cc25a911_1590x502.png 1272w, https://substackcdn.com/image/fetch/$s_!zhUs!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fece757dc-91c6-4c8d-a1df-44f1cc25a911_1590x502.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!zhUs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fece757dc-91c6-4c8d-a1df-44f1cc25a911_1590x502.png" width="1456" height="460" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ece757dc-91c6-4c8d-a1df-44f1cc25a911_1590x502.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:460,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:61455,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.newsletter.quantreo.com/i/223345556?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fece757dc-91c6-4c8d-a1df-44f1cc25a911_1590x502.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zhUs!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fece757dc-91c6-4c8d-a1df-44f1cc25a911_1590x502.png 424w, https://substackcdn.com/image/fetch/$s_!zhUs!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fece757dc-91c6-4c8d-a1df-44f1cc25a911_1590x502.png 848w, https://substackcdn.com/image/fetch/$s_!zhUs!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fece757dc-91c6-4c8d-a1df-44f1cc25a911_1590x502.png 1272w, https://substackcdn.com/image/fetch/$s_!zhUs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fece757dc-91c6-4c8d-a1df-44f1cc25a911_1590x502.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>A prompt cannot create a cutoff. The model can&#8217;t unlearn what it read, and it won&#8217;t tell you when it is using it.</strong></p><p>The 40% rests on a handful of quarters, so it is not a precise score. What it shows is the break: near-perfect while the model knows the answer, ordinary the moment it doesn&#8217;t.</p><div><hr></div><h2>2. It contaminates the backtest without ever placing a trade</h2><p>Most people who use an LLM in research never let it trade. <strong>They let it help</strong>: suggest a universe, propose features, pick a sensible test window. Each of those is a choice made before the backtest runs, <strong>and each is a place where knowledge of the outcome can slip in unnoticed.</strong></p><p>I tested the most obvious case. On 1 January 2022, Terra (LUNA) was the ninth largest crypto asset, worth about $33 billion. Five months later it was gone. I asked Claude ten times, in fresh sessions, for the ten largest coins as of that date. <strong>LUNA was in every answer, and every list matched the real ranking coin for coin.</strong></p><p>That is reassuring, and it is also memory. The model didn&#8217;t estimate the ranking, it recalled it. Asked for a fact, it returned the fact. <strong>The exposure starts when you ask for judgment instead</strong>: which coins deserve a place, which features look promising, which period is representative. There is no ranking to recite, and what the model knows about the outcome can shape the answer without leaving a trace.</p><p>That effect has been measured. Li et al. backtested GPT-4o trading agents on NASDAQ-100 stocks in 2021, then ran them again in late 2024, after the model&#8217;s cutoff. The market rose about 13% in both windows. The agents&#8217; Sharpe ratios fell by 51% to 62%.</p><p><strong>The leak is not in your data or your code. It is in the choices you made with the model&#8217;s help.</strong></p><div><hr></div><h2>3. The bias is uneven, and the rule is simple</h2><p>Not every use is equally exposed. <strong>The bias is large when the model recalls facts or makes decisions</strong>, because both draw directly on what it remembers. It is much smaller when the model only turns text into a score. He, Lv, Manela and Wu trained models only on text available at each date and compared them with a modern LLM on news-based return prediction: the portfolios performed comparably, and the authors call the look-ahead bias in that setting &#8220;relatively modest&#8221;.</p><p><strong>So the danger sits in the use, not in the tool.</strong> The rule I apply:</p><p>- never use the model as a source of prices, macro data or historical facts;</p><p>- never ask it what would have worked over a period it has already read;</p><p>- when it helps choose a universe, features or a test window, judge the result only on data after its training cutoff.</p><p>That last rule has a cost. The window after the cutoff is short, often a few months, so a Sharpe measured there carries a wide error band, and it closes again with every new model release. It keeps the test honest. It doesn&#8217;t make it powerful.</p><p></p><p>Before you trust a result the model helped you build, look up one date: <strong>its training cutoff</strong>. If your test ends before it, the model may have chosen with the answers in hand.</p><p>I use these guardrails every day, and this newsletter only shows pieces of how. <strong>The complete process, step by step, is in <a href="https://www.quantreo.com/ai-quant-pod/">AI QuantPod</a></strong>. The first three sections are already online, and the <strong>pre-sale price of $397 ends on November 9</strong>.</p><p>&#8594; <a href="https://www.quantreo.com/ai-quant-pod/">See what&#8217;s inside AI QuantPod</a></p>]]></content:encoded></item><item><title><![CDATA[An LLM Is Not a Trader]]></title><description><![CDATA[Give a model prices and an account and you get an opinion, not a strategy.]]></description><link>https://www.newsletter.quantreo.com/p/an-llm-is-not-a-trader</link><guid isPermaLink="false">https://www.newsletter.quantreo.com/p/an-llm-is-not-a-trader</guid><dc:creator><![CDATA[Lucas]]></dc:creator><pubDate>Fri, 30 Oct 2026 15:31:01 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/f816fa29-be09-4bd6-9ca2-fcc6572194a3_1600x900.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You give a frontier model live prices, a funded account and a clear instruction: maximise return, manage risk. No human in the loop, real money on the line. Seventeen days later, four of the six models have lost more than 40%. One is up 22%.</p><p>That was Alpha Arena, season one. The tempting reading is that some models simply trade better than others. The data doesn&#8217;t support it.</p><p><strong>A language model given data and an account does not come with an edge. It reads the same market everyone else reads, and it decides differently every time you ask.</strong></p><p>This issue opens a short series on AI in systematic research, and it starts with the question most people ask first: can you hand the trading to the model? We will look at what live AI trading results actually prove, why the problem is structural rather than a matter of picking a smarter model, and where an LLM genuinely earns its place in a research workflow.</p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Quantreo! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h2>1. Seventeen days of live trading prove almost nothing, in either direction</h2><p>Alpha Arena gave six frontier models $10,000 each in real money to trade crypto perpetuals, with the same prompt and the same data. Qwen finished up 22%. DeepSeek scraped 5%. GPT-5 ended at $4,126, and Gemini and Claude both gave back more than 40%.</p><p>It looks like a ranking. Statistically, it is noise. Under the usual assumptions, the standard error of an annualised Sharpe ratio is roughly one over the square root of the test length in years (Lo, 2002). Seventeen days is less than 5% of a year. That puts the standard error near 4.6, and the 95% range of a strategy with no edge at all somewhere between -9 and +9.</p><p><strong>A +22% and a -58% can come from the same absence of edge, with different leverage and different luck.</strong></p><p>The uncertainty shrinks, but slowly. It takes years, not weeks, before a Sharpe ratio starts to mean something.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zO4M!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcb218d8-f727-4067-bd1d-5d3c228f23c5_1570x666.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zO4M!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcb218d8-f727-4067-bd1d-5d3c228f23c5_1570x666.png 424w, https://substackcdn.com/image/fetch/$s_!zO4M!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcb218d8-f727-4067-bd1d-5d3c228f23c5_1570x666.png 848w, https://substackcdn.com/image/fetch/$s_!zO4M!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcb218d8-f727-4067-bd1d-5d3c228f23c5_1570x666.png 1272w, https://substackcdn.com/image/fetch/$s_!zO4M!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcb218d8-f727-4067-bd1d-5d3c228f23c5_1570x666.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!zO4M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcb218d8-f727-4067-bd1d-5d3c228f23c5_1570x666.png" width="1456" height="618" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fcb218d8-f727-4067-bd1d-5d3c228f23c5_1570x666.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:618,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:81436,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.newsletter.quantreo.com/i/222657371?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcb218d8-f727-4067-bd1d-5d3c228f23c5_1570x666.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zO4M!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcb218d8-f727-4067-bd1d-5d3c228f23c5_1570x666.png 424w, https://substackcdn.com/image/fetch/$s_!zO4M!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcb218d8-f727-4067-bd1d-5d3c228f23c5_1570x666.png 848w, https://substackcdn.com/image/fetch/$s_!zO4M!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcb218d8-f727-4067-bd1d-5d3c228f23c5_1570x666.png 1272w, https://substackcdn.com/image/fetch/$s_!zO4M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcb218d8-f727-4067-bd1d-5d3c228f23c5_1570x666.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The uncertainty shrinks, but slowly. It takes years, not weeks, before a Sharpe ratio starts to mean something.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lI4R!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58917e49-5bb6-4299-b667-2a6bdc22be8a_1704x846.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lI4R!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58917e49-5bb6-4299-b667-2a6bdc22be8a_1704x846.png 424w, https://substackcdn.com/image/fetch/$s_!lI4R!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58917e49-5bb6-4299-b667-2a6bdc22be8a_1704x846.png 848w, https://substackcdn.com/image/fetch/$s_!lI4R!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58917e49-5bb6-4299-b667-2a6bdc22be8a_1704x846.png 1272w, https://substackcdn.com/image/fetch/$s_!lI4R!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58917e49-5bb6-4299-b667-2a6bdc22be8a_1704x846.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!lI4R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58917e49-5bb6-4299-b667-2a6bdc22be8a_1704x846.png" width="1456" height="723" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/58917e49-5bb6-4299-b667-2a6bdc22be8a_1704x846.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:723,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:75265,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.newsletter.quantreo.com/i/222657371?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58917e49-5bb6-4299-b667-2a6bdc22be8a_1704x846.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!lI4R!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58917e49-5bb6-4299-b667-2a6bdc22be8a_1704x846.png 424w, https://substackcdn.com/image/fetch/$s_!lI4R!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58917e49-5bb6-4299-b667-2a6bdc22be8a_1704x846.png 848w, https://substackcdn.com/image/fetch/$s_!lI4R!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58917e49-5bb6-4299-b667-2a6bdc22be8a_1704x846.png 1272w, https://substackcdn.com/image/fetch/$s_!lI4R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58917e49-5bb6-4299-b667-2a6bdc22be8a_1704x846.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h2>2. Trading is a process, and the model only covers its weakest step</h2><p>A systematic strategy is a chain: a hypothesis about why prices should move, a signal that measures it, a sizing rule, risk limits, execution, and a validation step that decides whether any of it is real. Each link is written down and fixed before money moves.</p><p>A model given an account replaces that chain with an opinion. It optimises no stable objective, follows no fixed rules, and has no information advantage: <strong>it reads the same public prices and headlines as everyone else</strong>. In the following season, on US stocks, Bloomberg counted 6 profitable results out of 32, and two models given the same prompt traded 158 times and 1,418 times. That is not two strategies. It is one instruction producing two unrelated behaviours.</p><p>The organisers flagged a further weakness themselves: the models were fed raw numerical time series, a format language models handle poorly.</p><div><hr></div><h2>3. The model belongs upstream of the decision, not in it</h2><p>None of this means LLMs are useless in trading. It means they sit in the wrong seat. The useful work happens before the decision: writing and reviewing backtest code, summarising papers, turning a vague idea into a testable hypothesis, keeping a record of what was tried. That is where the time savings are real.</p><p>The decision itself stays a rule you can test. Man Group, which runs an agent that proposes trading signals, holds AI-generated ideas to the same thresholds as human ones. <strong>The model can suggest the hypothesis. It cannot be the evidence.</strong></p><p>There is a limit to this argument. A sentiment score produced by a language model can be a perfectly good feature inside a tested strategy, provided the test runs after the model&#8217;s training cutoff (more on that next week). The point is not that the model has no use. It is that it does not replace the strategy.</p><blockquote><p>A practical rule: to tell a true Sharpe of 1 from zero with 95% confidence, you need roughly six years of returns. Anything shorter is a demo.</p></blockquote><p></p><p></p><p>Next time you see an AI trading result, ask two questions. <em>How long was the test</em>, and <em>who wrote the decision rules</em>? If the answers are &#8220;two weeks&#8221; and &#8220;the model&#8221;, you are looking at a coin flip with a nice interface.</p><p>Over the next few issues, I will share some pieces of how I use these models in my own research. <strong>Not all of it: the complete process, step by step, lives in AI QuantPod.</strong></p><p>&#8594; See what&#8217;s inside <strong><a href="https://www.quantreo.com/ai-quant-pod/">AI QuantPod</a></strong>.</p>]]></content:encoded></item><item><title><![CDATA[Adding More Tests Doesn't Make Your Backtest Safer]]></title><description><![CDATA[Half your validation layers buy you nothing. The ones that work double the edge you need.]]></description><link>https://www.newsletter.quantreo.com/p/adding-more-tests-doesnt-make-your</link><guid isPermaLink="false">https://www.newsletter.quantreo.com/p/adding-more-tests-doesnt-make-your</guid><dc:creator><![CDATA[Lucas]]></dc:creator><pubDate>Fri, 21 Aug 2026 14:30:55 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/9f3ef634-3e36-4126-818e-5f7350437395_1456x816.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Somewhere in your validation code, there is a stack. A HAC correction someone recommended. A deflated Sharpe you added after Lopez de Prado. A cross-validation scheme, because everyone cross-validates. <strong>Each layer went in for a good reason</strong>, and each one made the whole thing feel a little more serious.</p><p>Almost nobody asks what each layer actually changes, in measured false positives. So I did: a validation pipeline is itself a statistical test, strategies in, accept or reject out. I ran it by Monte Carlo on returns where the truth is planted, so I know exactly how often each pipeline gets fooled.</p><p>The answer: <strong>half the layers change nothing, and the ones that work have a price almost nobody quantifies.</strong></p><p>The full study, <strong>with planted ground truth and released code</strong>, is here <br>&#8594; <a href="https://papers.ssrn.com/sol3/papers.cfm?abstract_id=7210219">https://papers.ssrn.com/sol3/papers.cfm?abstract_id=7210219</a></p><p></p><div><hr></div><h3>1. A test only helps if it covers a hole another test left open</h3><p>Every control targets one failure mode. Autocorrelation corrections fix the standard error. Multiplicity corrections fix the fact that you screened many strategies. Out-of-sample schemes fix the in-sample search.</p><p>The result that matters: <strong>two controls targeting the same failure mode are substitutes</strong>. Calibrate them to the same false-positive rate and they become indistinguishable. HAC versus block bootstrap: tie. Bonferroni versus Holm: tie. Stacking both does not lower your false-positive rate by a single point. It only destroys power, meaning real strategies thrown away as luck.</p><p>The failures themselves are real. An uncorrected test on 20 strategies validates pure noise about 64% of the time, and under strong autocorrelation it runs a 29% false-positive rate instead of the 5% it claims. So you need guards. Exactly one per failure mode present, and nothing more.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lKDv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053f0508-f54c-4ce8-9696-4acb3765c2ae_3390x1294.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lKDv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053f0508-f54c-4ce8-9696-4acb3765c2ae_3390x1294.png 424w, https://substackcdn.com/image/fetch/$s_!lKDv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053f0508-f54c-4ce8-9696-4acb3765c2ae_3390x1294.png 848w, https://substackcdn.com/image/fetch/$s_!lKDv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053f0508-f54c-4ce8-9696-4acb3765c2ae_3390x1294.png 1272w, https://substackcdn.com/image/fetch/$s_!lKDv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053f0508-f54c-4ce8-9696-4acb3765c2ae_3390x1294.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!lKDv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053f0508-f54c-4ce8-9696-4acb3765c2ae_3390x1294.png" width="1456" height="556" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/053f0508-f54c-4ce8-9696-4acb3765c2ae_3390x1294.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:556,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:386174,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.newsletter.quantreo.com/i/211388219?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053f0508-f54c-4ce8-9696-4acb3765c2ae_3390x1294.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!lKDv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053f0508-f54c-4ce8-9696-4acb3765c2ae_3390x1294.png 424w, https://substackcdn.com/image/fetch/$s_!lKDv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053f0508-f54c-4ce8-9696-4acb3765c2ae_3390x1294.png 848w, https://substackcdn.com/image/fetch/$s_!lKDv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053f0508-f54c-4ce8-9696-4acb3765c2ae_3390x1294.png 1272w, https://substackcdn.com/image/fetch/$s_!lKDv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053f0508-f54c-4ce8-9696-4acb3765c2ae_3390x1294.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><div><hr></div><h3>2. There is a failure that size and power cannot see</h3><p>A pipeline can hold its false-positive rate, detect live edges, and still validate a strategy whose edge is already dead. Think of a signal that worked for seven years and died two years ago, quietly, inside your sample. Classical test theory has no name for this, because it assumes the truth does not move.</p><p>So I planted edges that break mid-sample, and one scheme stood apart. The strictly forward holdout, which judges only on the end of the sample, treats a dead edge like a null: it validates it 5% of the time, its own error rate. Walk-forward and purged k-fold keep validating it at roughly twice that rate, because they recycle the alive past as out-of-sample. The design that survives every robustness check is a conjunction: a powerful scheme and a forward holdout, and the strategy passes only if both agree.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!s4y4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c67dc93-6741-47f9-ab84-9ee11a8b0ff1_3218x1230.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!s4y4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c67dc93-6741-47f9-ab84-9ee11a8b0ff1_3218x1230.png 424w, https://substackcdn.com/image/fetch/$s_!s4y4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c67dc93-6741-47f9-ab84-9ee11a8b0ff1_3218x1230.png 848w, https://substackcdn.com/image/fetch/$s_!s4y4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c67dc93-6741-47f9-ab84-9ee11a8b0ff1_3218x1230.png 1272w, https://substackcdn.com/image/fetch/$s_!s4y4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c67dc93-6741-47f9-ab84-9ee11a8b0ff1_3218x1230.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!s4y4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c67dc93-6741-47f9-ab84-9ee11a8b0ff1_3218x1230.png" width="1456" height="557" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9c67dc93-6741-47f9-ab84-9ee11a8b0ff1_3218x1230.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:557,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:407886,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.newsletter.quantreo.com/i/211388219?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c67dc93-6741-47f9-ab84-9ee11a8b0ff1_3218x1230.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!s4y4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c67dc93-6741-47f9-ab84-9ee11a8b0ff1_3218x1230.png 424w, https://substackcdn.com/image/fetch/$s_!s4y4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c67dc93-6741-47f9-ab84-9ee11a8b0ff1_3218x1230.png 848w, https://substackcdn.com/image/fetch/$s_!s4y4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c67dc93-6741-47f9-ab84-9ee11a8b0ff1_3218x1230.png 1272w, https://substackcdn.com/image/fetch/$s_!s4y4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c67dc93-6741-47f9-ab84-9ee11a8b0ff1_3218x1230.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><blockquote><p>Against an <strong>edge that erodes gradually instead of breaking</strong>, no scheme protects: every out-of-sample window still contains some live signal, so every scheme gets fooled equally. <strong>That defense lives in monitoring after deployment, not in your validation pipeline.</strong></p></blockquote><p></p><div><hr></div><h3>3. Honesty doubles the edge you need</h3><p>Now the price. A single honest test on ten years of daily data detects a Sharpe of about 0.8 with 80% power. Screen 20 strategies with 10 configurations each, validate with a pipeline that is correctly sized and forward-honest, and the minimum detectable edge rises to about 1.6.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!11mE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc979728a-8ee6-434f-b88d-724c1df63195_3190x1238.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!11mE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc979728a-8ee6-434f-b88d-724c1df63195_3190x1238.png 424w, https://substackcdn.com/image/fetch/$s_!11mE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc979728a-8ee6-434f-b88d-724c1df63195_3190x1238.png 848w, https://substackcdn.com/image/fetch/$s_!11mE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc979728a-8ee6-434f-b88d-724c1df63195_3190x1238.png 1272w, https://substackcdn.com/image/fetch/$s_!11mE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc979728a-8ee6-434f-b88d-724c1df63195_3190x1238.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!11mE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc979728a-8ee6-434f-b88d-724c1df63195_3190x1238.png" width="1456" height="565" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c979728a-8ee6-434f-b88d-724c1df63195_3190x1238.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:565,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:348235,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.newsletter.quantreo.com/i/211388219?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc979728a-8ee6-434f-b88d-724c1df63195_3190x1238.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!11mE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc979728a-8ee6-434f-b88d-724c1df63195_3190x1238.png 424w, https://substackcdn.com/image/fetch/$s_!11mE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc979728a-8ee6-434f-b88d-724c1df63195_3190x1238.png 848w, https://substackcdn.com/image/fetch/$s_!11mE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc979728a-8ee6-434f-b88d-724c1df63195_3190x1238.png 1272w, https://substackcdn.com/image/fetch/$s_!11mE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc979728a-8ee6-434f-b88d-724c1df63195_3190x1238.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p><strong>Twice the edge.</strong> Not because the pipeline is badly built, but because it is honestly built. The detection bar scales with the size of your search, and one product governs everything: annualized Sharpe times the square root of years. Read it the other way: <strong>the Sharpe 0.8 edge a single test resolves in a decade would take this pipeline four decades to certify.</strong></p><p></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.newsletter.quantreo.com/subscribe?"><span>Subscribe now</span></a></p><p>Reliability is not bought by piling on tests. It is bought by covering each failure mode once, and knowing what your pipeline cannot see.</p><p>Next time a validation layer makes you feel safer, ask which failure mode it covers. If you cannot name it, the layer is decoration.</p>]]></content:encoded></item><item><title><![CDATA[Max Drawdown Is a Distribution, Not a Number]]></title><description><![CDATA[Why the worst loss in your backtest tells you almost nothing about the worst loss you should plan for, and how a block bootstrap makes the gap visible.]]></description><link>https://www.newsletter.quantreo.com/p/max-drawdown-is-a-distribution-not</link><guid isPermaLink="false">https://www.newsletter.quantreo.com/p/max-drawdown-is-a-distribution-not</guid><dc:creator><![CDATA[Lucas]]></dc:creator><pubDate>Fri, 12 Jun 2026 14:30:56 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/3e1b69f1-d8a3-4fc0-ba6a-7c4231f9b3ac_1456x816.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Most track records report a single max drawdown and treat it as a property of the strategy. A risk memo states the max drawdown is 12 percent, and that figure gets used as if the next one cannot be worse without something breaking. It can. <strong>That 12 percent is one realization of a path dependent statistic, not a ceiling</strong>.</p><p>Max drawdown is more fragile than almost any other metric, because it depends on the ordering of returns, not their average. It lives in consecutive loss sequences. Resample that sequence while respecting its structure and the full distribution appears. On the trend strategy below, the observed drawdown sits in the lower tail, and the 95th percentile scenario is roughly 1.5x worse, with nothing changed in the strategy itself.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.newsletter.quantreo.com/subscribe?"><span>Subscribe now</span></a></p><p></p><h2>1. Why max drawdown is the most fragile number in your backtest</h2><p>Mean, volatility, Sharpe are averages. Reshuffle your returns and they barely move. Max drawdown is a function of the path: it depends entirely on the order in which losses arrived, because it measures the deepest peak to trough the equity curve reached.</p><p>Same returns, same Sharpe, different ordering, different drawdown. <strong>Cluster the losses and it deepens, spread them out and it shrinks</strong>. So the observed max drawdown is one realized path out of many the same process could produce, closer to a sample maximum than to a stable parameter. Reporting it as a fixed risk limit treats one lucky or unlucky ordering as the boundary of what the strategy can do.</p><p>The fix: <strong>estimate its distribution by resampling the return stream</strong>, while preserving the loss clustering the drawdown lives on. That last constraint is where the bootstrap choice becomes the whole game.</p><p></p><h2>2. Resampling the drawdown</h2><p>The idea is one sentence: <strong>resample the strategy&#8217;s return stream in blocks, rebuild the equity curve, take its drawdown, and repeat a few thousand times</strong>. The spread of those drawdowns is the distribution the single number was hiding.</p><p>Two constraints carry the result. Blocks, not single points: drawdowns live in consecutive losses, so resampling contiguous chunks preserves the clustering that an iid resample destroys and understates. And each resampled path keeps the original length, since max drawdown grows mechanically with the window. One note on interpretation:<strong> this holds the strategy fixed and varies only the ordering, which is exactly the question here, how much could sequencing alone have moved my worst loss.</strong></p><p>On the trend strategy used here, the observed max drawdown is 17.9 percent. The bootstrap median is 15.7 percent, the 95th percentile is 26.9 percent. The worst loss actually observed sits near the middle of the distribution, and the severe scenario is roughly 1.5x deeper, with nothing changed in the strategy.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Y3gY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9c3b511-f5be-472c-b4d7-bf46797a6953_1245x740.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Y3gY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9c3b511-f5be-472c-b4d7-bf46797a6953_1245x740.png 424w, https://substackcdn.com/image/fetch/$s_!Y3gY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9c3b511-f5be-472c-b4d7-bf46797a6953_1245x740.png 848w, https://substackcdn.com/image/fetch/$s_!Y3gY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9c3b511-f5be-472c-b4d7-bf46797a6953_1245x740.png 1272w, https://substackcdn.com/image/fetch/$s_!Y3gY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9c3b511-f5be-472c-b4d7-bf46797a6953_1245x740.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!Y3gY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9c3b511-f5be-472c-b4d7-bf46797a6953_1245x740.png" width="1245" height="740" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a9c3b511-f5be-472c-b4d7-bf46797a6953_1245x740.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:740,&quot;width&quot;:1245,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:63365,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.newsletter.quantreo.com/i/201738396?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9c3b511-f5be-472c-b4d7-bf46797a6953_1245x740.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Y3gY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9c3b511-f5be-472c-b4d7-bf46797a6953_1245x740.png 424w, https://substackcdn.com/image/fetch/$s_!Y3gY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9c3b511-f5be-472c-b4d7-bf46797a6953_1245x740.png 848w, https://substackcdn.com/image/fetch/$s_!Y3gY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9c3b511-f5be-472c-b4d7-bf46797a6953_1245x740.png 1272w, https://substackcdn.com/image/fetch/$s_!Y3gY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9c3b511-f5be-472c-b4d7-bf46797a6953_1245x740.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The reading is direct. The observed drawdown is a typical draw, not a ceiling. Risk sizing should reference the 95th percentile, not the historical worst: a book you would run at one level of leverage on a 17.9 percent drawdown looks different once a 27 percent drawdown is inside its normal range.</p><p></p><h2>3. One trap, and the takeaway</h2><p>A tempting variant is to bootstrap the price series instead, rebuild the path, then re-run the strategy on it. <strong>It looks equivalent. It is not</strong>. For a trend follower with a short block length, resampling prices scrambles the long sequences the signal relies on, so the strategy stops seeing the trend. <strong>On the same example, the Sharpe collapses from 0.56 to 0.02</strong>. That approach answers a different question, whether the edge survives a reshuffled market, and it is a useful test on its own. It is not a measure of drawdown uncertainty, and the two should not be confused.</p><p>The takeaway is the same line we started with. Max drawdown is a draw, not a property. The honest version of a track record is not &#8220;the worst loss was 17.9 percent&#8221; but &#8220;<em><strong>the worst loss was 17.9 percent, and a 27 percent drawdown is well within the normal range of this strategy</strong></em>.&#8221; Size the risk on the distribution, not on the single path history happened to hand you.</p>]]></content:encoded></item><item><title><![CDATA[ML trading or data mining?]]></title><description><![CDATA[The line is thinner than you think]]></description><link>https://www.newsletter.quantreo.com/p/ml-trading-or-data-mining</link><guid isPermaLink="false">https://www.newsletter.quantreo.com/p/ml-trading-or-data-mining</guid><dc:creator><![CDATA[Lucas]]></dc:creator><pubDate>Fri, 29 May 2026 14:31:25 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/04faac06-7c57-4afb-be3b-d68ee7a42d28_1456x816.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Everyone runs ML trading. <strong>Almost no one can tell when it quietly turns into data mining</strong>.</p><p>The code is identical. The tools are the same: XGBoost, cross-validation, feature engineering. Yet one produces alpha, the other produces a statistical illusion that dies in the first week of live trading.</p><p>I see this line crossed every day. Not out of incompetence. Out of habit.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p><div><hr></div><h2>1. The line is not technical, it&#8217;s methodological</h2><p><strong>ML trading</strong>: you start from an economic hypothesis, you build a model to test it.<br><strong>Data mining</strong>: you start from the data, you search for what works, you rationalize after.</p><p><strong>The honest test</strong>: can you explain why your feature should work BEFORE seeing the backtest? If the justification shows up after the equity curve, you haven&#8217;t found alpha. You&#8217;ve found a correlation.</p><p></p><div><hr></div><h2>2. The red flags</h2><p>A few patterns that should trigger an alarm in your research:</p><ul><li><p>Sharpe climbing with every iteration</p></li><li><p>Hyperparameters tuned on the out-of-sample period</p></li><li><p>Lookback window chosen through grid search</p></li><li><p>Holdout set &#8220;checked&#8221; more than once</p></li><li><p>Sharpe above 3 on a simple strategy, on a handful of assets</p></li><li><p>You trade BTC because &#8220;it doesn&#8217;t work as well on ETH&#8221;</p></li></ul><p>Two boxes checked, you&#8217;re likely data mining. Three, you definitely are.</p><p></p><div><hr></div><h2>3. The validation framework that closes the door</h2><p>Three tools, no less:</p><ul><li><p><strong>CPCV</strong> (Combinatorial Purged Cross-Validation) instead of naive K-fold</p></li><li><p><strong>Deflated Sharpe Ratio</strong> (Bailey and L&#243;pez de Prado), which explicitly adjusts for the number of trials</p></li><li><p>A holdout set that stays untouched. <strong>Truly untouched</strong>.</p></li></ul><blockquote><p>The rule that stings: testing 20 strategies at a 5% threshold is a near-guarantee of one false discovery. If you don&#8217;t know how many variants you&#8217;ve tested, you&#8217;re data mining without knowing it.</p></blockquote><p></p><p>Edge comes from the hypothesis, not from the algorithm.</p><p>ML is an alpha extraction tool, not an alpha generator. No library, no model, no feature creates an edge from nothing. If the economic thesis isn&#8217;t there before the code, the code won&#8217;t make it appear.</p><p>The discipline that separates the quant from the data miner: <strong>pre-registering hypotheses, the way academic research does</strong>. Writing down what you&#8217;re looking for before you start looking.</p><p>It&#8217;s uncomfortable. That&#8217;s exactly why so few do it.</p><p></p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Quantreo! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Live Crypto Data in 15 Lines of Python]]></title><description><![CDATA[No account, no API key, no cost. Just an open socket and Python.]]></description><link>https://www.newsletter.quantreo.com/p/live-crypto-data-in-15-lines-of-python</link><guid isPermaLink="false">https://www.newsletter.quantreo.com/p/live-crypto-data-in-15-lines-of-python</guid><dc:creator><![CDATA[Lucas]]></dc:creator><pubDate>Fri, 22 May 2026 14:30:43 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/73a3f132-deb4-481a-a118-c5ffd689af73_1456x816.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You want live crypto data. No account, no key, no cost. Binance gives it away through a WebSocket, and the whole thing fits in 15 lines of Python.</p><p>Here is the minimum that works.</p><blockquote><p>This is a quick tutorial. If you want the <strong>full stack</strong> (ingestion, storage, time travel, alt-data, <strong>meteo</strong>, <strong>satellite images</strong>&#8230;), <strong>QuantLake is live</strong>: <a href="https://www.quantreo.com/quantlake-program/">https://www.quantreo.com/quantlake-program/</a></p></blockquote><div><hr></div><h2>1. What you need</h2><p>One library.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;6f23bde7-97e8-4107-b524-9c99db296ce0&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">pip install websockets</code></pre></div><p>That&#8217;s it. No Binance account. No API key. Public market streams are open.</p><p></p><div><hr></div><h2>2. The connection</h2><p>Binance exposes one URL per stream. Format is simple:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;46bf3c5e-0750-442a-afb3-4e00574bfeff&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">wss://stream.binance.com:9443/ws/&lt;symbol&gt;@&lt;stream&gt;</code></pre></div><p><em><strong>symbol</strong></em> in lowercase (<em><strong>btcusdt</strong></em>, <em><strong>ethusdt</strong></em>), <em><strong>stream</strong></em> is what you want to receive (<em><strong>trade</strong></em>, <em><strong>kline_1m</strong></em>, <em><strong>depth</strong></em>, <em><strong>aggTrade</strong></em>).</p><p>Open the socket, read messages, parse JSON. Done.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;33193964-b4ce-4703-b714-736ebca8ab27&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">import json
import asyncio
import websockets

async def stream_trades(symbol="btcusdt"):
    url = f"wss://stream.binance.com:9443/ws/{symbol}@trade"
    async with websockets.connect(url) as ws:
        async for msg in ws:
            trade = json.loads(msg)
            price = float(trade["p"])
            qty   = float(trade["q"])
            ts    = trade["T"]
            print(f"{ts}  {price:.2f}  {qty:.4f}")

asyncio.run(stream_trades())</code></pre></div><p>Run it. Every trade on BTC/USDT prints in your terminal, the moment it happens.</p><p></p><div><hr></div><h2>3. What the fields mean</h2><p>The JSON payload for <em><strong>@trade</strong></em> looks like this:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;fe59286c-58bc-402a-8ab9-ba81073aab25&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">{
  "e": "trade",
  "E": 1716384000000,
  "s": "BTCUSDT",
  "p": "67432.10",
  "q": "0.00125",
  "T": 1716383999998,
  "m": false
}</code></pre></div><p></p><h2>4. Want 1-minute bars instead?</h2><p>Same code, one line changes. Replace <em><strong>@trade</strong></em> with <em><strong>@kline_1m</strong></em>:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;cef59707-76c7-47c5-8e79-9bfaab5faf22&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">url = f&#8221;wss://stream.binance.com:9443/ws/{symbol}@kline_1m&#8221;</code></pre></div><p>Binance pushes the current bar on every update, and marks it closed when it&#8217;s done. The field <em><strong>k.x</strong></em> is <em><strong>true</strong></em> only on the final tick of the bar. That&#8217;s your signal to persist it.`</p><p></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;93f6a2ec-f4a9-495f-8133-45a0b3032eff&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">kline = json.loads(msg)["k"]
if kline["x"]:
    print("closed bar:", kline["t"], kline["o"], kline["h"], kline["l"], kline["c"])</code></pre></div><p>Other useful streams, same pattern: <em><strong>@aggTrade</strong></em> for aggregated trades, <code>@depth</code> for order book diffs, <em><strong>@kline_5m</strong></em>, <em><strong>@kline_1h</strong></em>, etc.</p><p></p><div><hr></div><h2>5. The practical rule</h2><p>This script will run, and it will fail. Sockets disconnect. Binance forces a reset every 24 hours, your network drops, your laptop sleeps. The 15-line version is for learning, not for production.</p><p>The real stack needs three things on top: auto-reconnect, persistence to a proper database, and a schema that doesn&#8217;t get corrupted on every restart.</p><p>Open the socket today. Watch the data come in. Then think about where it goes next.</p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Quantreo! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[90% of retail quants don't have a database. Just files.]]></title><description><![CDATA[The fix costs &#8364;0. The bug costs you months of research.]]></description><link>https://www.newsletter.quantreo.com/p/90-of-retail-quants-dont-have-a-database</link><guid isPermaLink="false">https://www.newsletter.quantreo.com/p/90-of-retail-quants-dont-have-a-database</guid><dc:creator><![CDATA[Lucas]]></dc:creator><pubDate>Fri, 15 May 2026 14:30:59 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/0f14a273-5acb-45fe-ad7f-45efee401e39_1280x640.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Here&#8217;s the setup nobody questions. You download data and you save it as a .csv, maybe a .parquet if you&#8217;re &#8220;serious.&#8221; Then you add a folder, then ten more. That&#8217;s not a database, that&#8217;s a drawer you throw things into.</p><p>And it breaks your research in three ways.</p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Quantreo! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h2>1. No history</h2><p>Every update overwrites the last one, so your history is whatever your last script run decided it would be. If your data provider silently revised last month&#8217;s values, you&#8217;ll never know. And the exact backtest you ran in March? You can&#8217;t replay it. That data is already gone.</p><p></p><div><hr></div><h2>2. Writes aren&#8217;t atomic</h2><p>Your update script crashes halfway through, and half the data is written while the other half isn't. So you rerun it, and now you've got duplicates. Your base is quietly corrupted, and you won't find out until it's already in your results.</p><p></p><div><hr></div><h2>3. No clean incremental updates</h2><p>Adding today&#8217;s data means rewriting the whole file, or bolting on a fragile append that has no idea what&#8217;s already there. New rows, existing rows, your files can&#8217;t tell the difference, so every update is a small gamble.</p><p></p><p>A file is not a database.</p><p>The fix isn&#8217;t expensive. It costs &#8364;0. It&#8217;s called Delta Lake: a transactional layer on top of Parquet. ACID writes, time travel, clean incremental updates, the things you actually need.</p><p><strong>Next week, I&#8217;ll show you how to feed it: crypto and CFDs, live, for &#8364;0. That&#8217;s QuantLake. More in a few days.</strong></p>]]></content:encoded></item><item><title><![CDATA[The Clip Effect: Is Your Backtest Real, or Just Lucky?]]></title><description><![CDATA[A 60-second robustness check that kills most backtests.]]></description><link>https://www.newsletter.quantreo.com/p/the-clip-effect-is-your-backtest</link><guid isPermaLink="false">https://www.newsletter.quantreo.com/p/the-clip-effect-is-your-backtest</guid><dc:creator><![CDATA[Lucas]]></dc:creator><pubDate>Fri, 08 May 2026 14:31:02 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Ez1_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf9f356f-9155-4867-85b0-dc0920c1a804_736x436.heic" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You ran a grid search. Lookback = 20 gives you a Sharpe of 2.1. You smile. You start writing the strategy doc.</p><p>Then you check 19 and 21. Both at 0.4.</p><p>Welcome to the clip effect.</p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Weekly notes from inside a quant research workflow. Subscribe, it is free.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2></h2><div><hr></div><h2>1. What it actually means</h2><p>When you optimize a strategy, you scan parameters across a range. If your &#8220;best&#8221; parameter sits as an isolated peak surrounded by mediocre or losing values, <strong>the result is almost certainly noise</strong>. A real edge produces a plateau, not a pixel.</p><p>A backtest is a sample of one path. With enough parameter combinations, <strong>some of them will look great by accident</strong>. The clip effect is the visual signature of that accident.</p><blockquote><p>The vocabulary varies in the literature (parameter stability, neighborhood robustness), but the test is the same: does the strategy survive small changes in its inputs?</p></blockquote><p></p><div><hr></div><h2>2. A concrete example</h2><p>Basic moving average crossover on EUR/USD, daily bars, 2015 to 2024. Fast MA fixed at 5, slow MA varied from 18 to 22. Two strategies, both peaking at lookback = 20.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ez1_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf9f356f-9155-4867-85b0-dc0920c1a804_736x436.heic" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ez1_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf9f356f-9155-4867-85b0-dc0920c1a804_736x436.heic 424w, https://substackcdn.com/image/fetch/$s_!Ez1_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf9f356f-9155-4867-85b0-dc0920c1a804_736x436.heic 848w, https://substackcdn.com/image/fetch/$s_!Ez1_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf9f356f-9155-4867-85b0-dc0920c1a804_736x436.heic 1272w, https://substackcdn.com/image/fetch/$s_!Ez1_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf9f356f-9155-4867-85b0-dc0920c1a804_736x436.heic 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ez1_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf9f356f-9155-4867-85b0-dc0920c1a804_736x436.heic" width="736" height="436" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/af9f356f-9155-4867-85b0-dc0920c1a804_736x436.heic&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:436,&quot;width&quot;:736,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:18903,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/heic&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.newsletter.quantreo.com/i/196748508?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf9f356f-9155-4867-85b0-dc0920c1a804_736x436.heic&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Ez1_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf9f356f-9155-4867-85b0-dc0920c1a804_736x436.heic 424w, https://substackcdn.com/image/fetch/$s_!Ez1_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf9f356f-9155-4867-85b0-dc0920c1a804_736x436.heic 848w, https://substackcdn.com/image/fetch/$s_!Ez1_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf9f356f-9155-4867-85b0-dc0920c1a804_736x436.heic 1272w, https://substackcdn.com/image/fetch/$s_!Ez1_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf9f356f-9155-4867-85b0-dc0920c1a804_736x436.heic 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Same optimum. Opposite stories.</p><p>The red line is the trap. Sharpe 2.07 at lookback 20, but 0.42 at 19 and 0.38 at 21. If you stop at &#8220;Sharpe 2 on lookback 20&#8221;, you have learned nothing about the market. <strong>You have learned that a specific number aligned with a specific sequence of trades</strong>. Move one step left or right, the alpha is gone.</p><p>The blue line is what real structure looks like. Lower peak (1.78), but 1.61 and 1.65 right next to it. <strong>The signal exists before, at, and after the optimum</strong>.</p><p>Compare the peaks in isolation, the red strategy wins. Compare the surfaces, the choice is obvious.</p><p></p><div><hr></div><h2>3. Going 2D: the heatmap test</h2><p>One parameter is rarely enough. Most strategies have at least two: a feature window and a target horizon, two moving averages, a volatility filter and a signal threshold. The proper version of the clip test is a 2D heatmap of Sharpe across the parameter grid.</p><p>What you want to see: a connected zone of green, smooth gradients, the optimum sitting inside a region of similar values.</p><p>What kills the strategy: scattered green pixels in a sea of red, or a single bright square with nothing around it.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QqQu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91ee9be2-fbf8-49d4-b478-598bdfc1fee3_856x458.heic" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QqQu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91ee9be2-fbf8-49d4-b478-598bdfc1fee3_856x458.heic 424w, https://substackcdn.com/image/fetch/$s_!QqQu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91ee9be2-fbf8-49d4-b478-598bdfc1fee3_856x458.heic 848w, https://substackcdn.com/image/fetch/$s_!QqQu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91ee9be2-fbf8-49d4-b478-598bdfc1fee3_856x458.heic 1272w, https://substackcdn.com/image/fetch/$s_!QqQu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91ee9be2-fbf8-49d4-b478-598bdfc1fee3_856x458.heic 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!QqQu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91ee9be2-fbf8-49d4-b478-598bdfc1fee3_856x458.heic" width="856" height="458" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/91ee9be2-fbf8-49d4-b478-598bdfc1fee3_856x458.heic&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:458,&quot;width&quot;:856,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:40960,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/heic&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.newsletter.quantreo.com/i/196748508?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91ee9be2-fbf8-49d4-b478-598bdfc1fee3_856x458.heic&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!QqQu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91ee9be2-fbf8-49d4-b478-598bdfc1fee3_856x458.heic 424w, https://substackcdn.com/image/fetch/$s_!QqQu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91ee9be2-fbf8-49d4-b478-598bdfc1fee3_856x458.heic 848w, https://substackcdn.com/image/fetch/$s_!QqQu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91ee9be2-fbf8-49d4-b478-598bdfc1fee3_856x458.heic 1272w, https://substackcdn.com/image/fetch/$s_!QqQu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91ee9be2-fbf8-49d4-b478-598bdfc1fee3_856x458.heic 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In 2D, the eye does the work. With five parameters and ten possible slices, you need a quantitative metric: average Sharpe in the &#177;1 neighborhood, peak-to-mean ratio, or fraction of the grid above a threshold. Visualization is a starting point, not the test itself.</p><p></p><div><hr></div><h2>4. The practical rule</h2><p>Before you trust any optimum, ask one question:</p><p><strong>Does Sharpe degrade by more than 30 to 40% when I move &#177;1 on each parameter?</strong></p><p>If yes, drop the strategy. If no, you have passed the first filter, not the last one.</p><p>The clip test will not save you from every form of overfitting. Scanning 50 parameter pairs and selecting the best plateau is still cherry picking, just better dressed. But this is the cheapest, most visual robustness check you can run, and it kills the majority of bad backtests in seconds.</p><p>Run it on every strategy you build. You will discard more than you keep.</p><p>That is the point.</p><p></p><p>&#8594; Speaking of robustness, the next bottleneck most retail quants hit is data. Next week I am opening up <strong>Quantlake</strong>, the program I have been building on creating quant database for 0$: weather, crypto alt-data, CFD, spot markets. Stay tuned!</p><p></p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">One robustness check, one piece of code, one idea you can use. Every week, in your inbox.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Building a Clean Research Environment with Oryon]]></title><description><![CDATA[How to combine features and targets in one dataframe before doing exploratory data analysis.]]></description><link>https://www.newsletter.quantreo.com/p/building-a-clean-research-environment</link><guid isPermaLink="false">https://www.newsletter.quantreo.com/p/building-a-clean-research-environment</guid><dc:creator><![CDATA[Lucas]]></dc:creator><pubDate>Fri, 01 May 2026 14:30:39 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/aaa254ff-50be-4271-a3f5-e1b27d92f6e9_1280x640.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Exploratory data analysis in quant often <strong>becomes messy much faster than expected</strong>.</p><p>Features are computed in one place, targets in another, and then everything has to be aligned manually before any real analysis can begin. That usually means extra joins, shifting logic, duplicated code, and a <strong>higher risk of silent mistakes</strong>.</p><p>The issue is not computing features or targets. The issue is creating a research dataset where both live together cleanly and can be analyzed immediately.</p><div><hr></div><h2>1. The Oryon Approach</h2><p>With <a href="https://oryonlib.dev">Oryon</a>, the process stays simple. You build a <code>FeaturePipeline</code>, a <code>TargetPipeline</code>, run both on the same market data, and join the outputs into a single dataframe.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;0f58385f-33c6-4fad-97bf-ea962d7cbd76&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">from oryon.datasets import load_sample_bars
from oryon import FeaturePipeline
from oryon.features import Sma, ParkinsonVolatility, Correlation, ShannonEntropy, Adf
from oryon.scalers import RollingZScore
from oryon.adapters import run_features_pipeline_pandas


# Import sample data (OHLCV bars)
df = load_sample_bars()

# Create the features list
features_list = [
    Correlation(inputs=["close", "volume"], window=30, outputs=["close_volume_corr_30"]),
    ParkinsonVolatility(inputs=["high","low"], window=50, outputs=["close_pvol_50"]),
    Adf(inputs=["close"], window=100, outputs=["close_adf_100", "close_adf_pval_100"])
]

# Create the scalers list to apply z-score to all the wanted features
scalers_list = [RollingZScore(inputs=[col], window=2000, outputs=[f"z_{col}"]) for col in [
    "close_volume_corr_30", "close_pvol_50", "close_adf_pval_100"
]]

# Combine both list
features_list.extend(scalers_list)

# Create the pipeline object (that can run to on live trading)
pipe = FeaturePipeline(features_list, input_columns=["close", "high", "low", "volume"])

# Run the pipeline on the sample data
df_features = run_features_pipeline_pandas(pipe, df)</code></pre></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;85f2498c-aee9-4211-82a8-63485b9ef1a2&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">from oryon import TargetPipeline
from oryon.adapters import run_targets_pipeline_pandas
from oryon.targets import FutureReturn, FutureLinearSlope

# Essential for the FutureLinearSlope (x=time, y=price)
df["constant_time"] = [i for i in range(len(df))] # Essential for the FutureLinearSlope (x=time, y=price)

# Create the targets list
targets_list = [
    FutureLinearSlope(inputs=["constant_time", "close"], horizon=20, outputs=["future_slope_20", "r2_future_slope_20"]),
    FutureLinearSlope(inputs=["constant_time", "close"], horizon=50, outputs=["future_slope_50", "r2_future_slope_50"]),
    FutureReturn(inputs=["close"], horizon=10, outputs=["future_returns_2"])
]

# Create the target pipeline object
target_pipe = TargetPipeline(targets_list, input_columns=["constant_time", "close"])

# Run the pipeline
df_targets = run_targets_pipeline_pandas(target_pipe, df)

# Ready-to-use dataframe
df_research = df_features.join(df_targets)</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!V7JA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6be16963-1cf9-4de3-ac97-2d1e58e4fa23_1095x378.heic" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!V7JA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6be16963-1cf9-4de3-ac97-2d1e58e4fa23_1095x378.heic 424w, https://substackcdn.com/image/fetch/$s_!V7JA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6be16963-1cf9-4de3-ac97-2d1e58e4fa23_1095x378.heic 848w, https://substackcdn.com/image/fetch/$s_!V7JA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6be16963-1cf9-4de3-ac97-2d1e58e4fa23_1095x378.heic 1272w, https://substackcdn.com/image/fetch/$s_!V7JA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6be16963-1cf9-4de3-ac97-2d1e58e4fa23_1095x378.heic 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!V7JA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6be16963-1cf9-4de3-ac97-2d1e58e4fa23_1095x378.heic" width="1095" height="378" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6be16963-1cf9-4de3-ac97-2d1e58e4fa23_1095x378.heic&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:378,&quot;width&quot;:1095,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:44051,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/heic&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.newsletter.quantreo.com/i/193702920?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6be16963-1cf9-4de3-ac97-2d1e58e4fa23_1095x378.heic&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!V7JA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6be16963-1cf9-4de3-ac97-2d1e58e4fa23_1095x378.heic 424w, https://substackcdn.com/image/fetch/$s_!V7JA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6be16963-1cf9-4de3-ac97-2d1e58e4fa23_1095x378.heic 848w, https://substackcdn.com/image/fetch/$s_!V7JA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6be16963-1cf9-4de3-ac97-2d1e58e4fa23_1095x378.heic 1272w, https://substackcdn.com/image/fetch/$s_!V7JA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6be16963-1cf9-4de3-ac97-2d1e58e4fa23_1095x378.heic 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The result is a single research table where engineered features and forward-looking targets are already aligned and <strong>ready to explore</strong>.</p><div><hr></div><h2>3. Why This Matters</h2><p>Once everything is in the same dataframe, <strong>EDA becomes much easier</strong>.</p><p>You can immediately start testing simple relationships between inputs and outputs, whether through correlation, mutual information, or more advanced selection methods. Instead of spending time preparing the dataset, you can focus on extracting useful structure from it.</p><p>That is the real value of a clean research environment: <strong>less plumbing, more analysis</strong>.</p><p></p><blockquote><p><strong>If you want to take this further and connect feature pipelines with AI agents, you can take a look at <a href="https://www.quantreo.com/ai-trading-lab/">AI Trading Lab</a>.</strong></p></blockquote><p></p><p><a href="https://oryonlib.dev">Oryon</a> is now available in beta.</p><p>If you want to take a closer look at the library and its design, you can explore it directly on <a href="https://github.com/lucasinglese/oryon">GitHub</a>.</p><p>And if you find it useful, consider adding a star. it helps more than it seems.</p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"><em><strong>Subscribe to follow the ideas, tools, and production-grade systems shaping modern quantitative trading.</strong></em></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[Standardizing Features Without Breaking Your Pipeline]]></title><description><![CDATA[A More Coherent Way to Standardize Features in Quantitative Pipelines]]></description><link>https://www.newsletter.quantreo.com/p/standardizing-features-without-breaking</link><guid isPermaLink="false">https://www.newsletter.quantreo.com/p/standardizing-features-without-breaking</guid><dc:creator><![CDATA[Lucas]]></dc:creator><pubDate>Fri, 24 Apr 2026 14:31:05 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/9400db4c-7e2a-45d2-9a38-b5a53242df18_1280x640.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In quantitative trading, <strong>standardizing features</strong> is almost a reflex.</p><p>It helps stabilize distributions, improves model convergence, and makes signals comparable across time. Whether you work with returns, volatility, or engineered indicators, <strong>scaling is everywhere</strong>.</p><p>In practice, most pipelines rely on <code>StandardScaler</code> from scikit-learn.</p><p>That is perfectly <strong>acceptable in research</strong>. But as soon as a pipeline becomes more serious, this setup <strong>starts to create unnecessary friction</strong>.</p><div><hr></div><h2>1. The Real Issue Is Not the Math</h2><p>The problem is not standardization itself. <strong>The problem is fragmentation</strong>.</p><p>A typical quant stack quickly becomes a mix of unrelated components. Features may come from one library, transformations from another, and scaling from yet another. You might compute signals with <a href="https://oryonlib.dev">Oryon</a>, apply an operator from SciPy, then standardize everything with scikit-learn.</p><p>Each piece works in isolation. But the overall system becomes harder to reason about.</p><p>You end up <strong>mixing different APIs</strong>, different update models, and different assumptions about how computations should behave through time. In a notebook, this may still feel manageable. In a real feature pipeline, <strong>it becomes cumbersome</strong>.</p><div><hr></div><h2>2. A More Coherent Design</h2><p>The idea behind the scalers added in <a href="https://oryonlib.dev">Oryon</a> is straightforward: scaling should behave exactly like any other feature. Instead of treating it as a separate preprocessing step, it becomes <strong>part of the pipeline itself</strong>, built on the same assumptions, with the same interface.</p><p>This means:</p><ul><li><p>same update logic</p></li><li><p>same state management</p></li><li><p>same behavior in research and live</p></li></ul><p>A rolling standard deviation, for instance, is no longer something you compute &#8220;outside&#8221; your pipeline. <strong>It is a feature, updated incrementally</strong>.</p><div><hr></div><h2>3. From Raw Prices to Standardized Signal</h2><p>Below is a pipeline that computes several market features and standardizes them directly inside Oryon using a <a href="https://oryonlib.dev/api/scalers/#rolling-z-score">rolling z-score</a>.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;4289c521-66d4-4e38-ac98-0676fe8f7f99&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">from oryon.datasets import load_sample_bars
from oryon import FeaturePipeline
from oryon.features import Sma, ParkinsonVolatility, Correlation, ShannonEntropy, Adf
from oryon.scalers import RollingZScore
from oryon.adapters import run_features_pipeline_pandas


# Import sample data (OHLCV bars)
df = load_sample_bars()

# Create the features list
features_list = [
    Correlation(inputs=["close", "volume"], window=30, outputs=["close_volume_corr_30"]),
    ParkinsonVolatility(inputs=["high","low"], window=50, outputs=["close_pvol_50"]),
    Adf(inputs=["close"], window=100, outputs=["close_adf_100", "close_adf_pval_100"])
]

# Create the scalers list to apply z-score to all the wanted features
scalers_list = [RollingZScore(inputs=[col], window=2000, outputs=[f"z_{col}"]) for col in [
    "close_volume_corr_30", "close_pvol_50", "close_adf_pval_100"
]]

# Combine both list
features_list.extend(scalers_list)

# Create the pipeline object (that can run to on live trading)
pipe = FeaturePipeline(features_list, input_columns=["close", "high", "low", "volume"])

# Run the pipeline on the sample data
df_features = run_features_pipeline_pandas(pipe, df)</code></pre></div><p>What matters here is not only the rolling normalization itself. It is the fact that the scaler is defined exactly like any other component in the pipeline.</p><p>There is <strong>no handoff to another library</strong>, no separate preprocessing object to maintain, and no conceptual break between feature computation and feature standardization.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dS4Y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d7483f4-fa11-41b7-9428-ab4c57c7c3c1_2685x898.heic" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dS4Y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d7483f4-fa11-41b7-9428-ab4c57c7c3c1_2685x898.heic 424w, https://substackcdn.com/image/fetch/$s_!dS4Y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d7483f4-fa11-41b7-9428-ab4c57c7c3c1_2685x898.heic 848w, https://substackcdn.com/image/fetch/$s_!dS4Y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d7483f4-fa11-41b7-9428-ab4c57c7c3c1_2685x898.heic 1272w, https://substackcdn.com/image/fetch/$s_!dS4Y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d7483f4-fa11-41b7-9428-ab4c57c7c3c1_2685x898.heic 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!dS4Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d7483f4-fa11-41b7-9428-ab4c57c7c3c1_2685x898.heic" width="1456" height="487" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6d7483f4-fa11-41b7-9428-ab4c57c7c3c1_2685x898.heic&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:487,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:199407,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/heic&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.newsletter.quantreo.com/i/193696915?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d7483f4-fa11-41b7-9428-ab4c57c7c3c1_2685x898.heic&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dS4Y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d7483f4-fa11-41b7-9428-ab4c57c7c3c1_2685x898.heic 424w, https://substackcdn.com/image/fetch/$s_!dS4Y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d7483f4-fa11-41b7-9428-ab4c57c7c3c1_2685x898.heic 848w, https://substackcdn.com/image/fetch/$s_!dS4Y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d7483f4-fa11-41b7-9428-ab4c57c7c3c1_2685x898.heic 1272w, https://substackcdn.com/image/fetch/$s_!dS4Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d7483f4-fa11-41b7-9428-ab4c57c7c3c1_2685x898.heic 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The chart says it all: before scaling, <strong>the variables do not really live in the same space</strong>. After scaling, <strong>they do</strong>.</p><div><hr></div><h2>4. Why This Matters</h2><p>A quant pipeline should <strong>not feel like an assembly of disconnected utilities</strong>.</p><p>As soon as features, operators, and scalers obey different conventions, every extension becomes slightly more fragile. The code becomes harder to read, harder to debug, and harder to move from research to something more robust.</p><p><strong>Keeping standardization inside Oryon solves a very practical problem</strong>: it removes one more external dependency from the feature workflow and replaces it with a component that behaves exactly like the rest of the system.</p><p>The gain is <strong>not only speed</strong>, even if the implementation is also significantly faster. The deeper gain is consistency.</p><p></p><p>If you are interested in building <strong>cleaner research pipelines</strong>, with feature engineering components that are designed to work together rather than coexist by accident, Oryon is exactly the kind of framework worth exploring.</p><p></p><p><a href="https://oryonlib.dev">Oryon</a> is now available in beta.</p><p>If you want to take a closer look at the library and its design, you can explore it directly on <a href="https://github.com/lucasinglese/oryon">GitHub</a>.</p><p><em>And if you find it useful, consider adding a star. it helps more than it seems.</em></p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"><em><strong>Subscribe to follow the ideas, tools, and production-grade systems shaping modern quantitative trading.</strong></em></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[Build once. Run live.]]></title><description><![CDATA[A unified approach to feature pipelines across research and production]]></description><link>https://www.newsletter.quantreo.com/p/build-once-run-live</link><guid isPermaLink="false">https://www.newsletter.quantreo.com/p/build-once-run-live</guid><dc:creator><![CDATA[Lucas]]></dc:creator><pubDate>Fri, 17 Apr 2026 14:30:51 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/b7fd6461-aa53-4bab-8f06-1e4941f1a2c7_1280x640.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Most pipelines break when they leave research.</p><p>Not because they are incorrect, but because <strong>they were never designed to run incrementally</strong>. They assume full history, they assume recomputation, and they assume a static environment where everything can be rebuilt at each step.</p><p><strong>Live systems operate under very different constraints</strong>. Data arrives sequentially, latency accumulates, and every inefficiency becomes persistent. In that context, the feature pipeline is no longer a preprocessing step. It becomes part of the system itself.</p><div><hr></div><h2>1. A pipeline that works in both worlds</h2><p>With <a href="https://oryonlib.dev">Oryon</a>, the same pipeline object can be <strong>used across both research and production environments</strong> without modification.</p><p>It can be applied on full historical datasets in batch mode, and <strong>it can continue updating in a streaming setting using the exact same logic</strong>. There is no distinction between the two modes, no hidden adaptation layer, and no change in behavior.</p><p>This is not a convenience feature. It is a design constraint. <strong>The pipeline is built to behave identically regardless of how it is fed</strong>.</p><p>To keep the example simple, we can start from one of the sample datasets available directly in Oryon.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;451573a2-eb9a-4c4a-956c-37e14a02c924&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">from oryon.datasets import load_sample_bars

df = load_sample_bars()
historical_bars, live_bars = df.iloc[:-10, :], df.iloc[-10:, :]</code></pre></div><p>For the rest of this example, the idea is straightforward: we use the <strong>historical portion to initialize</strong> and validate the pipeline in research conditions, then we use the last ten bars to simulate a <strong>live stream and observe the updates one step at a time</strong>.</p><div><hr></div><h2>2. Defining a feature pipeline</h2><p>We start by defining a set of features <strong>as a structured pipeline</strong>. Each component is <strong>stateful and designed to update</strong> incrementally.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;aa54d9a4-bcab-451c-ba90-e114ff95d0a3&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">from oryon import FeaturePipeline
from oryon.features import Sma, ParkinsonVolatility, Correlation, ShannonEntropy, Adf


features_list = [
    Sma(inputs=["close"], window=10, outputs=["close_sma_10"]),
    Sma(inputs=["close"], window=50, outputs=["close_sma_50"]),
    ParkinsonVolatility(inputs=["high", "low"], window=20, outputs=["close_pvol_20"]),
    ParkinsonVolatility(inputs=["high", "low"], window=100, outputs=["close_pvol_100"]),
    Correlation(inputs=["close", "volume"], window=30, outputs=["close_volume_corr_30"]),
    ShannonEntropy(inputs=["close"], window=50, outputs=["close_entropy_50"]),
    Adf(inputs=["close"], window=100, outputs=["close_adf_100", "close_adf_pval_100"])
]

pipe = FeaturePipeline(features_list, input_columns=["high", "low", "close", "volume"])</code></pre></div><p>This is not a collection of independent indicators. It is a coherent system that maintains its own internal state and evolves as new data arrives.</p><div><hr></div><h2>3. Applying the pipeline in research</h2><p>Once the pipeline is defined, we can apply it on historical data to inspect the outputs in research conditions.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;58d861fd-5aa9-4bee-a8dd-bab37c742e37&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">from oryon.adapters import run_features_pipeline_pandas
df_features = run_features_pipeline_pandas(pipe, historical_bars)</code></pre></div><p>Under the hood, the pipeline is designed to consume data as a list of lists rather than as a DataFrame directly. This may look slightly less convenient at first, but it comes from the same <strong>architectural choice that makes the system efficient</strong> in live trading: the update path is built around a minimal, streaming-oriented input structure.</p><p>In practice, this means the research interface stays aligned with the production one. Instead of introducing a separate batch-only abstraction, <strong>Oryon keeps the same core design and provides adapters to make research workflows</strong> easier to use.</p><p>That is exactly what <code>run_features_pipeline_pandas</code> does here. It converts the DataFrame into the internal list-of-lists format and applies the pipeline sequentially, so the historical execution remains fully consistent with the live update model.</p><p>The <strong>same idea is also available for Polars</strong>, which makes it easy to keep the same workflow regardless of the dataframe engine used upstream.</p><div><hr></div><h2>4. Switching to streaming</h2><p>Once the historical pass is complete, the same pipeline can continue operating in streaming mode.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;a6a703e7-a8f5-4863-af60-275f9cb3e8d0&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">for bar in live_bars.itertuples():
  input_values = [bar.high, bar.low, bar.close, bar.volume] # pipe needs a list for the inputs
  output = pipe.update(input_values)
  print(output)

# [102.03397795639191, 102.41105040279119, 0.001373007598669601, 0.0018930289783861594, -0.21026851276116704, 0.948176332443655, -1.800248586774662, 0.380344996295653]
# ...
# [102.03397795639194, 102.25925749878635, 0.001373007598669601, 0.0018768715423311845, -0.1494113110563763, 0.8844888723968832, -4.77931213498186, 6.212151160126344e-05]</code></pre></div><div><hr></div><h2>5. Why this matters</h2><p>In most trading systems, the pipeline is effectively implemented twice. Once in research, often using batch-oriented tools, and once again in production, using a different stack optimized for streaming.</p><p><strong>This duplication introduces divergence</strong>. Subtle differences appear, edge cases behave differently, and the system becomes harder to validate as a whole.</p><p><strong>Oryon removes that duplication entirely</strong>. The pipeline is defined once, validated once, and then used as-is in production.</p><p></p><blockquote><p><strong>If you want to take this further and connect feature pipelines with AI agents, you can take a look at <a href="https://www.quantreo.com/ai-trading-lab/">AI Trading Lab</a>.</strong></p></blockquote><p></p><p><a href="https://oryonlib.dev">Oryon</a> is now available in beta.</p><p>If you want to take a closer look at the library and its design, you can explore it directly on <a href="https://github.com/lucasinglese/oryon">GitHub</a>.</p><p>And if you find it useful, consider adding a star. it helps more than it seems.</p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"><em><strong>Subscribe to follow the ideas, tools, and production-grade systems shaping modern quantitative trading.</strong></em></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[From Quantreo to Oryon]]></title><description><![CDATA[Latency does not start at execution. It starts upstream, in the feature pipeline.]]></description><link>https://www.newsletter.quantreo.com/p/from-quantreo-to-oryon</link><guid isPermaLink="false">https://www.newsletter.quantreo.com/p/from-quantreo-to-oryon</guid><dc:creator><![CDATA[Lucas]]></dc:creator><pubDate>Fri, 10 Apr 2026 14:30:48 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/e6499621-e8a4-4c3b-bbf1-7318f7b1ba93_1280x640.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Most trading systems do not lose performance at execution time. They <strong>lose it upstream</strong>, in the way features are computed, updated, and maintained. In research, full recomputation is acceptable. In production, <strong>it becomes a structural inefficiency</strong>.</p><p>Every unnecessary pass over the data, every oversized state, every hidden dependency in the pipeline introduces latency that compounds over time. Not always visible, but always present.</p><p><strong>Oryon was designed to remove that layer entirely</strong>.</p><p>Not by optimizing it. By redefining it.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!TzKp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fd1045-3ab7-434e-91f9-639035964a4f_1280x640.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!TzKp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fd1045-3ab7-434e-91f9-639035964a4f_1280x640.jpeg 424w, https://substackcdn.com/image/fetch/$s_!TzKp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fd1045-3ab7-434e-91f9-639035964a4f_1280x640.jpeg 848w, https://substackcdn.com/image/fetch/$s_!TzKp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fd1045-3ab7-434e-91f9-639035964a4f_1280x640.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!TzKp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fd1045-3ab7-434e-91f9-639035964a4f_1280x640.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!TzKp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fd1045-3ab7-434e-91f9-639035964a4f_1280x640.jpeg" width="1280" height="640" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/06fd1045-3ab7-434e-91f9-639035964a4f_1280x640.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:640,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:61236,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.newsletter.quantreo.com/i/193673294?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abdf4af-d1bf-46ed-96d1-4f9460ac8ca3_1280x640.heic&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!TzKp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fd1045-3ab7-434e-91f9-639035964a4f_1280x640.jpeg 424w, https://substackcdn.com/image/fetch/$s_!TzKp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fd1045-3ab7-434e-91f9-639035964a4f_1280x640.jpeg 848w, https://substackcdn.com/image/fetch/$s_!TzKp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fd1045-3ab7-434e-91f9-639035964a4f_1280x640.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!TzKp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fd1045-3ab7-434e-91f9-639035964a4f_1280x640.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><div><hr></div><h2>1. Rethinking Feature Computation</h2><p>Oryon is the beta 2 of Quantreo, but more importantly, it introduces a different abstraction. Features are no longer batch transformations. They are <strong>stateful, incremental objects</strong>.</p><p>Each update processes only the newest observation, maintains only the strictly required state, and returns the current value immediately.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;a81cbfc0-4163-40ee-b2ec-eb225a84ecfd&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">from oryon.features import Sma

sma = Sma(["close"], window=3, outputs=["sma_3"])

sma.update([100.0])  # &#8594; [nan]
sma.update([101.0])  # &#8594; [nan]
sma.update([102.0])  # &#8594; [101.0]
sma.update([103.0])  # &#8594; [102.0]</code></pre></div><p>The important part is not the indicator itself. A 3-period moving average stores exactly three values. No history, <strong>no recomputation</strong>, <strong>no hidden overhead</strong>.</p><p>This same design extends consistently across the library:</p><ul><li><p>entropy-based features</p></li><li><p>ADF-style statistical tests</p></li><li><p>multiple volatility estimators</p></li><li><p>rolling and dynamic correlations</p></li><li><p>operators, transformations, and scalers</p></li></ul><p>All built around the same constraint:</p><p><strong>&#8594; Compute once, update incrementally, stay minimal in memory.</strong></p><div><hr></div><h2>2. Performance where it actually matters</h2><p>Oryon is built on a Rust-backed core, exposed through a minimal Python interface.</p><p>This is not an implementation detail. It is a design requirement.</p><p>Under production conditions:</p><ul><li><p>fast paths run below <strong>1 microsecond</strong></p></li><li><p>the slowest feature update remains under <strong>19 microseconds</strong></p></li><li><p>a full feature state can be refreshed in <strong>less than 1 millisecond</strong></p></li></ul><p>This is where the difference becomes tangible.</p><p>Not in isolated benchmarks, but in continuous pipelines running live, where every microsecond accumulates.</p><div><hr></div><h2>3. One pipeline, from research to production</h2><p>The <strong>same abstraction is used everywhere</strong>. The same objects.<br>The same update logic. The same behavior. There is <strong>no distinction between a research pipeline and a production pipeline</strong>. No reimplementation, no hidden mismatch, no translation layer.</p><blockquote><p>What you build is what you run. This removes an entire class of errors that typically appears when moving from notebooks to live systems.</p></blockquote><p>And it forces a discipline. Features must be correct, incremental, and production-ready from the start.</p><p>&#8658; <strong>In the next newsletter, we&#8217;ll build a research pipeline that is natively streaming-ready and can be deployed as-is in production.</strong></p><p></p><p><a href="https://oryonlib.dev">Oryon</a> is now available in beta.</p><p>If you want to take a closer look at the library and its design, you can explore it directly on <a href="https://github.com/lucasinglese/oryon">GitHub</a>.</p><p>And if you find it useful, consider adding a star. it helps more than it seems.</p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"><em><strong>Subscribe to follow the ideas, tools, and production-grade systems shaping modern quantitative trading.</strong></em></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[Why intra-bar features matter]]></title><description><![CDATA[How to enrich higher-timeframe bars with lower-timeframe information without changing your full research workflow.]]></description><link>https://www.newsletter.quantreo.com/p/why-intra-bar-features-matter</link><guid isPermaLink="false">https://www.newsletter.quantreo.com/p/why-intra-bar-features-matter</guid><dc:creator><![CDATA[Lucas]]></dc:creator><pubDate>Fri, 03 Apr 2026 14:30:46 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/d5e5cc5a-95f9-4fff-bfd5-c30db31224f0_1536x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When we work with hourly or daily bars, we usually keep only OHLCV.</p><p>But two hourly bars with the same OHLCV can hide very different internal behaviors.</p><p>One may trend smoothly.</p><p>Another may be noisy, mean-reverting, or <strong>highly asymmetric inside the bar</strong>.</p><div class="pullquote"><p>That is exactly where intra-bar features become useful.</p></div><p>Instead of treating each bar as a simple summary, we can rebuild it from a lower timeframe and <strong>compute additional metrics</strong> inside the bar, such as <em><strong>slope</strong></em>, <em><strong>skewness</strong></em>, <em><strong>kurtosis</strong></em>, or other <strong>microstructural statistics</strong>. <a href="https://docs.quantreo.com/data-aggregation/bar-metrics/">Quantreo&#8217;s bar metrics</a> are designed for that workflow through the `<em>additional_metrics</em>` mechanism, which adds custom columns computed from the data inside each bar. </p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Quantreo! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h2>1. The Core Idea</h2><p>The idea is simple.</p><p>If you trade on a higher timeframe, for example 1H, you can use a lower timeframe, for example 1 minute, to reconstruct each hourly bar and compute what happened inside it.</p><p>This gives you extra information that standard OHLCV cannot capture.</p><p>In Quantreo, these bar-level metrics are meant to <strong>enrich traditional bars</strong> with statistical and microstructural information extracted from the data inside each bar. </p><p>The documentation explicitly mentions examples such as <strong>skewness, kurtosis, Hurst exponent, volume-profile-type features, and other custom indicators</strong>. </p><div><hr></div><h2>2. Why This Matters</h2><p>A bar is a compression of information.</p><p>And <strong>sometimes</strong>, that compression removes <strong>exactly the behavior you care about</strong>.</p><p>With intra-bar metrics, you can start distinguishing:</p><p>- smooth vs noisy bars<br>- directional vs unstable bars<br>- balanced vs asymmetric internal price action<br>- ordinary bars vs bars with unusual internal structure</p><blockquote><p><strong>This is often where extra signal can appear</strong>, especially when many strategies rely only on the final OHLCV snapshot.</p></blockquote><div><hr></div><h2>3. Examples Of Useful Intra-Bar Features</h2><p>Some useful examples are:</p><p>- linear slope inside the bar<br>- skewness<br>- kurtosis<br>- volume concentration features<br>- custom metrics derived from price or price-volume distributions</p><p><a href="https://docs.quantreo.com/data-aggregation/bar-metrics/">Quantreo</a> already documents built-in bar metrics such as `<em>skewness</em>`, `<em>kurtosis</em>`, `<em>volume_profile_features</em>`, and `<em>max_traded_volume</em>`, and also allows fully custom metrics through `<em>additional_metrics</em>`. </p><div><hr></div><h2>4. The Practical Workflow</h2><p>A clean workflow looks like this:</p><p>- choose your trading timeframe, for example 1H<br>- take a lower timeframe or raw tick data<br>- rebuild the higher-timeframe bars<br>- compute intra-bar metrics during aggregation<br>- use these new columns as additional features in your research pipeline</p><p>In Quantreo, each metric is attached through an `<em>additional_metrics</em>` <strong>tuple</strong> that specifies the function, the input source (`price`, `volume`, or `price_volume`), and the output column names. </p><div><hr></div><h2>5. Why I Like This Approach</h2><p>I like this approach because it adds information <strong>without forcing you to redesign your whole pipeline</strong>.</p><blockquote><p>You still work with bars.</p><p>You still keep a structured dataframe.</p><p>But your bars become much richer.</p></blockquote><p>So instead of changing the whole strategy framework, <strong>you improve the quality of the representation</strong>.</p><div><hr></div><h2>6. Performance Matters Too</h2><p>This kind of idea is only useful if it remains practical at scale.</p><p>Quantreo recommends using <strong>Numba</strong> for <strong>custom metrics</strong> because bar building can involve <strong>millions of ticks</strong>, and the documentation notes that pure Python or Pandas implementations can be <strong>20x to 100x slower than Numba-compiled functions</strong>. </p><div><hr></div><h2>7. Who This Is For</h2><p>This is especially useful for people who:</p><p>- already use bar-based workflows<br>- want more signal without jumping directly to raw tick models<br>- care about microstructure, but still want a clean research pipeline<br>- want to enrich higher-timeframe features with lower-timeframe behavior</p><p></p><p></p><p>OHLCV is often a good starting point, but it is still a compression.</p><p><strong>And sometimes, alpha lives inside what that compression removes.</strong></p><p>That is why intra-bar features are so interesting.</p><p>They let you keep the simplicity of bar-based research while injecting part of the information hidden inside each bar.</p><p></p><p>&#128073; Want to learn from A to Z how to <strong>build and use intra-bar features in a real quantitative research workflow</strong>? That&#8217;s exactly what the <strong><a href="https://www.quantreo.com/ml4trading-course/">ML4Trading</a></strong> Program is designed for.</p>]]></content:encoded></item><item><title><![CDATA[Why I always try to simplify my alpha formulas]]></title><description><![CDATA[Simpler formulas will miss some cases. But in many situations, that is exactly what makes them more robust.]]></description><link>https://www.newsletter.quantreo.com/p/why-i-always-try-to-simplify-my-alpha</link><guid isPermaLink="false">https://www.newsletter.quantreo.com/p/why-i-always-try-to-simplify-my-alpha</guid><dc:creator><![CDATA[Lucas]]></dc:creator><pubDate>Fri, 27 Mar 2026 15:30:45 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/c07ec044-50b4-4525-bcb5-47f9199247dc_1536x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When I work on an alpha, I almost always try to simplify the formula as much as possible.</p><p>Not because simple models are always better.<br>Not because complexity is useless.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Quantreo! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>But because every unnecessary degree of freedom increases the risk of overfitting.</p><p>In practice, I often prefer very simple structures such as:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;y = \\beta_0 + \\beta_1 x_1 + ... + \\beta_n x_n&quot;,&quot;id&quot;:&quot;WJXJLUBNDO&quot;}" data-component-name="LatexBlockToDOM"></div><p>and sometimes a square or cubic term when it is clearly justified.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;y = \\beta_0 + \\beta_1 x_1 +  \\beta_{1*} x_{1}^2 + ... + \\beta_n x_n&quot;,&quot;id&quot;:&quot;FBCUWSRGIA&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>Of course, the goal is not to destroy the alpha just to end up with a pretty equation.</p><p>The real objective is to find the sweet spot between simplicity and performance.</p><div><hr></div><p><strong>1. Why Simplicity Matters</strong></p><p>A formula that is too flexible can fit noise very easily.</p><p>The more parameters, interactions, nonlinearities, and transformations you add, the easier it becomes to explain the past.</p><p>But explaining the past <strong>is not the same as capturing a repeatable market effect</strong>.</p><p>A simpler formula usually gives you three major benefits:</p><p>- <strong>lower overfitting</strong> risk<br>- easier interpretation<br>- easier <strong>monitoring in live</strong> trading</p><p>And in many cases, that last point matters more than people think.</p><p>If an alpha starts degrading, a simple structure is much easier to diagnose than a black box.<br></p><div><hr></div><h2>2. Simple Does Not Mean Naive</h2><p>This is where many people get the message wrong.</p><p>The goal is <strong>not to force every alpha into a linear model</strong> just because it looks cleaner.<br>The goal is to <strong>remove unnecessary complexity while preserving the core market logic</strong>.</p><p>Sometimes the signal is already captured well by a linear combination (with or without linear expansion).</p><p>And sometimes the real structure is more complex, and <strong>oversimplifying it would simply kill the alpha</strong>.</p><p>So the real question is not: &#8220;Can I make it simple?&#8221;</p><p>It is: &#8220;<strong>How much complexity is truly necessary to preserve the signal?</strong>&#8221;</p><div><hr></div><h2>3. The Types Of Formulas I Prefer</h2><p>In most cases, I start by testing whether the alpha can be expressed through a very compact structure.</p><p>Typically:</p><p>- linear terms<br>- maybe one or two polynomial terms<br>- very limited interactions<br>- very few input variables</p><p>That gives me a model that is <strong>easier to understand</strong>, easier to stress test, and much harder to overfit than a more flexible alternative.</p><p></p><p>Only when this simplification fails do I consider a machine learning model.</p><p>And even then, I usually keep that for situations where:</p><p>- the number of input variables is small<br>- the relationship looks real but not easily compressible into a simple equation<br>- the added complexity is justified by out-of-sample behavior, not just in-sample fit</p><div><hr></div><h2>4. A Case Where Simplification Helps</h2><p>Imagine a signal that depends mostly on:</p><p>- short-term return<br>- recent volatility<br>- distance from a local mean</p><p>A complex model may build a tangled nonlinear response with many interactions.</p><p>But in practice, you may find that something as simple as:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\alpha =  \\beta_0 +  \\beta_1 return + \\beta_2 volatility^2 + \\beta_3*dist^3&quot;,&quot;id&quot;:&quot;THKHNZZFQO&quot;}" data-component-name="LatexBlockToDOM"></div><p>already captures most of the usable signal.</p><p>Will it miss some edge cases? <strong>Yes</strong>.</p><p>But if the simplified version keeps most of the predictive power while being much more stable, that is often the better trade-off.</p><div><hr></div><p>5. A Case Where Simplification Fails</p><p>Now imagine a signal where the effect only appears under a <strong>specific conditional structure</strong>.</p><p>For example:</p><p>- feature A matters <strong>only</strong> when volatility is high<br>- feature B becomes relevant <strong>only</strong> when liquidity is thin<br>- the relationship changes sharply across regimes</p><p>In that case, <strong>forcing everything into one clean linear equation</strong> may remove exactly what makes the alpha work.</p><p>This is where a slightly more flexible model, or even a small machine learning model, can be justified.</p><p><strong>But the key point is that complexity should come from necessity, not from habit.</strong></p><div><hr></div><h2>6. The Real Objective: Find The Sweet Spot</h2><p>This is how I think about it:</p><p>- too simple, and you may t<strong>hrow away real structure</strong><br>- too complex, and you <strong>may fit noise</strong><br>- somewhere in between, there is a level of complexity that <strong>preserves the alpha while keeping it robust</strong></p><p>That is the sweet spot.</p><p>And in my experience, most people start too far on the complex side.</p><div><hr></div><h2>7. A Practical Checklist I Use</h2><p>Before keeping a more complex formula, I usually ask:</p><ul><li><p>Does the extra complexity improve out-of-sample results?</p></li><li><p>Does it survive across periods and regimes?</p></li><li><p>Can I explain why this extra term should exist economically or behaviorally?</p></li><li><p>Can I monitor it properly in live trading?</p></li><li><p>If I simplify it, how much signal do I really lose?</p></li><li><p>If complexity does not clearly earn its place, I usually remove it.</p></li></ul><p></p><p></p><p>A good alpha is not the most sophisticated equation you can write.</p><p>It is a signal that keeps working when reality stops being friendly.</p><p>That is why I usually start with the simplest valid structure I can build, and only add complexity when the data clearly proves it is needed.</p><p></p><p>&#128073; If you want to go <strong>deeper into the strategy design process</strong> and use AI to generate, structure, and refine trading ideas faster, that&#8217;s exactly what <strong><a href="https://www.quantreo.com/ai-trading-lab/">AI Trading Lab</a></strong> is built for.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Quantreo! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Finding Alphas. A solid map of alpha research.]]></title><description><![CDATA[A concise review of what the book does well, where it falls short, and which chapters are worth reading first.]]></description><link>https://www.newsletter.quantreo.com/p/finding-alphas-a-solid-map-of-alpha</link><guid isPermaLink="false">https://www.newsletter.quantreo.com/p/finding-alphas-a-solid-map-of-alpha</guid><dc:creator><![CDATA[Lucas]]></dc:creator><pubDate>Fri, 20 Mar 2026 15:30:58 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/e389dffc-e35f-45c1-9000-fd33f1b0e873_1536x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I recently read <strong>Finding Alphas</strong>, edited by Igor Tulchinsky and contributors from WorldQuant.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GfVI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29b91614-4864-4f69-8c32-fb5cf04640ce_246x380.heic" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GfVI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29b91614-4864-4f69-8c32-fb5cf04640ce_246x380.heic 424w, https://substackcdn.com/image/fetch/$s_!GfVI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29b91614-4864-4f69-8c32-fb5cf04640ce_246x380.heic 848w, https://substackcdn.com/image/fetch/$s_!GfVI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29b91614-4864-4f69-8c32-fb5cf04640ce_246x380.heic 1272w, https://substackcdn.com/image/fetch/$s_!GfVI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29b91614-4864-4f69-8c32-fb5cf04640ce_246x380.heic 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GfVI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29b91614-4864-4f69-8c32-fb5cf04640ce_246x380.heic" width="246" height="380" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/29b91614-4864-4f69-8c32-fb5cf04640ce_246x380.heic&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:380,&quot;width&quot;:246,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:28299,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/heic&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.newsletter.quantreo.com/i/190610639?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29b91614-4864-4f69-8c32-fb5cf04640ce_246x380.heic&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!GfVI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29b91614-4864-4f69-8c32-fb5cf04640ce_246x380.heic 424w, https://substackcdn.com/image/fetch/$s_!GfVI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29b91614-4864-4f69-8c32-fb5cf04640ce_246x380.heic 848w, https://substackcdn.com/image/fetch/$s_!GfVI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29b91614-4864-4f69-8c32-fb5cf04640ce_246x380.heic 1272w, https://substackcdn.com/image/fetch/$s_!GfVI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29b91614-4864-4f69-8c32-fb5cf04640ce_246x380.heic 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This is not a deep technical monograph, and it is not a book that will hand you a ready-to-trade edge. It is better understood as a structured overview of how professional alpha research is framed: idea generation, data selection, backtesting, robustness, turnover, correlation, bias control, risk, and portfolio thinking.</p><p>That is also its main strength. The book gives a broad and practical map of the research process, with many short chapters written from the perspective of practitioners rather than academics. </p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Quantreo! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h2>1. What The Book Does Well</h2><p>Its biggest strength is breadth with structure.</p><p>The book covers the full <strong>alpha research pipeline</strong> rather than obsessing over one narrow topic. The strongest part is clearly the &#8220;<strong>Design and Evaluation</strong>&#8221; section, where the discussion moves through alpha design, data, turnover, correlation, overfitting, biases, robustness, risk factors, drawdowns, and automated search. For someone building research habits, this is much more valuable than yet another book full of isolated signals. </p><p>Another strong point is that the book repeatedly <strong>brings the reader back to the same core reality</strong>: alpha research is not only about finding a signal, but about testing whether it survives costs, bias, crowding, instability, and implementation constraints. That emphasis appears throughout the book, especially in the chapters on turnover, backtest overfitting, controlling biases, robustness, and risk. </p><p>The tone is also pragmatic. The objective is not to impress with theory, but to give a framework for <strong>thinking like a systematic researcher</strong>.</p><p></p><div><hr></div><h2>2. Where The Book Is Weaker</h2><p>The main limitation is also obvious: this is a WorldQuant-style book.</p><p>That makes it useful, but it also gives it a specific lens. You get many high-level principles, many conceptual tools, and many short examples, but <strong>not the level of implementation detail needed</strong> to go from &#8220;good research mindset&#8221; to a fully deployable institutional strategy.</p><p>In other words, the book is strong on framework, weaker on depth.</p><p>It also reads more like a collection of essays than a single tightly argued book. That makes it accessible, but it also means some chapters feel more useful than others, and the overall depth is uneven.</p><p>Finally, if you already have a strong background in robust backtesting, data engineering, portfolio construction, and production constraints, <strong>a fair part of the material will feel familiar</strong>.</p><div><hr></div><h2>3. The Most Useful Chapters</h2><p>If you read only a subset, I would prioritize these:</p><p>- <strong>Chapter 4</strong>, Alpha Design<br>- <strong>Chapter 6</strong>, Data and Alpha Design<br>- <strong>Chapter 7</strong>, Turnover<br>- <strong>Chapter 9</strong>, Backtest. Signal or Overfitting?<br>- <strong>Chapter 10</strong>, Controlling Biases<br>- <strong>Chapter 12</strong>, Techniques for Improving the Robustness of Alphas<br>- <strong>Chapter 14</strong>, Risk and Drawdowns<br>- <strong>Chapter 15</strong>, Alphas from Automated Search</p><p>Together, these chapters capture the real value of the book: not &#8220;a list of alpha ideas,&#8221; but a way of thinking about signal design under real-world constraints. </p><div><hr></div><h2>4. Who Should Read It</h2><p>This book is especially useful for:</p><p>- beginners who want a <strong>structured map</strong> of alpha research<br>- intermediate quants who already test ideas <strong>but need a cleaner framework</strong><br>- researchers who think too much about signals and not enough about <strong>implementation risk</strong></p><p>For very advanced readers, I would see it more as a compact refresher than a game-changing text.</p><div><hr></div><h2>5. Final Take</h2><p>My overall view is simple.</p><p>Finding Alphas is a good professional overview of the alpha research process. Its value is not that it reveals secret signals. Its value is that it helps you think more clearly about how alphas are actually designed, evaluated, stress-tested, and organized inside a systematic research workflow.</p><p>So no, this is not the one book that will teach you how to print money.</p><p>But yes, it is a book that can help you build a much better research mindset. And in quant, that is often more valuable than one extra idea. </p><p>&#128073; If you want to go <strong>deeper into the strategy design process</strong> and use AI to generate, structure, and refine trading ideas faster, that&#8217;s exactly what <strong><a href="https://www.quantreo.com/ai-trading-lab/">AI Trading Lab</a></strong> is built for.</p><p></p>]]></content:encoded></item><item><title><![CDATA[Quantreo 0.2.0. We rebuild of the foundations. ]]></title><description><![CDATA[A major step forward to make the library more robust, more scalable, and closer to production-grade quantitative research standards.]]></description><link>https://www.newsletter.quantreo.com/p/quantreo-020-we-rebuild-of-the-foundations</link><guid isPermaLink="false">https://www.newsletter.quantreo.com/p/quantreo-020-we-rebuild-of-the-foundations</guid><dc:creator><![CDATA[Lucas]]></dc:creator><pubDate>Fri, 13 Mar 2026 15:31:18 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/0a263319-ba6d-4c73-8da6-74d11e756d7a_2406x1518.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Quantreo 0.2.0 Beta is not a simple update. It is a complete rebuild of the foundations behind the library.<br>The goal was clear: create a <strong>stronger base for research</strong>, simplify the creation of new features, <strong>raise engineering standards</strong>, and prepare the project for what comes next.<br>And yes, the project name will also change soon. More on that at the right time.</p><div><hr></div><h2>1. A New Foundation</h2><p>A new version, but more importantly, a new foundation.<br><br>Quantreo 0.2.0 Beta is not about adding a few new features on top of the existing codebase. It is about <strong>rebuilding the foundations properly</strong>, so the project can grow with more structure, more robustness, and a much higher standard of development.<br><br>This release also opens the door to a broader evolution of the project, including a future name change.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Quantreo! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h2>2. Some News</h2><p>Here are three important changes behind this new beta.</p><p>First, the project is <strong>now opening its contributing process</strong>. The goal is not just to make the library public, but to make it <strong>easier to extend</strong>, cleaner to navigate, and stronger as an <strong>open quantitative research project</strong>.</p><p>Second, <strong>a new pipeline</strong> has been introduced to automate and simplify the creation of many features. This makes feature engineering more scalable, more consistent, and much easier to maintain as the library grows.</p><p>Third, the library now includes more tests and more safeguards across the codebase. The objective is clear: push the project toward a much higher level of reliability and engineering quality, with standards inspired by what serious research environments require.</p><p></p><p></p><p>And this is only part of the work.</p><p>Many other improvements and additions are already on the way. Some are focused on usability, others on architecture, reliability, and the long-term direction of the project.</p><p>Quantreo 0.2.0 Beta is not the end of a rebuild. It is the beginning of a much stronger version of the library.</p><p>The new version is not available yet, however, <strong>I will share more about the release date soon.</strong><br><br>&#128073; If you want to go deeper into each step of the strategy building process, with real-life projects, ready-to-use templates, and 1:1 mentoring, that&#8217;s exactly what the <strong><a href="https://www.quantreo.com">Alpha Quant Program</a></strong> is for.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Quantreo! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[The 7 Mistakes I See Every Week (ML)]]></title><description><![CDATA[Most ML failures are not about models. They are about problem framing, uncertainty, and turning a score into a tradable portfolio.]]></description><link>https://www.newsletter.quantreo.com/p/the-7-mistakes-i-see-every-week-ml</link><guid isPermaLink="false">https://www.newsletter.quantreo.com/p/the-7-mistakes-i-see-every-week-ml</guid><dc:creator><![CDATA[Lucas]]></dc:creator><pubDate>Fri, 06 Mar 2026 15:30:53 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/628c8867-8881-483b-bf4c-504f110ccbe4_1536x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Most beginners treat machine learning like a magic button.</p><p>They train a model, get a prediction, and convert it straight into a buy or sell. The backtest looks clean. Then live trading happens, and the edge evaporates.</p><p>Here are the seven mistakes behind most ML misuse in trading, and what experienced quants do instead.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Quantreo! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p><h3>1) Predicting a point instead of modeling uncertainty</h3><p>A single number feels precise. It is usually fragile.</p><p>In markets, what matters is not &#8220;the next return.&#8221; It is the distribution of outcomes given today&#8217;s context.</p><p>If you cannot answer &#8220;how uncertain is this?&#8221; you do not have a signal. You have a guess. (<strong>To go further on this point, you should check conformal forecasting</strong>)</p><div><hr></div><h3>2) Optimizing accuracy instead of optimizing decisions</h3><p><strong>High accuracy can still lose money.</strong></p><p>Why? Because trading is not a classification contest. Costs, slippage, tail losses, and error clustering dominate. A model that is right slightly more often can still be wrong exactly when it hurts.</p><p>What you actually want is a decision rule that survives reality. That means evaluating ML with trading-oriented metrics and stress tests, not just standard ML scores.</p><div><hr></div><h3>3) Thinking &#8220;ML model &#8594; signal&#8221;</h3><p>This shortcut is the biggest conceptual error.</p><p>A model output is not a trade. It is an input to a process.</p><p>A robust pipeline looks like this:<br><strong>Problem &#8594; ML model &#8594; alpha &#8594; position sizing &#8594; strategy rules &#8594; portfolio</strong></p><p>If you skip the middle, you are not trading a model. You are trading noise with confidence.</p><div><hr></div><h3>4) Treating the model as the edge</h3><p>ML does not create an edge out of thin air. It amplifies what you feed it.</p><p>If your data has no stable structure, the model will still fit something. That &#8220;something&#8221; is often a backtest-only pattern.</p><p>In practice, <strong>edge comes from market structure, behavior, flows, constraints, and regimes</strong>. ML helps you measure or express that edge. It does not replace it.</p><div><hr></div><h3>5) Getting the target wrong</h3><p>Most ML blowups start here.</p><p>A fancy architecture cannot fix a target that is unstable, ambiguous, or mismatched to execution.</p><p>Common failures:</p><ul><li><p>horizons that do not match your average holding period</p></li><li><p>labels that are too close to price noise</p></li><li><p>targets that drift as volatility regimes change</p></li></ul><p>A clean target is not &#8220;more ML.&#8221; <strong>It is better research</strong>.</p><div><hr></div><h3>6) Validation that leaks reality</h3><p>Random splits, improper scaling, peeking at the future, tuning on the same regime you test on. <strong>This is the silent killer</strong>.</p><p>In trading, the only validation that matters is forward-looking, regime-aware evaluation.</p><p>If your process does not answer &#8220;<strong>does this survive different market conditions?</strong>&#8221; your performance is a story, not evidence.</p><div><hr></div><h3>7) Ignoring what happens when the model is wrong</h3><p>This is where senior quants spend most of their time.</p><p>The key question is not average performance. It is conditional behavior:</p><ul><li><p>When the model is wrong, how wrong is it?</p></li><li><p>Do errors cluster?</p></li><li><p>Does it fail in specific regimes?</p></li><li><p>What happens to the portfolio in those periods?</p></li></ul><p>A model that is &#8220;good on average&#8221; but collapses in a few scenarios is not robust. It is a hidden tail bet.</p><div><hr></div><h3>The practical takeaway</h3><p>Machine learning is not a trading strategy. It is a tool for conditional estimation under uncertainty.</p><p>If you want to use ML correctly, stop asking: &#8220;What will the market do?&#8221;<br>Start asking: &#8220;Given what I know now, what is the distribution, how reliable is it, and how should my risk respond?&#8221;</p><p><strong>That is the difference between a model that looks smart and a system that survives.</strong></p><p>&#128073; If you want to go deeper, build smarter features, understand signal reliability, and master techniques like <strong>features selection, features engineering, or feature conditioning</strong>, that&#8217;s exactly what we cover in <strong><a href="https://www.quantreo.com/ml4trading-course/">ML4Trading</a></strong>.</p>]]></content:encoded></item><item><title><![CDATA[Kalman Filter in Trading (2/2)]]></title><description><![CDATA[A Volatility-based Position Sizing]]></description><link>https://www.newsletter.quantreo.com/p/kalman-filter-in-trading-22</link><guid isPermaLink="false">https://www.newsletter.quantreo.com/p/kalman-filter-in-trading-22</guid><dc:creator><![CDATA[Lucas]]></dc:creator><pubDate>Fri, 27 Feb 2026 15:30:53 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/27bfdf7f-24fc-44a6-aaa2-04a18ffd80fd_708x369.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the first part of this series, we introduced the Kalman filter from a theoretical perspective and discussed why it is a natural tool for online estimation problems.</p><p>In this second part, we move from theory to practice and show how a Kalman filter can be used in a real trading context. Not to predict returns, but to <strong>control risk dynamically</strong>.</p><p>The goal is simple: estimate volatility online and transform it into a stable, realistic position sizing rule.</p><p>Find all the codes <a href="https://colab.research.google.com/drive/1XcwG_jfYvTaHQovBiFTUgv76ziZKfoy9?usp=sharing">here</a>.</p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.newsletter.quantreo.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Quantreo! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h2>1. What problem are we actually solving?</h2><p>Volatility is not constant. It changes over time, often abruptly, and usually when it matters the most.</p><p>Most traders rely on rolling volatility estimates. These approaches <strong>suffer from two major issues</strong>:</p><ul><li><p>they react too slowly to regime changes,</p></li><li><p>they are extremely noisy at short horizons.</p></li></ul><p>In live trading, what we really need is: an <strong>online</strong> estimate, reasonably <strong>smooth</strong>, but able to <strong>adapt</strong> when market conditions change.</p><p>This is a risk management problem, not a forecasting one.</p><div><hr></div><h2>2. Volatility as a latent variable</h2><p><strong>Volatility is not directly observable</strong>. What we observe are returns, which are highly noisy at the single-period level.</p><p>We therefore model volatility as a latent state variable. More precisely, we work with the <strong>log-variance</strong>:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;x_t&#8203;=log(&#963;_t^2&#8203;)&quot;,&quot;id&quot;:&quot;JDRKSNTVSI&quot;}" data-component-name="LatexBlockToDOM"></div><p>This choice has three advantages:</p><ul><li><p>it enforces positivity,</p></li><li><p>it leads to additive dynamics,</p></li><li><p>it is compatible with a linear Kalman filter.</p></li></ul><div><hr></div><h2>3. From returns to an observable proxy</h2><p>Since volatility cannot be observed directly, we construct a noisy proxy from returns:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;y_t&#8203;=log(r_t^2&#8203;+&#949;)&quot;,&quot;id&quot;:&quot;SZHCKXYRTY&quot;}" data-component-name="LatexBlockToDOM"></div><p>Under a conditional Gaussian assumption, this quantity can be interpreted as a noisy observation of the latent log-variance.</p><p>This is clearly an approximation. However, our objective is not statistical inference, but <strong>stable risk control</strong>, which makes this approach both acceptable and effective in practice.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vfDr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ec107f-2123-4b16-aba7-5c1cca4db5cd_1197x377.heic" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vfDr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ec107f-2123-4b16-aba7-5c1cca4db5cd_1197x377.heic 424w, https://substackcdn.com/image/fetch/$s_!vfDr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ec107f-2123-4b16-aba7-5c1cca4db5cd_1197x377.heic 848w, https://substackcdn.com/image/fetch/$s_!vfDr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ec107f-2123-4b16-aba7-5c1cca4db5cd_1197x377.heic 1272w, https://substackcdn.com/image/fetch/$s_!vfDr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ec107f-2123-4b16-aba7-5c1cca4db5cd_1197x377.heic 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!vfDr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ec107f-2123-4b16-aba7-5c1cca4db5cd_1197x377.heic" width="1197" height="377" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d5ec107f-2123-4b16-aba7-5c1cca4db5cd_1197x377.heic&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:377,&quot;width&quot;:1197,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:54759,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/heic&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.newsletter.quantreo.com/i/187407774?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ec107f-2123-4b16-aba7-5c1cca4db5cd_1197x377.heic&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vfDr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ec107f-2123-4b16-aba7-5c1cca4db5cd_1197x377.heic 424w, https://substackcdn.com/image/fetch/$s_!vfDr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ec107f-2123-4b16-aba7-5c1cca4db5cd_1197x377.heic 848w, https://substackcdn.com/image/fetch/$s_!vfDr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ec107f-2123-4b16-aba7-5c1cca4db5cd_1197x377.heic 1272w, https://substackcdn.com/image/fetch/$s_!vfDr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ec107f-2123-4b16-aba7-5c1cca4db5cd_1197x377.heic 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The visual difference already highlights the benefit of filtering.</p><div><hr></div><h2>4. Kalman filtering the log-variance</h2><p>We model the latent state with a simple random walk:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;x_t=x_{t&#8722;1}+&#951;_t&quot;,&quot;id&quot;:&quot;QZMTIQOXMU&quot;}" data-component-name="LatexBlockToDOM"></div><p>and the observation equation:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;y_t&#8203;=x_t&#8203;+&#1013;_t&#8203;&quot;,&quot;id&quot;:&quot;XLNOBNYGAW&quot;}" data-component-name="LatexBlockToDOM"></div><p>Both noise terms are assumed Gaussian.</p><p>The two key parameters of the filter are:</p><ul><li><p><strong>Q</strong>, which controls how fast volatility is allowed to evolve,</p></li><li><p><strong>R</strong>, which reflects how noisy the observation log&#8289;(rt2) is.</p></li></ul><p>In practice, <strong>R is kept relatively large</strong>, because squared returns are extremely noisy at short horizons.</p><div><hr></div><h2>5. From volatility estimation to position sizing</h2><p>At this stage, we have an online estimate of volatility:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;&#963;^t=\\sqrt{e^{\\hat{x}_t}}&quot;,&quot;id&quot;:&quot;ZXAVBOZTTL&quot;}" data-component-name="LatexBlockToDOM"></div><p>The key idea is to use this estimate to scale exposure such that portfolio risk remains approximately constant over time.</p><p>This leads to the target-volatility sizing rule:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;w_t=\\frac{&#963;_{target}}{\\hat{&#963;_t}}&quot;,&quot;id&quot;:&quot;GAQSKEVCIT&quot;}" data-component-name="LatexBlockToDOM"></div><p>This equation captures the core intuition:</p><ul><li><p>when volatility increases, exposure is reduced,</p></li><li><p>when volatility decreases, exposure is increased.</p></li></ul><p>Importantly, w_t&#8203; is <strong>not a signal</strong>. It does not tell us which direction to trade. It only determines <strong>how much risk to take</strong>.</p><div><hr></div><h2>6. Practical constraints for live trading</h2><p>In real trading systems, several safeguards are required.</p><p>First, a volatility floor prevents excessive leverage when estimated volatility becomes too small.</p><p>Second, exposure is capped to remain within acceptable leverage limits.</p><p>Finally, position weights are smoothed to reduce turnover and transaction costs:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;w_t^{smooth&#8203;} =(1&#8722;&#945;)w_{t&#8722;1&#8203;}+&#945;w_t&#8203;&quot;,&quot;id&quot;:&quot;AIPAIVYORD&quot;}" data-component-name="LatexBlockToDOM"></div><p>This smoothing introduces a small delay, but significantly improves stability in practice.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bV8p!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f53b5bc-55fd-4c7c-8bd6-5bfb362d3016_1197x377.heic" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bV8p!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f53b5bc-55fd-4c7c-8bd6-5bfb362d3016_1197x377.heic 424w, https://substackcdn.com/image/fetch/$s_!bV8p!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f53b5bc-55fd-4c7c-8bd6-5bfb362d3016_1197x377.heic 848w, https://substackcdn.com/image/fetch/$s_!bV8p!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f53b5bc-55fd-4c7c-8bd6-5bfb362d3016_1197x377.heic 1272w, https://substackcdn.com/image/fetch/$s_!bV8p!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f53b5bc-55fd-4c7c-8bd6-5bfb362d3016_1197x377.heic 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!bV8p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f53b5bc-55fd-4c7c-8bd6-5bfb362d3016_1197x377.heic" width="1197" height="377" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4f53b5bc-55fd-4c7c-8bd6-5bfb362d3016_1197x377.heic&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:377,&quot;width&quot;:1197,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:51010,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/heic&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.newsletter.quantreo.com/i/187407774?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f53b5bc-55fd-4c7c-8bd6-5bfb362d3016_1197x377.heic&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!bV8p!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f53b5bc-55fd-4c7c-8bd6-5bfb362d3016_1197x377.heic 424w, https://substackcdn.com/image/fetch/$s_!bV8p!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f53b5bc-55fd-4c7c-8bd6-5bfb362d3016_1197x377.heic 848w, https://substackcdn.com/image/fetch/$s_!bV8p!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f53b5bc-55fd-4c7c-8bd6-5bfb362d3016_1197x377.heic 1272w, https://substackcdn.com/image/fetch/$s_!bV8p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f53b5bc-55fd-4c7c-8bd6-5bfb362d3016_1197x377.heic 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h2>7. What this approach does (and does not)</h2><p>This framework works well because it:</p><ul><li><p>stabilizes portfolio risk,</p></li><li><p>adapts to changing volatility regimes,</p></li><li><p>is simple, robust, and computationally efficient,</p></li><li><p>can be combined with any alpha signal.</p></li></ul><p>However, it is important to be clear about its limitations:</p><ul><li><p>it does not predict returns,</p></li><li><p>it does not perform market timing.</p></li></ul><p>It is a <strong>risk controller</strong>, not an alpha generator.</p><div><hr></div><p>Kalman filters are often presented as complex mathematical tools. In practice, their strength lies in their simplicity and flexibility.</p><p>Used correctly, they provide a clean and effective way to control risk in environments where volatility is unstable and noisy.</p><p>In systematic trading, improving risk control is often more impactful than improving return forecasts.</p><p>&#128073; If you want to go deeper into each step of the strategy building process, with real-life projects, ready-to-use templates, and 1:1 mentoring, that&#8217;s exactly what the <strong><a href="https://www.quantreo.com">Alpha Quant Program</a></strong> is for.</p>]]></content:encoded></item></channel></rss>