<?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[Hunt Gather Trade]]></title><description><![CDATA[This Substack is a refined version of my notes taken while exploring how to be self-sustainable in the markets.]]></description><link>https://newsletter.huntgathertrade.com</link><image><url>https://substackcdn.com/image/fetch/$s_!cMd-!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6c9fff4-8eb5-4173-ab8a-84a15607ce21_1024x1024.png</url><title>Hunt Gather Trade</title><link>https://newsletter.huntgathertrade.com</link></image><generator>Substack</generator><lastBuildDate>Tue, 14 Apr 2026 17:05:55 GMT</lastBuildDate><atom:link href="https://newsletter.huntgathertrade.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Larry Kann]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[huntgathertrade@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[huntgathertrade@substack.com]]></itunes:email><itunes:name><![CDATA[Larry Kann]]></itunes:name></itunes:owner><itunes:author><![CDATA[Larry Kann]]></itunes:author><googleplay:owner><![CDATA[huntgathertrade@substack.com]]></googleplay:owner><googleplay:email><![CDATA[huntgathertrade@substack.com]]></googleplay:email><googleplay:author><![CDATA[Larry Kann]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Hunt Gather Trade is Changing]]></title><description><![CDATA[This isn&#8217;t the first time I&#8217;ve changed things up, but this time is different. Nothing is being left behind. I&#8217;m just widening the scope of the newsletter.]]></description><link>https://newsletter.huntgathertrade.com/p/hunt-gather-trade-is-changing</link><guid isPermaLink="false">https://newsletter.huntgathertrade.com/p/hunt-gather-trade-is-changing</guid><dc:creator><![CDATA[Larry Kann]]></dc:creator><pubDate>Fri, 20 Mar 2026 20:01:27 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!gDGy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c937eab-0358-4509-8e4e-04fd45657ff3_3024x4032.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gDGy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c937eab-0358-4509-8e4e-04fd45657ff3_3024x4032.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gDGy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c937eab-0358-4509-8e4e-04fd45657ff3_3024x4032.jpeg 424w, https://substackcdn.com/image/fetch/$s_!gDGy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c937eab-0358-4509-8e4e-04fd45657ff3_3024x4032.jpeg 848w, https://substackcdn.com/image/fetch/$s_!gDGy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c937eab-0358-4509-8e4e-04fd45657ff3_3024x4032.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!gDGy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c937eab-0358-4509-8e4e-04fd45657ff3_3024x4032.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gDGy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c937eab-0358-4509-8e4e-04fd45657ff3_3024x4032.jpeg" width="1456" height="1941" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9c937eab-0358-4509-8e4e-04fd45657ff3_3024x4032.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1941,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1636468,&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://newsletter.huntgathertrade.com/i/191618653?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c937eab-0358-4509-8e4e-04fd45657ff3_3024x4032.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!gDGy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c937eab-0358-4509-8e4e-04fd45657ff3_3024x4032.jpeg 424w, https://substackcdn.com/image/fetch/$s_!gDGy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c937eab-0358-4509-8e4e-04fd45657ff3_3024x4032.jpeg 848w, https://substackcdn.com/image/fetch/$s_!gDGy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c937eab-0358-4509-8e4e-04fd45657ff3_3024x4032.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!gDGy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c937eab-0358-4509-8e4e-04fd45657ff3_3024x4032.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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><figcaption class="image-caption">Just a photo I took once. Pretty lame, but it isn&#8217;t AI generated and I guess that counts for&#8230; something.</figcaption></figure></div><p>Oh boy, here we go again. Larry is on another kick. Why can&#8217;t he just keep his shit together? Just deliver market trading strategies and research and keep it simple. Stop trying to reinvent the wheel.</p><p>If that&#8217;s what you&#8217;re thinking, I hear you. I really do.</p><p>And I only have this to say in response:</p><p>Fuck off.</p><p>Still here?</p><p>Cool. I like you. Let&#8217;s get into it.</p><p>I started this Substack in late 2023, and my only focus was learning how to become a better day trader. Over the last two years, I learned a lot. We went from using NinjaTrader and improving ATS strategies with better code. I got asked to stop doing that by the ATS creator, and that marked the first shift.</p><p>After that, I wasn&#8217;t really sure what to do. My knowledge in this field was still limited, but I knew one thing: if you&#8217;re going to create or test automated strategies, you need to understand how the coding side actually works. That sent me down a rabbit hole. I picked up some good books by Timothy Masters and started exploring.</p><p>I used the concepts from those books to build a bunch of Python scripts for testing indicators and features. That was fun, but I was still green.</p><p>I started researching different trading platforms. I looked at QuantConnect and the Lean engine. I used TradingView for a while and tested some ideas. Then I found RealTest. This was the first program I really fell in love with. The philosophy behind its development resonated with me. Marsten Parker is a wizard&#8212;programmer and trader. Seriously, he was in <em>Unknown Market Wizards</em> by Jack D. Schwager. But it was the design philosophy of RealTest that really drew me in.</p><p>Why?</p><p>Because details matter.</p><p>That is what separates amateurs from pros. I&#8217;m not claiming to be a pro. Not even close. But I am neurotic, and I crave precision. I&#8217;m not naive enough to think perfection is attainable in the pure sense, but striving to get as close as possible still matters. That&#8217;s how we sharpen ourselves.</p><p>Once I found RealTest, I dove hard into strategy research. I built and dropped a bunch of strategies. I used indicator testing tools to test different features, then pulled them into RealTest to see how they performed in backtests. I was testing equities, futures, and whatever else came to mind.</p><p>That ran strong for months.</p><p>Then, somewhere around the beginning of this year, I hit a wall.</p><p>I started losing sight of what I was doing. Life was kicking my ass, and I fell off for a while. The more I learned about quantitative trading, the more I wanted better tools, and the more I became aware of the disconnect between retail traders and firms. I got jaded. I started questioning what I was doing and, eventually, started disliking it.</p><p>I was still actively day trading futures into the beginning of this year, but then I decided to step away for a while. I&#8217;d been researching systematic and quantitative trading for a good bit and still hadn&#8217;t reached the point where I felt confident enough to run an automated strategy live. I did run one of my RealTest strategies live for a while, but it wasn&#8217;t fully automated and left a lot to be desired. It did well enough, but I turned it off anyway. My heart just wasn&#8217;t in it, and I wasn&#8217;t sure what I wanted to do next.</p><p>That was when I decided I was going to build my own tool for researching trade strategies.</p><p>As much as I love RealTest, it still doesn&#8217;t do everything I want. It&#8217;s proprietary. It has quirks. Marsten is an old-school C programmer, and RealTest is opinionated. Good opinions, mostly. A lot of them I agree with. But it still lacks some of the things I want.</p><p>I spent a good bit of time writing indicators in C that could be used directly in RealTest, and that taught me something: I like low-level languages like C more than I like languages like Python, C#, Go, JavaScript, or Java.</p><p>So I started the quantKit project. Since I wasn&#8217;t proficient in C yet, I decided to build the tool in Python&#8212;but without major dependencies, and with explicit code instead of all the Pythonic shit that makes code look like Arabic to me. I get why Python is the way it is, and I understand I&#8217;m taking the road less traveled, but it made sense to me. Still does.</p><p>During all of this, I stopped writing.</p><p>I haven&#8217;t produced a new strategy since February. That cost me subscribers, and I get it. That&#8217;s why most people are here. They want strategies with good results so they can test them and maybe make some money.</p><p>But that was part of the problem.</p><p>I had become one of those guys posting content that feeds directly into people&#8217;s desire to make more money. Nothing I posted was meant to be used as advice (read the disclaimer) but still. It was my research, and anyone who used it live did so on their own. That disclaimer still stands. But the more I sat with it, the more it bothered me.</p><p>I didn&#8217;t want to be one of those people.</p><p>I wanted to give real knowledge to the community. I wanted to help people actually understand what they were looking at so they could make better decisions. I couldn&#8217;t do that by just posting strategy results and backtests. That became a moral conflict.</p><p>quantKit was supposed to be the answer. It still might be.</p><p>But it is a huge endeavor, and it has taken me (just some dude trying to do this from home while being a full-time stay-at-home dad) a lot longer than I expected. There&#8217;s probably a bias for that. Kahneman wrote about it. I can&#8217;t remember the name right now, but you know the one.</p><p>While all of that was happening, life started fighting back.</p><p><strong>Interlude</strong>: It&#8217;s about to get personal, real, and maybe a little heavy. Skip it if that isn&#8217;t your thing. Sometimes it&#8217;s easier to pretend the people you read online aren&#8217;t actually human.</p><p>Right before March, I had a pipe burst in my basement and flood the place. I had to handle all of that repair myself, except for the pipe itself&#8212;which I now know I probably could have handled too. I had to replace all the flooring in my father&#8217;s studio and deal with all the drying and repair work from the water damage. It sucked up a lot of time and energy.</p><p>Then in March, while I was already trying to find myself, my father almost died. He had cardiac issues that sent him to the ER. During that visit, he had a femoral bleed that almost killed him. After surgery, he came home, then went straight back to the ER in septic shock from the surgery site. That second visit turned into a hospital stay and rehab that lasted for months.</p><p>For context, my father lives with me and my family. When we moved into this house in 2021, he came with us so I could help take care of him. My mother passed many years ago, and he needed to be with someone. Don&#8217;t mistake that for sainthood. I am not particularly close to or fond of my father. There is history. But he is the only parent I have left, and I care enough not to leave him to figure everything out alone.</p><p>That wasn&#8217;t the end of it.</p><p>Aside from the house repairs and my father being in the hospital, my wife was also pregnant with our second child. That&#8217;s a blessing, obviously, but it changes the environment. Our first child is two and requires more attention, more energy, and a lot more patience.</p><p>Then there was me.</p><p>If you&#8217;ve been reading for a while, you know I don&#8217;t have the normal r&#233;sum&#233; for someone writing about trading systems. Before my son was born, I was a paramedic. That was my career for over a decade. Before that, I was in the Army. When I got back from Iraq in 2009, I had more time in a combat zone than I had in garrison. For those who don&#8217;t know what that means, I deployed almost immediately after training and was fast-tracked through the pipeline.</p><p>When I got out of the Army in 2010, I went straight into EMS and didn&#8217;t leave that life until my son was born in 2023. I almost missed his birth because I was in Iraq. I would not have made it back in time if my former Spades partner hadn&#8217;t just been promoted to project manager. Thanks to him, I was able to fly home fast and be there when my son was born. The day after he was born, I called my company and resigned. I wasn&#8217;t going to stay absent from my family.</p><p>That was when I started getting into trading and eventually launched this Substack.</p><p>Why am I telling you all this?</p><p>Because from 2007 to 2023, I worked nonstop in high-adrenaline and eventually high-threat environments. I never really took enough time off to recognize that I had issues I had never addressed. Then I quit. I really quit. I went all in on being a stay-at-home dad and trying to figure out how to work from home.</p><p>Once I slowed down, all the shit from deployment and EMS became impossible to ignore.</p><p>My house breaks. Then my father breaks. And during all of this, I am breaking too.</p><p>I couldn&#8217;t sleep because of nightmares. I found out I also have sleep apnea and needed to deal with that. I started therapy to work through a lot of shit I never worked through before. It was rough.</p><p>I let the Substack slide.</p><p>I couldn&#8217;t concentrate for shit. I didn&#8217;t know who I was. I was still trying to be a parent, a husband, and the stay-at-home spouse. The Substack just didn&#8217;t make the top-priority list.</p><p>On top of all that, I was trying to get a bunch of VA stuff settled and unfuck some bad financial decisions from the past couple of years. Maybe I&#8217;ll talk about that in another post, but for now it isn&#8217;t the point. It felt like every time I handled one thing, two more popped up. All the while, I was going crazy internally.</p><p>To put it bluntly, this year was a whirlwind of fuckery that had me questioning everything. Not just HGT or my own sanity. Everything.</p><p>I started seeing things differently. I started spotting patterns in the things we take for granted. I started thinking harder about profit, capitalism, and how far we&#8217;ve drifted from anything resembling a real free market. I started wondering how much of our current condition is stupidity, and how much of it is malice that finally learned how to wear a tie and speak politely.</p><p>Then I did what I always do.</p><p>I decided to handle more of it myself.</p><p>And weirdly enough, that is what helped me find solid ground again.</p><p>Once I started doing that&#8212;really doing that&#8212;things started clicking.</p><p><strong>And now, back to our regularly scheduled programming.</strong></p><p>That&#8217;s just life, right?</p><p>We&#8217;re all human. We all get tested. I handled this year the best I could, and this Substack absorbed a lot of the cost. So to the readers who made it this far, and to the people who have been here for a while: I&#8217;m sorry. I did not make this a priority. I believe that was the right call, but I also know I owe you an explanation.</p><p>Still, I didn&#8217;t just spiral. I kept learning.</p><p>Because that&#8217;s what we do.</p><p>If we get hit, we learn how to avoid it next time, or we get tougher. Sometimes you can&#8217;t avoid getting punched. But you can train how you respond.</p><p>Through all of this, I kept adapting. I slowly found myself again. I may not be the same shit-hot medic I used to be, but I am still sharp, still detail-oriented, and still driven. I just had to adapt my way of thinking to a different environment and a different life.</p><p>And that is what I want to talk about now.</p><p>This year taught me a lot. The biggest takeaway is this:</p><p>We are being trained to offload our lives.</p><p>Not just in trading. In everything.</p><p>We are conditioned to hand off anything difficult, tedious, or technical to someone else. We are taught that if we want to be good at one thing, we have to sacrifice competence in everything else. We are told it is impossible to be good at multiple things.</p><p>I think that is mostly bullshit.</p><p>Yes, there are some fields where elite specialization is real. If you want to be an Olympic runner, you probably are not also training to be an elite powerlifter. Fine.</p><p>But for most of life? No.</p><p>For most of life, &#8220;specialization&#8221; becomes an excuse for learned helplessness. It gives people permission not to try.</p><p>This year reminded me that I can still learn new shit. It reminded me that there are a lot of things we can become competent at without sacrificing everything else. And when we do, we gain back freedom we didn&#8217;t even realize we&#8217;d lost.</p><p>If we apply just a little more mental bandwidth across more areas of life, we often discover it doesn&#8217;t take much to get good enough at something that we no longer need to outsource it.</p><p>Let me give you a few examples.</p><p><strong>Example 1: The basement flood</strong></p><p>I won&#8217;t get into why the pipe burst, because the reason doesn&#8217;t matter. For the record, it wasn&#8217;t my fault, but the amount of damage that happened from it absolutely was somebody&#8217;s fault. The pipe was going to burst either way.</p><p>The first thing I did when I stepped into a couple inches of water in my basement was run to the breaker and shut off the power. Then I shut off the water at the main line. After that, I had no clue what to do next, so I called a plumber and got someone out to the house immediately.</p><p>They identified the problem (I had already found the leak and exposed the pipe) and fixed it. I watched them the whole time. The crew was cool, down-to-earth, and answered my questions. They repaired the pipe, replaced the fixture, and had a guy call me about water mitigation.</p><p>That guy couldn&#8217;t come out until the next day.</p><p>To me, that sounded like a great way to let my walls, wood, and insulation soak up as much water as possible before anyone did a damn thing. So I handled what I could. I cut the lower part of the sheet-rock, removed insulation that might have gotten wet, vacuumed up the water, assessed the flooring in the studio, and set every fan I had to work drying things out.</p><p>The next day, the mitigation guy told me it would cost five grand for his crew to come in and do exactly what I had already done.</p><p>I told him to kick rocks.</p><p>So I did the rest myself. Walls, floors, bathroom, moisture testing, all of it. It sucked. But I learned a lot. I learned that the previous owners had installed the basement room floor over carpet, so I had to pull that too and deal with the glue.</p><p>The glue. Fuck me. That was the worst part.</p><p>Point is, it became a major project that ate my attention for about two weeks. In the end, it cost me around $1,500, and most of that was LVP. I also found two other problems in the basement bathroom that I&#8217;ll need to address later.</p><p><strong>Example 2: The kitchen</strong></p><p>This one is quicker.</p><p>I like cooking. My favorite job was working in a kitchen. I watch cooking shows. I like a lot of different food. So naturally, I spend a lot of time in my kitchen.</p><p>And here&#8217;s something stupidly obvious that most people still ignore: if you make your own shit, you can save a lot of money and eat better food.</p><p>A pound of fresh fettuccine costs maybe one to two dollars to make, depending on the flour and eggs. A decent dried pasta at the store costs around five dollars, and the more common brands are still two to three. Most of them suck, usually get used all at once, and don&#8217;t store half-open especially well anyway.</p><p>This pattern is everywhere.</p><p>Bread? Dirt cheap if you make it yourself, and not nearly as complicated as people pretend.</p><p>Stock or broth? It&#8217;s made out of shit you were going to throw away anyway. That makes it basically free.</p><p>And once you start noticing it, you can&#8217;t stop. The question becomes: how much can you actually save by becoming an ingredient household?</p><p>The answer: more than you think.</p><p>It takes time, sure. Maybe a little skill. Maybe some love for food and process. But the payoff is bigger than most people realize.</p><p><strong>Example 3: Finances</strong></p><p>Big word. Scary word.</p><p>We hear &#8220;budget this&#8221; and &#8220;finance that&#8221; and &#8220;taxes this,&#8221; and eventually somebody says, &#8220;Just hire a professional.&#8221;</p><p>No.</p><p>Stop it.</p><p>The biggest secret about managing your own finances is basically the same as cooking: it isn&#8217;t hard. It can be tedious. It can be time-consuming if you start with no framework at all. But once you understand it, that&#8217;s it. The principles don&#8217;t change that often. Math definitely doesn&#8217;t.</p><p>At some point this year, it became clear that I had made financial mistakes that needed correcting. That process really started around August. So I decided to get control of it.</p><p>Luckily, I had at least some background in finance and accounting from a degree program. I decided to go full send and built double-entry books for our family finances and my self-employment finances. That forced me to see every detail, build the account structure correctly, and actually plan.</p><p>It took time, but I backfilled all of 2025, and now I know exactly what is going on with our finances. Maintenance is easy now that the hard part is done.</p><p>And it taught me something important:</p><p>I do not need a professional to manage this for me.</p><p>Even taxes become much simpler when your books are right. The IRS rules are publicly available. They are not gripping reading, but they are educational as hell. Once the new year rolls around, I can print a handful of reports and basically have the whole picture ready to go. For anything weird (like unamortized mortgage points or deductible mortgage interest allocations) I can build supporting worksheets and cite the actual IRS or state publications.</p><p>The point is that complete control creates clarity. And clarity creates leverage.</p><p>That means real accounting. Not random tables and sloppy worksheets. Real cost analysis, supported by law, maintained honestly, and handled with the same discipline you&#8217;d expect from a professional.</p><p>Good principles and honesty go a long way here.</p><p><strong>Time to bring it home</strong></p><p>It was a wild year. Crisis, distraction, health issues, family obligations, and everything in between&#8212;all while still being a father, a husband, and trying to stay self-employed so I could keep being a stay-at-home dad.</p><p>And through all of it, I kept wondering what I was actually doing with HGT.</p><p>I haven&#8217;t actively traded since March, and quantKit stalled out. Something stopped feeling right.</p><p>As I got a more intimate understanding of my home, my finances, and the systems that shape everyday life, I realized how much people miss because they have been trained not to look. We&#8217;ve been conditioned to outsource the important stuff. It&#8217;s either &#8220;too hard,&#8221; &#8220;too complicated,&#8221; or &#8220;not worth the time.&#8221;</p><p>Well, I say fuck that.</p><p>A lot of it is not hard. Some of it is time-consuming, yes. But that is often the price of freedom. Freedom from complacency, from consumer dependence, and from blind trust in people whose incentives you haven&#8217;t even examined.</p><p>As a family man, I can&#8217;t think of a better use of my time than understanding the systems my household depends on and making sure they work. That means learning where the points of failure are. It means understanding the tools, the constraints, the costs, and the leverage points. It means reducing the amount of your life that sits at the mercy of somebody else&#8217;s &#8220;expert&#8221; opinion.</p><p>That is why HGT is shifting gears.</p><p>Researching day trading systems has been a great adventure, but I don&#8217;t know when I&#8217;ll actively trade again. Don&#8217;t freak out. I am not walking away from market research. I&#8217;m changing how I approach it.</p><p>quantKit was originally meant to be a research engine for quantitative and systematic traders. The project was always ambitious, highly detailed, and very complex. It will live on, but I&#8217;m pivoting it from a trading backtesting engine into a broader systems-analysis tool that better aligns with what I actually believe about household independence, resilience, and control. I&#8217;ll share more on that in the next post.</p><p>Since I am no longer focused on day trading, and since this year gave me the perspective to get honest about what I actually care about, Hunt Gather Trade is expanding.</p><p>The new focus is building resilient, well-managed households.</p><p>Systematic trading taught me something useful: systems thinking applies to a hell of a lot more than markets. Personal and small-business finance. Accounting. Kitchen management. Home infrastructure. Repair. Networks. Information control. The hidden incentives inside modern convenience. These are the systems we actually live inside whether we acknowledge them or not.</p><p>And these systems contain some of the biggest levers available to a normal family trying to gain control over its time, money, and quality of life.</p><p>So that is where HGT is going.</p><p>I am still going to write about markets, but less from the perspective of day trading and more from the perspective of longer-term investing, capital allocation, and durable wealth building.</p><p>I am going to write about home infrastructure and why understanding your own systems matters.</p><p>I am going to write about the kitchen as a serious household lever, not some side hobby.</p><p>I am going to write about finance, accounting, proprietary systems, dependence disguised as convenience, networking, repair, and whatever else helps people take more control over their own lives.</p><p>Hunt Gather Trade is not going away.</p><p>It is just becoming more honest.</p><p>If that sounds like something you&#8217;re into, stick around.</p><p>The goal is simple:</p><p>Figure out how to become as free, capable, and self-sufficient as possible.</p><p>Stay curious.</p><p>Stay open-minded.</p><p>Stay alert.</p><p>Happy hunting.</p><blockquote><p>This post does not represent any type of advice, financial or otherwise. Its purpose is educational and informational only. Backtest results are based on historical data, not real-time data, and there is no guarantee hypothetical results will continue in the future. Day trading is extremely risky, and I do not suggest running any of these strategies live.</p></blockquote>]]></content:encoded></item><item><title><![CDATA[The Spreadsheet Experiment ]]></title><description><![CDATA[Can you test a strategy in a spreadsheet? Maybe, but it doesn't appear worth it.]]></description><link>https://newsletter.huntgathertrade.com/p/the-spreadsheet-experiment</link><guid isPermaLink="false">https://newsletter.huntgathertrade.com/p/the-spreadsheet-experiment</guid><dc:creator><![CDATA[Larry Kann]]></dc:creator><pubDate>Wed, 22 Oct 2025 13:59:11 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!cMd-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6c9fff4-8eb5-4173-ab8a-84a15607ce21_1024x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Oh, boy. Larry, you are on a losing streak lately. First, you learned about the limits of the Sierra Chart DTC server capabilities (big bummer, really). Now, you got several days into the spreadsheet experiment and are about to call it quits. What happened?</p><p>Well, something predictable happened. Spreadsheets suck for complex tasks. I knew that, you knew that, everyone knew that. But, I wanted to test it. I wanted to KNOW why we don&#8217;t use spreadsheet apps. Besides, you can easily formulate features and trade signals and many of the other things you need when testing a trade idea. So, why can&#8217;t you do everything inside one?</p><p>Simple.</p><p>Spreadsheets aren&#8217;t relational. They are just tables. You can mimic database techniques, and you can mimic programming formulas, but it isn&#8217;t a database or a programming language, and the limits really show when you try and do all the things you can do with Python (or whatever your favorite language is).</p><p>The very first thing I noticed is how slow it is. I loaded a year&#8217;s worth of minute data into the spreadsheet and my computer started crawling. 350k rows of data is too much to handle. I switched to daily data to make it easier on myself. I got indicators calculated, I got signals produced, and then I tried aggregating trades&#8230;</p><p>And that&#8217;s when I quit. It is just unwieldy. Even generating a simple list of trades after calculating signals turned into a nightmare. It looks great in the screenshot:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VyyX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c389eef-3c14-4eab-b933-0d3fbe58ea3d_1868x885.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VyyX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c389eef-3c14-4eab-b933-0d3fbe58ea3d_1868x885.png 424w, https://substackcdn.com/image/fetch/$s_!VyyX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c389eef-3c14-4eab-b933-0d3fbe58ea3d_1868x885.png 848w, https://substackcdn.com/image/fetch/$s_!VyyX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c389eef-3c14-4eab-b933-0d3fbe58ea3d_1868x885.png 1272w, https://substackcdn.com/image/fetch/$s_!VyyX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c389eef-3c14-4eab-b933-0d3fbe58ea3d_1868x885.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VyyX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c389eef-3c14-4eab-b933-0d3fbe58ea3d_1868x885.png" width="1456" height="690" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1c389eef-3c14-4eab-b933-0d3fbe58ea3d_1868x885.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:690,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:281692,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://newsletter.huntgathertrade.com/i/176645704?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c389eef-3c14-4eab-b933-0d3fbe58ea3d_1868x885.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_!VyyX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c389eef-3c14-4eab-b933-0d3fbe58ea3d_1868x885.png 424w, https://substackcdn.com/image/fetch/$s_!VyyX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c389eef-3c14-4eab-b933-0d3fbe58ea3d_1868x885.png 848w, https://substackcdn.com/image/fetch/$s_!VyyX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c389eef-3c14-4eab-b933-0d3fbe58ea3d_1868x885.png 1272w, https://substackcdn.com/image/fetch/$s_!VyyX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c389eef-3c14-4eab-b933-0d3fbe58ea3d_1868x885.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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>Sexy, right? </p><p>BUT, from here, it would literally be easier to export it to CSV and finish in Python. What does that mean?</p><p>The test is over.</p><p>So, another failed experiment. And I was really hoping to release this strategy for subscribers to review. Guess I will just need to get quantKit up and running instead.</p><p>There is something beautiful about this, though. All of this experimenting is learning. I am learning how to visualize data and how to think about handling data. All of this is applicable to how I intend on handling data within quantKit, and it helps me visualize how to actually backtest ideas accurately.</p><p>Before all of this, I just traded like any other trader. I would build visual charts, add a couple indicators/features I used to help target a trade, draw my lines, and trade. What I realize now is that even with a strict &#8220;strategy&#8221;, this is just gambling. The game is in managing risk, and the strategy just helps with that. Just like poker (my favorite is Texas Hold&#8217;em), you can make a living managing risk. But at the end of the day, it&#8217;s gambling.</p><p>I really learned this when I started looking at testing trade ideas with code and math. First, it was difficult to put some of the strategies I had tried into strict criteria, as I couldn&#8217;t articulate why I did something. A good example is putting horizontal lines at support levels based on a aggregated OHLC chart. I didn&#8217;t understand that what I was looking for was liquidity pools and I certainly didn&#8217;t understand how to spot them with code.</p><p>Now, I know better. I understand where to look, I am learning how data actually flows from the market to my computer, I understand how people can build an edge just by taking advantage of location (whether physical co-location or outside the kernel), and I understand that what most traders do (even the ones who are building algorithmic systems) is gambling.</p><p>Anyway, this wasn&#8217;t meant to be a philosophical piece, so I am going to stop here. You get the point.</p><p>If you didn&#8217;t, here it is:</p><p>Spreadsheets aren&#8217;t good for this kind of work. I wasted more time testing another idea when I could have been coding quantKit. </p><p>They did teach me a valuable lesson: don&#8217;t force tools to do what they weren&#8217;t built for. quantKit exists (or will exist?) because research deserves real structure, not a grid pretending to be a database.</p><p>Happy hunting.</p><p></p>]]></content:encoded></item><item><title><![CDATA[Getting Wild with 800 Lines (of Code)]]></title><description><![CDATA[Taking flat data files (binary and text, courtesy of Sierra Chart) and building continuous futures contracts to export to CSV.]]></description><link>https://newsletter.huntgathertrade.com/p/getting-wild-with-800-lines-of-code</link><guid isPermaLink="false">https://newsletter.huntgathertrade.com/p/getting-wild-with-800-lines-of-code</guid><dc:creator><![CDATA[Larry Kann]]></dc:creator><pubDate>Wed, 08 Oct 2025 15:22:15 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!cMd-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6c9fff4-8eb5-4173-ab8a-84a15607ce21_1024x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I may have botched the last tutorial, but that&#8217;s ok, because this one goes above and beyond. What started as a simple idea turned into an entire set of functions that are going to help us handle data files in quantKit. Am I few days late getting it published? Yep. Is there a reason? Yep.</p><p>&#8230;</p><p>Oh, you want me to excuse my tardiness.</p><p>Some of the shit I decided to do was harder than anticipated. Harder? Maybe that&#8217;s not the best term. It was more confusing than I anticipated. That doesn&#8217;t really do it justice either.</p><p>Look, futures contracts are fucking weird. It makes sense once you figure it out, but building continuous contracts stumped me for a while. I also realized that I was using some comparison logic that I wouldn&#8217;t be able to use when converting this to a low-level language (I will explain in the code breakdown), so I had to spend some time refactoring those comparisons.</p><p>So, yeah. Basically, I just suck. It is what it is. I&#8217;ve got it locked in now, and I should be able to plug and play any different type of back adjustment or rollover logic I want.</p><p>Let&#8217;s not waste to much time here. There is a lot to get into, so let&#8217;s do it.</p><p>Code can be found here:</p><p><a href="https://github.com/larrykann/python_tutorials">GitHub</a></p><h2>BLUF</h2><p>There is over 800 lines of code in this tutorial. It doesn&#8217;t use anything outside of the standard library and Numpy. It does import Plotly, but that was just to test that my charts mimiced the charts Sierra Chart built. I built a continuous-futures contract builder that exactly matches Sierra Chart using only raw integers internally, then export a clean, human-readable CSV.</p><ul><li><p>Load Sierra Chart static files (SCID ticks, DLY daily)</p></li><li><p>Resample ticks to 1-minute bars</p></li><li><p>Compute volume-based roll dates (YYYYMMDD ints)</p></li><li><p>Back-adjust using daily settlements</p></li><li><p>Stitch contracts into a continuous series</p></li><li><p>Keep time raw: intraday = UTC microseconds; daily = YYYYMMDD</p></li><li><p>Filter by start/end using integer comparisons</p></li><li><p>Convert to local time only for export/plots</p></li><li><p>Export final minute series to data/SC_MES_Minute.csv</p></li></ul><h2>Code</h2><p>I am going to go through this section by section or function by function at points. There is a lot to unpack.</p><h3>Imports</h3><p>These are the imports needed for this project. Most of them are standard library import. Numpy is what we use to manage the data (no Pandas) and Plotly is just there for a test.</p><pre><code><code>import os
import numpy as np
from datetime import datetime, timedelta, timezone
from zoneinfo import ZoneInfo
import plotly.graph_objects as go # &lt;- Only needed to test</code></code></pre><h3>Constants</h3><p>There are a lot of constants to define for this project, most of them are structs (look it up) that we need to format our data correctly or read Sierra Chart&#8217;s data. Sierra Chart stores it&#8217;s intraday data in binary formats, and I like this, so we also define our data structs in a similar way. We also need some time and month-code constants defined to help us later.</p><pre><code><code># SCID binary formats
HEADER_DTYPE = np.dtype(
    [
        (&#8221;FileTypeUniqueHeaderID&#8221;, &#8220;S4&#8221;),
        (&#8221;HeaderSize&#8221;, &#8220;&lt;u4&#8221;),
        (&#8221;RecordSize&#8221;, &#8220;&lt;u4&#8221;),
        (&#8221;Version&#8221;, &#8220;&lt;u2&#8221;),
        (&#8221;Unused1&#8221;, &#8220;&lt;u2&#8221;),
        (&#8221;UTCStartIndex&#8221;, &#8220;&lt;u4&#8221;),
        (&#8221;Reserve&#8221;, &#8220;S36&#8221;),
    ]
)

RECORD_DTYPE = np.dtype(
    [
        (&#8221;DateTime&#8221;, &#8220;&lt;i8&#8221;),
        (&#8221;Open&#8221;, &#8220;&lt;f4&#8221;),
        (&#8221;High&#8221;, &#8220;&lt;f4&#8221;),
        (&#8221;Low&#8221;, &#8220;&lt;f4&#8221;),
        (&#8221;Close&#8221;, &#8220;&lt;f4&#8221;),
        (&#8221;NumTrades&#8221;, &#8220;&lt;u4&#8221;),
        (&#8221;TotalVolume&#8221;, &#8220;&lt;u4&#8221;),
        (&#8221;BidVolume&#8221;, &#8220;&lt;u4&#8221;),
        (&#8221;AskVolume&#8221;, &#8220;&lt;u4&#8221;),
    ]
)

# Our tick struct/format
TICK_DTYPE = np.dtype(
    [
        # raw microseconds since 1899-12-30 (Sierra Chart epoch)
        (&#8221;TimeStamp&#8221;, &#8220;&lt;i8&#8221;),
        (&#8221;Price&#8221;, &#8220;&lt;f8&#8221;),  # trade price
        (&#8221;Volume&#8221;, &#8220;&lt;f8&#8221;),  # trade volume
        (&#8221;Bid&#8221;, &#8220;&lt;f8&#8221;),  # bid at time of trade
        (&#8221;Ask&#8221;, &#8220;&lt;f8&#8221;),  # ask at time of trade
    ]
)

OHLCV_DTYPE = np.dtype(
    [
        (&#8221;TimeStamp&#8221;, &#8220;&lt;i8&#8221;),  # start of bar, raw micros since 1899-12-30 (SC_EPOCH)
        (&#8221;Open&#8221;, &#8220;&lt;f8&#8221;),
        (&#8221;High&#8221;, &#8220;&lt;f8&#8221;),
        (&#8221;Low&#8221;, &#8220;&lt;f8&#8221;),
        (&#8221;Close&#8221;, &#8220;&lt;f8&#8221;),
        (&#8221;Volume&#8221;, &#8220;&lt;f8&#8221;),
    ]
)

DAILY_DTYPE = np.dtype(
    [
        (&#8221;Date&#8221;, &#8220;&lt;i8&#8221;),  # YYYYMMDD
        (&#8221;Open&#8221;, &#8220;&lt;f8&#8221;),
        (&#8221;High&#8221;, &#8220;&lt;f8&#8221;),
        (&#8221;Low&#8221;, &#8220;&lt;f8&#8221;),
        (&#8221;Close&#8221;, &#8220;&lt;f8&#8221;),
        (&#8221;Volume&#8221;, &#8220;&lt;i8&#8221;),
        (&#8221;OpenInterest&#8221;, &#8220;&lt;i8&#8221;),
        (&#8221;BidVolume&#8221;, &#8220;&lt;i8&#8221;),
        (&#8221;AskVolume&#8221;, &#8220;&lt;i8&#8221;),
    ]
)

# === Time Constants ===

# Sierra Chart epoch (NOT Unix epoch).
# All SCID .scid files store timestamps as 64-bit integers
# representing microseconds since 1899-12-30 00:00:00.
# This matches legacy Excel/Windows serial-date conventions
# and allows handling of historical equities that predate 1970.
SC_EPOCH = datetime(1899, 12, 30)

# Microsecond unit for consistency in conversions
SC_MICROS = np.timedelta64(1, &#8220;us&#8221;)

# CME month codes
MONTH_CODES = {
    &#8220;F&#8221;: 1,
    &#8220;G&#8221;: 2,
    &#8220;H&#8221;: 3,
    &#8220;J&#8221;: 4,
    &#8220;K&#8221;: 5,
    &#8220;M&#8221;: 6,
    &#8220;N&#8221;: 7,
    &#8220;Q&#8221;: 8,
    &#8220;U&#8221;: 9,
    &#8220;V&#8221;: 10,
    &#8220;X&#8221;: 11,
    &#8220;Z&#8221;: 12,
}

START_DATE = &#8220;2024-06-01&#8221;
END_DATE = &#8220;2025-09-01&#8221;

PATH_DIR = r&#8221;C:\SierraChart\Data&#8221;</code></code></pre><h3>Helpers</h3><p>Anything that I used more than once (or plan to use more than once in the future) became it&#8217;s own helper function. Some of these aren&#8217;t used in this complete project. They were helpers I used earlier on, but as I refactored the project, I didn&#8217;t need them anymore. I left them in there just in case we might need them again in the future.</p><blockquote><p><strong>Roll boundary note.</strong> To stitch intraday futures you can&#8217;t cut at calendar midnight. CME sessions run 17:00&#8211;16:00 <strong>Central Time</strong>, so a roll date actually flips at <strong>17:00 CT on the prior local day</strong>. In this tutorial I approximate that by converting the roll date in UTC and shifting by a fixed 7 hours. This helper is <strong>not timezone/DST aware</strong>, so the seam is early by 5&#8211;6 hours versus CME&#8217;s exact 22:00/23:00 UTC boundary. It&#8217;s good enough here because both legs are cut at the same point and back-adjustment uses daily settlements, so prices line up and the chart matches visually. For a precise implementation later, I&#8217;ll convert &#8220;(roll_date &#8722; 1) 17:00 America/Chicago &#8594; UTC&#8221; with DST handling.</p></blockquote><pre><code><code>def micros_to_dt64(us):
    return SC_EPOCH.astype(&#8221;datetime64[us]&#8221;) + (us.astype(&#8221;&lt;i8&#8221;) * SC_MICROS)


def utc_to_local(us: int) -&gt; datetime:
    &#8220;&#8221;&#8220;
    Convert UTC microseconds since Epoch
    into the local time (system timezone) as Python datetime.
    &#8220;&#8221;&#8220;
    # UTC base time
    dt_utc = datetime(1899, 12, 30, tzinfo=ZoneInfo(&#8221;UTC&#8221;)) \
             + timedelta(microseconds=int(us))

    return dt_utc.astimezone()


def yyyymmdd_to_dt64(val: int) -&gt; np.datetime64:
    s = str(val)
    return np.datetime64(f&#8221;{s[:4]}-{s[4:6]}-{s[6:]}&#8221;)


def yyyymmdd_to_micros_roll_boundary(date_int: int) -&gt; int:
    &#8220;&#8221;&#8220;
    Convert YYYYMMDD integer to UTC microseconds since Sierra epoch (1899-12-30),
    adjusted to 17:00 UTC of the *previous* day (CME rollover boundary).
    &#8220;&#8221;&#8220;
    # Parse YYYYMMDD to datetime (UTC midnight of that date)
    year = date_int // 10000
    month = (date_int // 100) % 100
    day = date_int % 100
    midnight = datetime(year, month, day)

    # Subtract 7 hours &#8594; previous day 17:00 UTC
    roll_time = midnight - timedelta(hours=7)

    # Return microseconds since Sierra epoch
    return int((roll_time - SC_EPOCH).total_seconds() * 1_000_000)


def parse_contract_code(sym: str) -&gt; int:
    &#8220;&#8221;&#8220;
    Parse a futures contract code into YYYYMM integer.
    Handles any root length, just looks at the last 3 chars.

    Example:
        &gt;&gt;&gt; parse_contract_code(&#8221;MESH24&#8221;)
        202403
        &gt;&gt;&gt; parse_contract_code(&#8221;ESU24&#8221;)
        202409
    &#8220;&#8221;&#8220;
    code = sym[-3:]  # last three characters: month + 2-digit year
    mon = code[0]
    yy = int(code[1:])

    if mon not in MONTH_CODES:
        raise ValueError(f&#8221;Unknown month code: {mon} in {sym}&#8221;)

    year = 2000 + yy  # always assume 2000s for now
    month = MONTH_CODES[mon]

    return year * 100 + month


def get_settlement(contract: np.ndarray, roll_date: int) -&gt; float:
    &#8220;&#8221;&#8220;Return the settlement (close) on the last bar before roll_date.&#8221;&#8220;&#8221;
    # Convert entire column of YYYYMMDD ints into datetime64[D]
    dates = contract[&#8221;Date&#8221;]
    idx = np.searchsorted(dates, roll_date) - 1
    if idx &lt; 0:
        raise ValueError(&#8221;No settlement found before roll date.&#8221;)
    return contract[&#8221;Close&#8221;][idx]


def shift_contract(arr: np.ndarray, adj: float):
    &#8220;&#8221;&#8220;Shift OHLC values of a contract by adj (in-place).&#8221;&#8220;&#8221;
    arr[&#8221;Open&#8221;] += adj
    arr[&#8221;High&#8221;] += adj
    arr[&#8221;Low&#8221;] += adj
    arr[&#8221;Close&#8221;] += adj</code></code></pre><h3>Getting contracts</h3><p>These two functions are how we get the contracts we need for our continuous contracts. They go to a specified directory and return our requested date range contracts by using some of the constants we defined earlier to help. You will see that the <code>discover_contracts</code> function just returns all the contracts with the correct name in the directory and the <code>contracts_in_range</code> function actually returns the correct contracts that we want for our specific request.</p><pre><code><code>def discover_contracts(data_dir: str, root: str):
    &#8220;&#8221;&#8220;
    Find unique contracts for a given root symbol in a directory.

    Scans all filenames starting with the root (e.g. &#8220;MES&#8221;) and extracts
    contract codes (month+year). Returns sorted unique records.

    Args:
        data_dir (str): Directory containing contract data files.
        root (str): Futures root symbol (e.g. &#8220;MES&#8221;, &#8220;ES&#8221;, &#8220;CL&#8221;).

    Returns:
        list[tuple[int, int, str]]: Sorted unique contracts as (year, month, symbol).

    Example:
        &gt;&gt;&gt; discover_contracts(&#8221;/data&#8221;, &#8220;MES&#8221;)
        [(2024, 6, &#8220;MESM24&#8221;), (2024, 9, &#8220;MESU24&#8221;)]
    &#8220;&#8221;&#8220;
    root = root.upper()
    seen = set()
    out = []

    for fn in os.listdir(data_dir):
        name = fn.upper()
        if not name.startswith(root):
            continue

        # Extract 3-char contract code (e.g. &#8216;M24&#8217;)
        code = name[len(root): len(root) + 3]
        if len(code) != 3:
            continue

        mon = code[0]
        yy = code[1:]

        # Validate month code and year digits
        if mon not in MONTH_CODES:
            continue
        if not yy.isdigit():
            continue

        sym = f&#8221;{root}{mon}{yy}&#8221;
        if sym in seen:
            continue
        seen.add(sym)

        # Expand YY into YYYY (assume &lt;70 =&gt; 2000s, else 1900s)
        year = 2000 + int(yy) if int(yy) &lt; 70 else 1900 + int(yy)
        month = MONTH_CODES[mon]

        out.append((year, month, sym))

    # Explicit insertion sort by (year, month)
    for i in range(1, len(out)):
        key_item = out[i]
        j = i - 1
        while j &gt;= 0 and (
            out[j][0] &gt; key_item[0]
            or (out[j][0] == key_item[0] and out[j][1] &gt; key_item[1])
        ):
            out[j + 1] = out[j]
            j -= 1
        out[j + 1] = key_item

    return out


def contracts_in_range(data_dir: str, root: str, start: str, end: str):
    &#8220;&#8221;&#8220;
    Slice contracts for a given root symbol within a date range.

    Uses discover_contracts() to build the full contract list, then
    returns only those covering [start, end], including the immediately
    prior contract for rollover/back-adjust purposes.

    Args:
        data_dir (str): Directory containing contract data files.
        root (str): Futures root symbol (e.g. &#8220;MES&#8221;, &#8220;ES&#8221;, &#8220;CL&#8221;).
        start (str): Start date as &#8216;YYYY-MM-DD&#8217;.
        end (str): End date as &#8216;YYYY-MM-DD&#8217;.

    Returns:
        list[str]: Contract symbols covering the date range.

    Example:
        &gt;&gt;&gt; contracts_in_range(&#8221;/data&#8221;, &#8220;MES&#8221;, &#8220;2024-06-01&#8221;, &#8220;2024-12-01&#8221;)
        [&#8217;MESM24&#8217;, &#8216;MESU24&#8217;, &#8216;MESZ24&#8217;]
    &#8220;&#8221;&#8220;
    syms = discover_contracts(data_dir, root)
    if not syms:
        return []

    # Convert start to (year, month)
    dt_month = np.datetime64(start, &#8220;M&#8221;)
    dt_obj = dt_month.astype(object)
    s_y = dt_obj.year
    s_m = dt_obj.month

    # Convert end to (year, month)
    dt_month = np.datetime64(end, &#8220;M&#8221;)
    dt_obj = dt_month.astype(object)
    e_y = dt_obj.year
    e_m = dt_obj.month

    # Find first contract &gt;= start
    start_idx = len(syms) - 1
    for i, (y, m, _) in enumerate(syms):
        if (y, m) &gt;= (s_y, s_m):
            start_idx = i
            break
    if start_idx &gt; 0:
        start_idx -= 1  # include prior

    # Find last contract &lt;= end
    end_idx = start_idx
    for i, (y, m, _) in enumerate(syms):
        if (y, m) &lt;= (e_y, e_m):
            end_idx = i

    if end_idx &lt; len(syms) - 1:
        end_idx += 1

    # Collect results
    out = []
    for i in range(start_idx, end_idx + 1):
        _, _, sym = syms[i]
        out.append(sym)

    return out</code></code></pre><h3>Load daily data</h3><p>Two functions to get daily data files. Sierra Chart saves these files as basic text files (.dly). These two functions use the contracts list generated by the previous functions to actually load each contract and its data into memory for us to use. We use our <code>DAILY_DTYPE</code> struct to structure the data.</p><pre><code><code>def load_daily_data(path: str) -&gt; np.ndarray:
    &#8220;&#8221;&#8220;
    Load entire daily data file into structured array.

    Args:
        path (str): Path to .dly file (CSV-like SierraChart daily file).

    Returns:
        np.ndarray: Daily records with dtype=DAILY_DTYPE
    &#8220;&#8221;&#8220;
    # Read raw text
    with open(path, &#8220;r&#8221;) as f:
        lines = f.readlines()

    # Drop header (first line)
    lines = lines[1:]

    out = np.empty(len(lines), dtype=DAILY_DTYPE)

    price_mult = 100.0  # for ES/MES; TODO: detect per-symbol later

    for i, line in enumerate(lines):
        parts = line.strip().split(&#8221;,&#8221;)

        # Parse YYYY/MM/DD &#8594; YYYYMMDD integer
        date_str = parts[0].strip()
        year, month, day = date_str.split(&#8221;/&#8221;)
        date_int = int(year + month + day)

        out[i][&#8221;Date&#8221;] = date_int
        out[i][&#8221;Open&#8221;] = float(parts[1]) / price_mult
        out[i][&#8221;High&#8221;] = float(parts[2]) / price_mult
        out[i][&#8221;Low&#8221;] = float(parts[3]) / price_mult
        out[i][&#8221;Close&#8221;] = float(parts[4]) / price_mult
        out[i][&#8221;Volume&#8221;] = int(float(parts[5]))
        out[i][&#8221;OpenInterest&#8221;] = int(float(parts[6]))

        # Some Sierra files may not have bid/ask columns &#8594; guard it
        if len(parts) &gt; 7:
            out[i][&#8221;BidVolume&#8221;] = int(float(parts[7]))
            out[i][&#8221;AskVolume&#8221;] = int(float(parts[8]))
        else:
            out[i][&#8221;BidVolume&#8221;] = 0
            out[i][&#8221;AskVolume&#8221;] = 0

    return out


def load_daily_contracts(data_dir: str, contracts: list[str]) -&gt; dict[str, np.ndarray]:
    &#8220;&#8221;&#8220;
    Load full daily data for multiple contracts.

    Args:
        data_dir (str): Directory with daily files.
        contracts (list[str]): List of contract codes (e.g. [&#8217;MESU24&#8217;, &#8216;MESZ24&#8217;]).

    Returns:
        dict[str, np.ndarray]: Mapping {contract -&gt; daily data array}
    &#8220;&#8221;&#8220;
    results = {}

    for sym in contracts:
        path = os.path.join(data_dir, f&#8221;{sym}_FUT_CME.dly&#8221;)

        if not os.path.exists(path):
            print(f&#8221;Warning: no daily file for {sym}&#8221;)
            continue

        data = load_daily_data(path)

        results[sym] = data

    return results</code></code></pre><h3>Load intraday data</h3><p>Similar to the previous functions, this set gets us our intraday data. Sierra Chart stores these as flat binary files and they don&#8217;t have a different data type for ticks versus OHLCV data. So, you have to read the docs to figure a few things out. Well, I had to read the docs. You don&#8217;t have to, you can just read my code instead. Anyway, this takes their <code>.scid</code> files and normalizes it into a tick array we defined.</p><pre><code><code>def load_scid_ticks(path):
    &#8220;&#8221;&#8220;
    Load Sierra Chart .scid file into a normalized tick array.

    Args:
        path (str): path to .scid file

    Returns:
        np.ndarray with dtype=TICK_DTYPE
    &#8220;&#8221;&#8220;
    offset = HEADER_DTYPE.itemsize
    filesize = os.path.getsize(path)
    n_records = (filesize - offset) // RECORD_DTYPE.itemsize
    if n_records &lt;= 0:
        return np.empty(0, dtype=TICK_DTYPE)

    # Memory-map the SCID records into a NumPy array.
    #
    # This uses np.memmap to efficiently treat the binary file as an array
    # without reading the entire file into RAM. It&#8217;s the Python equivalent of
    # using mmap() or fread() with a struct in C/Zig.
    mm = np.memmap(
        path, dtype=RECORD_DTYPE, mode=&#8221;r&#8221;, offset=offset, shape=(n_records,)
    )

    price_mult = 100.0  # ES/MES uses 100 multiplier TODO: autodetect this in the future

    # Convert to normalized tick array
    out = np.empty(n_records, dtype=TICK_DTYPE)
    out[&#8221;TimeStamp&#8221;] = mm[&#8221;DateTime&#8221;].astype(&#8221;&lt;i8&#8221;)
    out[&#8221;Price&#8221;] = mm[&#8221;Close&#8221;].astype(np.float64) / price_mult
    out[&#8221;Volume&#8221;] = mm[&#8221;TotalVolume&#8221;].astype(np.int64)
    out[&#8221;Bid&#8221;] = mm[&#8221;Low&#8221;].astype(np.float64) / price_mult
    out[&#8221;Ask&#8221;] = mm[&#8221;High&#8221;].astype(np.float64) / price_mult

    return out


def load_scid_contracts(data_dir: str, contracts: list[str]):
    &#8220;&#8221;&#8220;
    Load multiple .scid contracts into tick arrays.

    Args:
        data_dir (str): Directory containing SCID files.
        contracts (list[str]): Contract symbols (e.g. [&#8217;MESM24&#8217;, &#8216;MESU24&#8217;]).

    Returns:
        dict[str, np.ndarray]: Mapping contract -&gt; tick array.
    &#8220;&#8221;&#8220;
    results = {}

    for sym in contracts:
        # Build file path (Sierra uses suffix like &#8216;_FUT_CME.scid&#8217;)
        path = os.path.join(data_dir, f&#8221;{sym}_FUT_CME.scid&#8221;)

        if not os.path.exists(path):
            print(f&#8221;Warning: {path} not found, skipping&#8221;)
            continue
        ticks = load_scid_ticks(path)
        if len(ticks) &gt; 0:
            results[sym] = ticks

    return results</code></code></pre><h3>Resample ticks</h3><p>This function resamples ticks into minute bars. It doesn&#8217;t really care about anything other than the timestamps and aggregating them into OHLCV bars for us. It doesn&#8217;t care about timezones or anything like that, so it isn&#8217;t effected by the time issues I mentioned earlier in our helpers section.</p><pre><code><code>def resample_to_bars(ticks: np.ndarray, minutes: int = 1) -&gt; np.ndarray:
    &#8220;&#8221;&#8220;
    Convert raw tick data into N-minute OHLCV bars.

    Args:
        ticks (np.ndarray): Tick array with fields (TimeStamp, Price, Volume, ...)
        minutes (int): bar length in minutes (default = 1).
            Examples:
                1 -&gt; 1-minute bars
                5 -&gt; 5-minute bars
                240 -&gt; 4-hour bars

    Returns:
        np.ndarray: OHLCV bars with dtype=OHCLV_DTYPE
    &#8220;&#8221;&#8220;
    if ticks.size == 0:
        return np.empty(0, dtype=OHLCV_DTYPE)

    # Floor tick timestampes to start of their minute
    micros_per_bar = minutes * 60 * 1_000_000
    bar_bins = (ticks[&#8221;TimeStamp&#8221;] // micros_per_bar) * micros_per_bar

    bars = []
    current_bar = bar_bins[0]

    # Init OHLCV from first tick
    o = h = l = c = ticks[&#8221;Price&#8221;][0]
    v = ticks[&#8221;Volume&#8221;][0]

    for i in range(1, ticks.size):
        ts = ticks[&#8221;TimeStamp&#8221;][i]
        price = ticks[&#8221;Price&#8221;][i]
        vol = ticks[&#8221;Volume&#8221;][i]
        bar = bar_bins[i]

        if bar == current_bar:
            # Still inside this bar
            if price &gt; h:
                h = price
            if price &lt; l:
                l = price
            c = price
            v += vol
        else:
            # close previous bar
            bars.append((current_bar, o, h, l, c, v))
            # start new bar
            current_bar = bar
            o = h = l = c = price
            v = vol

    # Store last bar
    bars.append((current_bar, o, h, l, c, v))

    return np.array(bars, dtype=OHLCV_DTYPE)</code></code></pre><h3>Volume-based rollover</h3><p>This is where shit got fun. Sierra Chart uses daily data files to determine rollovers. It makes sense. It is a much smaller file and relatively trivial to use. I will do something similar in quantKit. This particular rollover calculation just compares daily volume in contracts and returns a list of rollover dates from contract to contract. It rolls over when volume of the oncoming contract exceeds the daily volume of the current contract. Simple.</p><pre><code><code>def volume_based_rollover(
    contracts: list[str], daily_data: dict[str, np.ndarray]
) -&gt; list[dict]:
    &#8220;&#8221;&#8220;
    Determine rollover dates using Sierra-style volume-based rollover.

    Args:
        contracts (list[str]): Ordered list of contract codes (e.g. [&#8217;MESH24&#8217;, &#8216;MESM24&#8217;, ...]).
        daily_data (dict): Mapping {contract -&gt; daily bars}, dtype must have
                           fields: (&#8221;Date&#8221;, &#8220;Open&#8221;, &#8220;High&#8221;,
                                    &#8220;Low&#8221;, &#8220;Close&#8221;, &#8220;Volume&#8221;)

    Returns:
        list[dict]: rollover schedule, e.g.
            [{&#8221;date&#8221;: int, &#8220;from&#8221;: &#8220;MESH24&#8221;, &#8220;to&#8221;: &#8220;MESM24&#8221;}, ...]
    &#8220;&#8221;&#8220;
    roll = []

    for i in range(len(contracts) - 1):
        front = contracts[i]
        back = contracts[i + 1]

        df = daily_data.get(front)
        dn = daily_data.get(back)
        if df is None or dn is None:
            continue

        # Get expiry year, month from the contract code
        ym = parse_contract_code(front)
        y = ym // 100
        m = ym % 100

        # Restrict to that month/year only
        win_dates = []
        for d in np.intersect1d(df[&#8221;Date&#8221;], dn[&#8221;Date&#8221;]):
            s = str(int(d))
            dy, dm = int(s[:4]), int(s[4:6])
            if dy == y and dm == m:
                win_dates.append(int(d))

        rollover_date = None
        for d in sorted(win_dates):
            vol_front = df[df[&#8221;Date&#8221;] == d][&#8221;Volume&#8221;][0]
            vol_back = dn[dn[&#8221;Date&#8221;] == d][&#8221;Volume&#8221;][0]
            if vol_back &gt; vol_front:
                rollover_date = d
                break

        if rollover_date:
            roll.append(
                {
                    &#8220;from&#8221;: front,
                    &#8220;to&#8221;: back,
                    &#8220;date&#8221;: rollover_date,
                }
            )

    return roll</code></code></pre><h3>Back-adjust contracts</h3><p>The <code>back_adjust_contracts</code> function uses the rollover dates from the previous function (or any other similar rollover function) and calculates back adjustments and returns the adjusted contracts. The daily file already uses the settlement price as its close price. Meaning, it is not the last tick of the day. There is a difference, and this will be something to address in quantKit when I get to it. Not all daily data is built the same.</p><pre><code><code>def back_adjust_contracts(daily_contracts: dict[str, np.ndarray],
                          intraday_contracts: dict[str, np.ndarray] | None,
                          rolls: list[dict]) -&gt; tuple[dict[str, np.ndarray], dict[str, np.ndarray] | None]:
    &#8220;&#8221;&#8220;
    Perform back-adjustment using daily settlements.

    Args:
        daily_contracts (dict): {symbol -&gt; OHLCV array with &#8220;Date&#8221;}
        intraday_contracts (dict or None): {symbol -&gt; OHLCV array with &#8220;TimeStamp&#8221;} (optional)
        rolls (list): [{&#8221;from&#8221;: &#8220;H24&#8221;, &#8220;to&#8221;: &#8220;M24&#8221;, &#8220;date&#8221;: int}, ...]

    Returns:
        (dict, dict|None): adjusted daily contracts, adjusted intraday contracts
    &#8220;&#8221;&#8220;
    if intraday_contracts is not None:
        adjusted = {sym: arr.copy() for sym, arr in intraday_contracts.items()}
    else:
        adjusted = {sym: arr.copy() for sym, arr in daily_contracts.items()}

    expired = []

    for roll in rolls:  # rolls must be sorted by date
        from_sym = roll[&#8221;from&#8221;]
        to_sym   = roll[&#8221;to&#8221;]
        roll_date = roll[&#8221;date&#8221;]

        # settlement always comes from daily
        old_contract = daily_contracts[from_sym]
        new_contract = daily_contracts[to_sym]

        old_settle = get_settlement(old_contract, roll_date)
        new_settle = get_settlement(new_contract, roll_date)

        diff = new_settle - old_settle

        # All expired contracts get shifted by this new diff
        for sym in expired + [from_sym]:
            if sym in adjusted:
                shift_contract(adjusted[sym], diff)

        expired.append(from_sym)

    return adjusted
 </code></code></pre><h3>Stitch contracts</h3><p>Almost done, y&#8217;all.</p><p>This function takes all of our contracts and stitches them together at the rollover dates. It doesn&#8217;t care whether or not the contracts have been adjusted.</p><pre><code><code>def stitch_contracts(
    contracts: list[str], data: dict[str, np.ndarray], rolls: list[dict]
) -&gt; np.ndarray:
    &#8220;&#8221;&#8220;
    Stitch together multiple contracts into a continuous series using rollover dates.

    Args:
        contracts (list[str]): Ordered list of contract codes.
        data (dict): {contract -&gt; bar array}, bar dtype must include &#8220;TimeStamp&#8221;.
        rolls (list[dict]): Rollover events [{&#8221;from&#8221;:, &#8220;to&#8221;:, &#8220;date&#8221;:}, ...]

    Returns:
        np.ndarray: Stitched bars, no back adjustment.
    &#8220;&#8221;&#8220;
    stitched = []

    # Build quick lookup for roll dates
    roll_dates = {(r[&#8221;from&#8221;], r[&#8221;to&#8221;]): r[&#8221;date&#8221;] for r in rolls}

    # Detect date/timestamp field
    use_date = &#8220;Date&#8221; in data[contracts[0]].dtype.names

    for i in range(len(contracts)):
        sym = contracts[i]
        bars = data.get(sym)
        if bars is None or bars.size == 0:
            continue

        # Determine slice window for this contract
        start_date = None
        end_date = None

        # If this contract has an incoming rollover
        if i &gt; 0:
            prev = contracts[i - 1]
            if (prev, sym) in roll_dates:
                start_date = roll_dates[(prev, sym)]

        # If this contract has an outgoing rollover
        if i &lt; len(contracts) - 1:
            nxt = contracts[i + 1]
            if (sym, nxt) in roll_dates:
                end_date = roll_dates[(sym, nxt)]

        # Apply filters
        out = []
        for j in range(bars.shape[0]):
            if use_date:
                # daily: already YYYYMMDD int
                dts = bars[&#8221;Date&#8221;][j]

                if start_date is not None and dts &lt; start_date:
                    continue
                if end_date is not None and dts &gt; end_date:
                    continue
            else:
                # intraday: convert TimeStamp micros -&gt; date
                ts = bars[&#8221;TimeStamp&#8221;][j]

                if start_date is not None:
                    start_date_ts = yyyymmdd_to_micros_roll_boundary(start_date)
                else:
                    start_date_ts = None
                
                if end_date is not None:
                    end_date_ts = yyyymmdd_to_micros_roll_boundary(end_date)
                else:
                    end_date_ts = None

                if start_date_ts is not None and ts &lt; start_date_ts:
                    continue
                if end_date_ts is not None and ts &gt; end_date_ts:
                    continue


            out.append(bars[j])

        if out:
            stitched.extend(out)

    if len(stitched) == 0:
        return np.empty(0, dtype=data[contracts[0]].dtype)

    return np.array(stitched, dtype=data[contracts[0]].dtype)</code></code></pre><h3>Build contracts wrapper</h3><p>We made it!</p><p>The final piece. This is the wrapper that brings it all together. It returns our finished chart.</p><pre><code><code>def build_continuous_chart(
    root: str,
    data_dir: str,
    start: str,
    end: str,
    chart_type: str = &#8220;intraday&#8221;,   # &#8220;daily&#8221; or &#8220;intraday&#8221;
    interval: int = 1,              # minutes for intraday; ignored if daily
    rollover: str = &#8220;volume&#8221;,       # only &#8220;volume&#8221; supported right now
    back_adjust: bool = True
) -&gt; np.ndarray:

    contracts = contracts_in_range(data_dir, root, start, end)

    daily_data = load_daily_contracts(data_dir, contracts)

    if rollover == &#8220;volume&#8221;:
        rolls = volume_based_rollover(contracts, daily_data)
    else:
        rolls = []

    if chart_type == &#8220;daily&#8221;:
        bars_by_contract = daily_data
    elif chart_type == &#8220;intraday&#8221;:
        scid_ticks = load_scid_contracts(data_dir, contracts)
        bars_by_contract = {}
        for sym, ticks in scid_ticks.items():
            bars_by_contract[sym] = resample_to_bars(ticks, minutes=interval)
    else:
        raise ValueError(f&#8221;Unknown chart_type: {chart_type}&#8221;)
    
    if back_adjust:
        bars_by_contract = back_adjust_contracts(daily_data, bars_by_contract if chart_type==&#8221;intraday&#8221; else None, rolls)

    stitched = stitch_contracts(contracts, bars_by_contract, rolls)

    final = []
    for i in range(stitched.shape[0]):
        if &#8220;Date&#8221; in stitched.dtype.names:
            dts = stitched[&#8221;Date&#8221;][i]
            start_int = int(start.replace(&#8221;-&#8221;, &#8220;&#8221;))
            end_int = int(end.replace(&#8221;-&#8221;, &#8220;&#8221;))
            if dts &lt; start_int or dts &gt; end_int:
                continue
        else:
            ts = stitched[&#8221;TimeStamp&#8221;][i]
            start_micros = yyyymmdd_to_micros_roll_boundary(int(start.replace(&#8221;-&#8221;, &#8220;&#8221;)))
            end_micros = yyyymmdd_to_micros_roll_boundary(int(end.replace(&#8221;-&#8221;, &#8220;&#8221;)))

            if ts &lt; start_micros or ts &gt; end_micros:
                continue
            
        final.append(stitched[i])


    if len(final) == 0:
        return np.empty(0, dtype=stitched.dtype)

    return np.array(final, dtype=stitched.dtype)</code></code></pre><h3>Make a damn CSV</h3><p>The final touch. Let&#8217;s make a human-readable CSV.</p><pre><code><code>chart = build_continuous_chart(
    root=&#8221;MES&#8221;,
    data_dir=PATH_DIR,
    start=&#8221;2025-06-01&#8221;,
    end=END_DATE,
    chart_type=&#8221;intraday&#8221;,
    interval=1,
    rollover=&#8221;volume&#8221;,
    back_adjust=True
)

# ----------------------
# Save to CSV
# ----------------------
if chart.size &gt; 0:
    output_path = os.path.join(&#8221;data&#8221;, &#8220;SC_MES_Minute.csv&#8221;)

    # make sure directory exists
    os.makedirs(os.path.dirname(output_path), exist_ok=True)

    if &#8220;Date&#8221; in chart.dtype.names:
        x_vals = [yyyymmdd_to_dt64(int(d)).item() for d in chart[&#8221;Date&#8221;]]
        cols = [name for name in chart.dtype.names if name != &#8220;Date&#8221;]
    else:
        x_vals = [utc_to_local(ts) for ts in chart[&#8221;TimeStamp&#8221;]]
        cols = [name for name in chart.dtype.names if name != &#8220;TimeStamp&#8221;]

    export_data = np.column_stack([x_vals] + [chart[name] for name in cols])
    header = &#8220;DateTime,&#8221; + &#8220;,&#8221;.join(cols)
    fmt = [&#8221;%s&#8221;] + [&#8221;%.6f&#8221;] * (export_data.shape[1] - 1)

    np.savetxt(
        output_path,
        export_data,
        delimiter=&#8221;,&#8221;,
        fmt=fmt,
        header=header,
        comments=&#8221;&#8220;
    )

    print(f&#8221;&#9989; Saved: {output_path} ({chart.size} bars)&#8221;)
else:
    print(&#8221;&#9888;&#65039; No data to export.&#8221;)</code></code></pre><p>And the outcome:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0_JE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe90cbe76-a704-40fd-8d48-96cd7cab7ca5_493x468.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0_JE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe90cbe76-a704-40fd-8d48-96cd7cab7ca5_493x468.png 424w, https://substackcdn.com/image/fetch/$s_!0_JE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe90cbe76-a704-40fd-8d48-96cd7cab7ca5_493x468.png 848w, https://substackcdn.com/image/fetch/$s_!0_JE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe90cbe76-a704-40fd-8d48-96cd7cab7ca5_493x468.png 1272w, https://substackcdn.com/image/fetch/$s_!0_JE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe90cbe76-a704-40fd-8d48-96cd7cab7ca5_493x468.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0_JE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe90cbe76-a704-40fd-8d48-96cd7cab7ca5_493x468.png" width="493" height="468" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e90cbe76-a704-40fd-8d48-96cd7cab7ca5_493x468.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:468,&quot;width&quot;:493,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:55367,&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://newsletter.huntgathertrade.com/i/175630248?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe90cbe76-a704-40fd-8d48-96cd7cab7ca5_493x468.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_!0_JE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe90cbe76-a704-40fd-8d48-96cd7cab7ca5_493x468.png 424w, https://substackcdn.com/image/fetch/$s_!0_JE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe90cbe76-a704-40fd-8d48-96cd7cab7ca5_493x468.png 848w, https://substackcdn.com/image/fetch/$s_!0_JE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe90cbe76-a704-40fd-8d48-96cd7cab7ca5_493x468.png 1272w, https://substackcdn.com/image/fetch/$s_!0_JE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe90cbe76-a704-40fd-8d48-96cd7cab7ca5_493x468.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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 class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!T26g!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F376d13f1-c47c-4bdb-bbeb-6d170b0181c7_480x270.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!T26g!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F376d13f1-c47c-4bdb-bbeb-6d170b0181c7_480x270.gif 424w, https://substackcdn.com/image/fetch/$s_!T26g!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F376d13f1-c47c-4bdb-bbeb-6d170b0181c7_480x270.gif 848w, https://substackcdn.com/image/fetch/$s_!T26g!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F376d13f1-c47c-4bdb-bbeb-6d170b0181c7_480x270.gif 1272w, https://substackcdn.com/image/fetch/$s_!T26g!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F376d13f1-c47c-4bdb-bbeb-6d170b0181c7_480x270.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!T26g!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F376d13f1-c47c-4bdb-bbeb-6d170b0181c7_480x270.gif" width="480" height="270" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/376d13f1-c47c-4bdb-bbeb-6d170b0181c7_480x270.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:270,&quot;width&quot;:480,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:601269,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/gif&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.huntgathertrade.com/i/175630248?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F376d13f1-c47c-4bdb-bbeb-6d170b0181c7_480x270.gif&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!T26g!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F376d13f1-c47c-4bdb-bbeb-6d170b0181c7_480x270.gif 424w, https://substackcdn.com/image/fetch/$s_!T26g!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F376d13f1-c47c-4bdb-bbeb-6d170b0181c7_480x270.gif 848w, https://substackcdn.com/image/fetch/$s_!T26g!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F376d13f1-c47c-4bdb-bbeb-6d170b0181c7_480x270.gif 1272w, https://substackcdn.com/image/fetch/$s_!T26g!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F376d13f1-c47c-4bdb-bbeb-6d170b0181c7_480x270.gif 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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><h2>Closing</h2><p>As you can see, there is a lot of scaffolding here for working with local data files in the future. I like the way Sierra Chart handles local data files without using a database, and I will probably implement something similar for quantKit when it&#8217;s time. There is a lot to build from here, and I look forward to adding it into quantKit soon. For now, it&#8217;s just a solid tutorial to help you see how you can find, manipulate, and export data for your needs without having to get funky with APIs.</p><h2>What&#8217;s next?</h2><p>The next post will be a paid post. I am going to create a testing suite for strategies in a spreadsheet. The goal is to have 2-3 strategy ideas in this suite to showcase how it works. I will also build a daily oriented template that will generate orders for daily strategies. This shouldn&#8217;t be too difficult to setup, but as we saw from this one, sometimes I misjudge how hard something can be.</p><p>Until next time.</p><p>Happy hunting.</p><blockquote><p>This post doesn&#8217;t represent any type of advice, financial or otherwise. Its purpose is to be informative and educational. Backtest results are based on historical data, not real-time data. There is no guarantee that these hypothetical results will continue in the future. Day trading is extremely risky, and I do not suggest running any of these strategies live.</p></blockquote>]]></content:encoded></item><item><title><![CDATA[How NOT to use Sierra Chart’s DTC Server to Pull Granular Futures Data]]></title><description><![CDATA[This one was a flop, but I wanted to share anyway.]]></description><link>https://newsletter.huntgathertrade.com/p/how-not-to-use-sierra-charts-dtc</link><guid isPermaLink="false">https://newsletter.huntgathertrade.com/p/how-not-to-use-sierra-charts-dtc</guid><dc:creator><![CDATA[Larry Kann]]></dc:creator><pubDate>Fri, 26 Sep 2025 15:16:09 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!cMd-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6c9fff4-8eb5-4173-ab8a-84a15607ce21_1024x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>We have covered the basics of market data and wrote some simple Python code to get data from yfinance and Alpaca&#8217;s web API. Today, we turn it up a notch. We are going to use Sierra Chart&#8217;s DTC server and Denali data feed to get historical tick data for ES (futures,baby!), aggregate it into 1-minute OHLCV bars, and then save it to CSV.</p><p>Buckle up.</p><p><strong>UPDATE</strong>:</p><p>This project ended up being a failure. Not because I couldn&#8217;t figure it out, but because you can&#8217;t get CME data through the Sierra Chart DTC server. This is because of data usage agreements. I was going to just scrap this post, but I decided to publish it as is and leave the code I was working through as an example for anyone interested in seeing how to encode/decode and parse binary data connections. This will be useful in the future if I decide that I want to send trades through DTC, but I don&#8217;t know that I am there just yet.</p><p>Anyway, feel free to read through what is here. It is still accurate information, I just didn&#8217;t post any code because it didn&#8217;t work.</p><p>Live and learn.</p><p><a href="https://github.com/larrykann/python_tutorials">GitHub Repo</a></p><h2>Why am I using Sierra Chart, DTC, and Denali?</h2><p>There are several reasons that we are using Sierra Chart (SC) for this tutorial. To put it simply, it&#8217;s a legit platform, but I will break it down a bit more below.</p><h3>Sierra Chart</h3><p>First and foremost, this platform is programmed in C++ and built for speed and efficiency. The documentation is dense, and the support forum is sometimes difficult to navigate. The general setup is not intuitive if you are used to other platforms, and it can be generally difficult to navigate and figure out when you first start using it. However, after you climb this steeper hill, the fruits at the top are well worth it.</p><p>It is fast. Wicked fast. It doesn&#8217;t eat your RAM and it stays out of the way. Honestly, the only other program I have seen that runs this efficiently is RealTest. Everything else is slow in comparison.</p><p>It is difficult to figure out. But, so are many other things. Most hard things are worth the work. Bet you didn&#8217;t know you were gonna get a life lesson in this post too, did you?</p><h3>Teton</h3><p><a href="https://www.sierrachart.com/index.php?page=doc/SierraChartDirectOrderRoutingService.php">Teton</a> is Sierra Chart&#8217;s futures order routing service. Here is what SC says about it:</p><p>The Teton Futures Order Routing service is a high-quality order routing service with advanced risk management from Sierra Chart to provide order routing, for outright futures and spreads, direct to the major exchanges. There is no other intermediary provider.</p><p>Remember when I talked about &#8220;intermediaries&#8221; when discussing data? Well, order routing can have them too. Except, Teton doesn&#8217;t. That makes it fast. How fast?</p><p>Orders are routed direct to the exchange with high reliability and very low latency, in under 500 microseconds.</p><p>Wow. How fast is a microsecond? One millionth of a second. That&#8217;s 0.0005 seconds. Fuck me, that&#8217;s fast.</p><p>Their servers for Teton are colocated with the CME order matching computers (we will talk about colocation more in future posts). That&#8217;s cool. It is offered to clearing firms and users <strong>at no cost</strong>. There are no transaction fees per contract traded. As far as SC is aware, this is an industry first.</p><p>That is pure quant dirty talk right there, y&#8217;all.</p><h3>Denali</h3><p>Ok, so their futures order routing is legit good. Surely, their <a href="https://www.sierrachart.com/index.php?page=doc/DenaliExchangeDataFeed.php">data</a> must suck.</p><p>Nope.</p><p>Let&#8217;s see what they have to say about it:</p><ul><li><p>Streaming real-time data.</p></li><li><p>Market depth data.</p></li><li><p>Historical intraday day data. CME data has tick by tick data back to 2011 and minute data back to 2008.</p></li><li><p>1 year of tick data for US stocks and minute data back to 2008 (assuming the stock existed then).</p></li><li><p>Historical daily data.</p></li><li><p>100% accurate historical Bid Trade Volume and Ask Trade Volume.</p></li><li><p>High precision data delivered with millisecond time stamping.</p></li><li><p>Low latency.</p></li><li><p>Direct CME FIX data feed at the SC backend.</p></li></ul><p>Wow. That&#8217;s wicked cool.</p><p>It must cost a million dollars a month.</p><p>Also, nope.</p><p>It&#8217;s one of the cheapest data streams I have found.</p><h3>DTC</h3><p>We discussed this briefly in the last post. This is what will allow us to get our data from Sierra Chart without having to export it to CSV from inside the platform. Of course, if you want to just export the data, have at it. That&#8217;s what makes this platform a dual threat. Don&#8217;t want to code? Cool. Want to code? Also, cool.<br><br><em><strong>Remember, it turns out this is untrue. You can&#8217;t get CME data via DTC. I knew that the documents mentioned this, but it also mentions being able to request historical data, so I figured I would try it anyway. Turns out, it won&#8217;t send you data. Lame.</strong></em></p><h2>Turn Sierra Chart into a DTC Server</h2><p>So, you decided you want to give this a go. Maybe you already used Sierra Chart, maybe you got it just to test this idea. Or, maybe you are just reading bc you think this is a cool project and you like my style.</p><p>This part of the tutorial is pretty simple. Go to the <a href="https://www.sierrachart.com/index.php?page=doc/DTCServer.php">SC document page</a> that shows you how to turn on the DTC server and follow the instructions under the &#8220;Server Usage&#8221; section.</p><p>For this tutorial, we are going to set the encoding to binary. This is because I want to test how to work with it. The whole purpose of this is to ease into building our own research engine and learning how to play with this DTC protocol is part of it. We will keep everything else at the defaults.</p><p>Additionally, make sure that your intraday data is set to store as 1 tick. I believe this is default, but I am unsure.</p><h2>Setting up the project</h2><p>Time to work.</p><p>First, we need to setup our project environment and activate the virtual environment just like we did in the previous article.</p><pre><code><code>mkdir tutorial3
cd tutorial3
mkdir data
New-Item requirements.txt 
New-Item tutorial3.py
python -m venv .venv./.venv/Scipts/Active</code></code></pre><p>Next, the required dependencies for this script. I am going to avoid using Pandas this time. I am doing this so I can get a little more hands on with the data using Numpy. I am not going to use any Pandas DataFrames in quantKit, so I want to make sure I can handle the data without it. Besides, this is good practice for you too. You don&#8217;t want to rely on a bunch of dependencies if you can help it.</p><pre><code>numpy</code></pre><p>That&#8217;s it. Lean and mean. Install it with <code>pip install -r requrements.txt</code>.</p><h2>The Code</h2><p>The purpose of this tutorial is two-fold. I am personally testing this out as I create this walk-through, and I am showing you how to test this kind of shit so you can get used to playing around with Python. So, instead of just pasting it all into one block, I am going to break it into sections. This just helps describe what each section is doing better without trying to rely on large comment blocks.</p><p>I suggest actually typing it in as you go through. Get reps. Or, you can paste it. And if you are real lazy, just clone the repo.</p><p>Wait&#8230;</p><p>Where is the code?</p><p>Well, it turns out that this project was a wash.</p><p>So, check out the closing thoughts to see what happened.</p><p>You can find the code that I was using at the GitHub link at the top.</p><h2>Closing Thoughts</h2><p>Ok, obviously this didn&#8217;t work out the way I was hoping. Sierra Chart has enabled the historical data request messaging, but because of the data usage agreements with CME, they can not allow any CME data to be sent over the DTC server.</p><p>I didn&#8217;t check to see if this applies to equities data or not. It would seem odd to enable the messages but not actually be able to send any data over the server. It is possible that it works for data that isn&#8217;t Denali, but that would defeat the purpose of this project.</p><p>Everything else I discussed in this article is still correct. The Denali data feed and the Teton routing are pretty damn good. I would imagine that it&#8217;s one of the better setups for futures traders that doesn&#8217;t require you to have buckets of money to get yourself competitive. Does it let you compete with firms? Nope. That will never happen, but it does let you compete with other retail traders and maybe even some small retail shops.</p><p>The name of the game is reliable fast data and routing.</p><h3>What&#8217;s next?</h3><p>Since we can&#8217;t use DTC to do this, we are going a different route. I am just going to parse the binary data files that SC uses to store historical data. This way, we still get the same tick-level data that we can then use to aggregate into minute bars and turn into a continuous chart.</p><p>Hopefully it will be published soon. Until then&#8230;</p><p>Happy hunting.</p><blockquote><p>This post doesn&#8217;t represent any type of advice, financial or otherwise. Its purpose is to be informative and educational. Backtest results are based on historical data, not real-time data. There is no guarantee that these hypothetical results will continue in the future. Day trading is extremely risky, and I do not suggest running any of these strategies live.</p></blockquote>]]></content:encoded></item><item><title><![CDATA[How Market Data Reaches You]]></title><description><![CDATA[Part two of the market data for quants series. Just more information you should know.]]></description><link>https://newsletter.huntgathertrade.com/p/how-market-data-reaches-you</link><guid isPermaLink="false">https://newsletter.huntgathertrade.com/p/how-market-data-reaches-you</guid><dc:creator><![CDATA[Larry Kann]]></dc:creator><pubDate>Tue, 16 Sep 2025 23:51:44 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!cMd-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6c9fff4-8eb5-4173-ab8a-84a15607ce21_1024x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In <a href="https://huntgathertrade.substack.com/p/market-data-for-quants">Part One</a> of this series, we talked about the types of market data (trade and depth) you get from exchanges, how it travels from exchanges through vendors and brokers to end-users, and the distinction between historical and streaming feeds. It was a simple breakdown, and only discussed the basic data a quant might deal with. And realistically, it&#8217;s what most retail or hobbyist traders will work with. There are many other types of data that can be used to make trading decisions, but data from exchanges are the foundations of focus for the quant curious.</p><p>In this post I want to zoom in on the practical side: <strong>how does this data actually get to your terminal, platform, or research environment?</strong> The answer lies in the delivery models. Whether you are downloading static data files (CSV), making requests to REST APIs, or connecting to a streaming protocol, the delivery method shapes what you can do with the data and what types of strategies you can deploy.</p><h2>File Exports</h2><p>This is the OG method for getting historical data for testing. It is still widely used, and as we know from previous posts, one I am not a big fan of. Brokers, platforms, and data vendors will sometimes provide data in a flat file format (CSV being the most popular). This is a simple, code free way to get data to test. It is simple, portable, human-readable and works with spreadsheet applications (Excel) and coding languages (Python &#8211;&gt; pandas). It is not real-time and often limited in granularity.</p><p>There are plenty of data vendors that provide CSV downloads or exports. Personally, I used Norgate data for daily data during my RealTest experiments. The data was reliable and great for daily strategies, especially for equities. But, it required using their software to access the data either via CSV export or connection to your testing/trading platform. Not the worst setup, but not the best either.</p><p>A quick google search and you can find plenty of providers that allow you to download aggregated OHLCV data in this type of format. This is the best way to get data if you are trying to no-code test an idea. In a soon-to-be-featured article, I will show how to use simple CSV data to test a strategy in a spreadsheet platform. Spoiler, I don&#8217;t fuck with Excel or Google Sheets, but you can do whatever you want.</p><h2>Web APIs</h2><p>Now, we are getting closer to the kind of data I like. I admit, I am a nerd. Being a nerd requires that newer technology gets you off a bit, but I have to admit, web APIs aren&#8217;t new. The finance world just hasn&#8217;t completely caught up with the times. This is because an API is really just a set of code that allows remote, sometimes authorized, access to some form of data. The real nerdy part is how the data is stored, but I am getting ahead of myself.</p><h3>REST APIs</h3><p>REST stands for representational state transfer. Yeah, it doesn&#8217;t really mean dick if you aren&#8217;t a web developer. It&#8217;s just an architecture that defines how you design an API. Oh yeah, API stands for &#8220;application programming interface&#8221;. In case you didn&#8217;t know. Probably should have mentioned that more often. If you aren&#8217;t a developer, it doesn&#8217;t matter. If you are a developer, you already know. I hope.</p><p>In the <a href="https://huntgathertrade.substack.com/p/a-quick-guide-to-using-python-for">Last Post</a>, I gave a quick example of how to get data from the Alpaca API. It&#8217;s pretty simple, especially if you are just backfilling data for a research pipeline. There are other protocols (maybe?), but REST is the standard on the inter-webs.</p><h3>Web Sockets</h3><p>Web sockets are responsible for our live data streams. It is a persistent connection that pushes updates to you in real-time. Alpaca (and many others) provides a WebSocket API. You can request bars, trades, or quotes for a given symbol and timeframe. It is also dependent on the type of data you ask for. Remember, many services apply their own magic to the data before it gets to you, so you have to know how they handle their data. It matters.</p><p>This is how you get real-time data to feed live order books or trades to an algo or dashboard. It&#8217;s pretty flexible, easy to integrate, and supported by most modern platforms. However, it isn&#8217;t standardized. Each platform has its own endpoints, formats, and quirks.</p><h2>Protocols</h2><p>This is where it gets&#8230; fun. For professional software, APIs aren&#8217;t always enough. That&#8217;s where protocols come in. They are standardized (or semi-standardized) messaging systems designed specifically for trading and market data. Cool, right?</p><h3>FIX</h3><p><a href="https://www.fixtrading.org/what-is-fix/">FIX</a> stands for &#8220;financial information exchange&#8221;. I am learning from my hastiness, see? This is the granddaddy of trading protocols. It is used worldwide for order routing and sometimes for market data. It is essentially the industry standard and widely supported. Unfortunately, it sucks. Just kidding. Kind of. It leaves a lot to be desired. It is verbose, complex, and often overkill if all you want is some historical data.</p><p>It really is the industry standard, though. It dates back to the 90s (before some of your birthdays, I bet) and is still the backbone of institutional routing. This makes it hard to ignore.</p><h3>DTC</h3><p><a href="https://www.sierrachart.com/index.php?page=doc/DTCProtocol.php">DTC</a> stands for Data and Trading Communications. This is Sierra Chart&#8217;s love letter to modern traders. It is an open protocol that attempts to fix (heh) some of the issues with FIX. Unfortunately, I don&#8217;t know of any other platform/data service that uses it besides Sierra Chart and their Denali Data feed.</p><p>Does that matter?</p><p>Not really. It&#8217;s open and other people can use it, and I am sure users have. But, it requires some developer knowledge. Like FIX, it is a standardized messaging protocol. It has options for binary or compact JSON and is optimized to be fast and friendly. It&#8217;s pretty damn niche though. I kind of like it.</p><p>To be clear, this protocol is open and free to adapt. Free as in spe&#8230; er, beer. Beer is the safer option here these days, Larry. Adoption is limited, but it will be one I am exploring for my needs.</p><h3>Proprietary Protocols</h3><p>Unlike Sierra Chart, some vendors decided to fuck FIX and open protocols. Instead, they created their own shit that is tightly integrated within their own ecosystems. Very Apple of them. Instead of listing them, I just wanted to make you aware that there was the possibility of proprietary options out there. Since I am too cool the fuck with them (read broke), there isn&#8217;t much else to say here.</p><h2>Putting it All Together</h2><p>As a SQR (serious quant researcher, thanks <a href="https://danielpiper.substack.com/">SLA</a>), you will often mix these models. You can use CSV for backtests, make requests to REST APIs, and keep a WebSocket or protocol running to stream live ticks. Understanding the difference is key to designing a reliable research and trading pipeline.</p><h2>What&#8217;s next?</h2><p>Now that I have covered the basics and showed you a couple of ways to get data, and convert it to CSV, I am going to get a little more detailed. I am going to show you how to use Sierra Chart (hint, this is the platform I am playing with for trading) to get data via DTC and aggregate tick data into OHCLV bar data for testing. After that, I am going to build out a simple testing suite in a spreadsheet to show you how you can go &#8220;code free&#8221; to test out simple ideas, get stats, and maybe even do some simple statistical robustness tests on the data.</p><p>Happy hunting, folks!</p><blockquote><p>This post doesn&#8217;t represent any type of advice, financial or otherwise. Its purpose is to be informative and educational. Backtest results are based on historical data, not real-time data. There is no guarantee that these hypothetical results will continue in the future. Day trading is extremely risky, and I do not suggest running any of these strategies live.</p></blockquote>]]></content:encoded></item><item><title><![CDATA[A quick guide to using Python for market data]]></title><description><![CDATA[Part 1 of 2. Just showing you simple ways to use Python to get data for testing.]]></description><link>https://newsletter.huntgathertrade.com/p/a-quick-guide-to-using-python-for</link><guid isPermaLink="false">https://newsletter.huntgathertrade.com/p/a-quick-guide-to-using-python-for</guid><dc:creator><![CDATA[Larry Kann]]></dc:creator><pubDate>Mon, 15 Sep 2025 16:06:53 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!cMd-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6c9fff4-8eb5-4173-ab8a-84a15607ce21_1024x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In today&#8217;s post I am going to cover a few different ways to use Python to get data and format it for testing purposes. There are plenty of ways to get data without having to use Python. Data services like Norgate and Data Bento are examples of services that allow you to just get CSV data for your testing purposes without code. Most trading platforms, like Sierra Chart, also have export to CSV features as well. The trick is learning how they structure their data and what data you actually need for testing. This is where scripting languages like Python come in handy.</p><p>All of the code for these tutorials can be found on my <a href="https://github.com/larrykann/python_tutorials">Github</a>.</p><h2>Install Python and setup your environment</h2><p>Before you do anything, you have to make sure that you have Python installed. The examples I am going to give are for Windows, but if you are on a different operating system, a quick search online should help you figure out what to do for your particular system.</p><pre><code># Install (or upgrade) via winget
winget install --id Python.Python.3.13 -e

# or upgrade if already installed
winget upgrade --id Python.Python.3.13 -e

# Verify
python --version</code></pre><p>After this, you want to create a directory for your Python projects or scripts. Then, you want to create a virtual environment for that project. This allows us to compartmentalize the dependencies that we need for each project and not clutter up our main python install on our machine. Each tutorial in this guide will have a different environment with different dependencies.</p><pre><code>mkdir python_tutorials\tutorial1
cd python_tutorials\tutorial1
python -m venv .venv
.\.venv\Scripts\Activate</code></pre><p>After we get the environment activated, we need to create a <code>requirements.txt</code> file in our directory. This is where we will list each of the dependencies that we need for our project. In Powershell, that looks like:</p><pre><code>New-Item requirements.txt</code></pre><p>Then, using your favorite text editor (I use Neovim, btw), open that file and add the following two lines:</p><pre><code>pandas
yfinance</code></pre><p>Then, we run the command to install them:</p><pre><code>python -m pip install -r requirements.txt</code></pre><p>Once it installs, we are ready to start playing with data.</p><h2>Using <code>yfinance</code> to get free data</h2><p>The first thing we are going to cover is the most popular and easy way to get free, mostly unreliable (but good for learning), data. Before we get started, make sure you create a data directory inside this project to save our CSVs to when we are done. Then, create a new file <code>tutorial1.py</code> and then open that file with our text editor.</p><p>There, we are going to add the following code:</p><pre><code>import yfinance as yf
import pandas as pd
from pathlib import Path

# Parameters
ticker = "SPY"
period = "15mo"  # last 15 months
interval = "1d"

# Fetch data with auto-adjust so prices reflect dividends/splits
data = yf.download(ticker, period=period, interval=interval, auto_adjust=True)

# Show raw data straight from Yahoo
print("\nRaw data (first 5 rows):")
print(data.head())

# Handle multi-index columns if present
if isinstance(data.columns, pd.MultiIndex):
    data.columns = data.columns.get_level_values(0)  # keep only column names, drop ticker level

# Clean data with pandas
out = (
        data.rename(
            columns={
                "Open": "open",
                "High": "high",
                "Low": "low",
                "Close": "close",
                "Volume": "volume",
            }
        )
        .reset_index()
        .rename(columns={"Date": "date"})
        .loc[:, ["date", "open", "high", "low", "close", "volume"]]
    )

# Save to file
Path("data").mkdir(exist_ok=True)

all_path = Path("data") / f"{ticker}_15mo.csv"
ins_path = Path("data") / f"{ticker}_in_sample.csv"
oos_path = Path("data") / f"{ticker}_out_sample.csv"

out.to_csv(all_path, index=False)

# Split ~12mo IS / ~3mo OOS using pandas slicing
insample = out.iloc[:-63]
outsample = out.iloc[-63:]
insample.to_csv(ins_path, index=False)
outsample.to_csv(oos_path, index=False)

print(f"\nSaved {len(out):,} total rows")
print(f"In-sample rows: {len(insample)} &#8594; {ins_path}")
print(f"Out-of-sample rows: {len(outsample)} &#8594; {oos_path}")

# Verify by reading back with pandas
print("\nPreview of saved CSVs:")
print(f"\nAll data:\n{pd.read_csv(all_path).head()}")
print(f"\nIn-sample:\n{pd.read_csv(ins_path).head()}")
print(f"\nOut-of-sample:\n{pd.read_csv(oos_path).head()}")</code></pre><p>Then, run this code with:</p><pre><code>python tutorial1.py</code></pre><p>And behold the data.</p><p>A good bit of the code in the above code block is print statements that just confirm that we got data and that it was formatted correctly. Aside from that code, what we are doing is:</p><ul><li><p>Defining the data we want to get (SPY), timeframe (daily), and how much (15months).</p></li><li><p>Downloading that data and formatting it. This isn't always necessary, but the example shows you how to change column names and drop columns that we don&#8217;t need.</p></li><li><p>Lastly, we save it to CSV in our data file path</p></li></ul><p>Notice that we separated our data out into three different files. One of them holds all the data, the next two are our in-sample (IS) and out-of-sample (OS) data. It is always a good practice to withhold some data from your testing. This helps us insure that we are overfitting our strategy to all of the available data. When we get to testing our data, we will create, test, and tweak our strategy with the IS data, then test it against the OS data to see how it performs.</p><h2>Getting data from Alpaca (or any similar web API)</h2><p>Moving along to our next example. Instead of using yfinance, this time we are going to use Alpaca. I am using Alpaca here because it is a developer first broker/provider. It has solid APIs and documentation. It requires having an account with them (which you can do for free) and that you use an API key to make calls to their API.</p><p>Make sure you deactivate your previous <code>venv</code> session if you are going through this in order.</p><pre><code>deactivate</code></pre><p>Create a new directory (tutorial2), add you data folder, create a new <code>venv</code> for this project, and the add the requirements file:</p><pre><code>pandas
alpaca-py
python-dotenv</code></pre><p>Then, just like before, we need to activate our <code>venv</code> and install the dependencies.</p><p>We will need to create a <code>.env</code> file to add our API key too.</p><pre><code>ALPACA_API_KEY=your_api_key_here
ALPACA_API_SECRET=your_api_secret_here</code></pre><p>If you are planning on using git for version control, be sure to add the <code>.env</code> file to your <code>.gitignore</code> so you don&#8217;t advertise your keys to the internet.</p><p>In your Alpaca account, you are going to want to go to the profile settings and manage accounts. Here you can generate the API keys you need for the <code>.env</code> file above. Make sure you use the paper account for this tutorial. We won&#8217;t be making any calls to the account itself, but there is no need to take chances.</p><p>Once that is done, open up the new <code>tutorial2.py</code> file and add:</p><pre><code>from datetime import datetime, timedelta
import os
from pathlib import Path

import pandas as pd
from dotenv import load_dotenv
from alpaca.data.historical import StockHistoricalDataClient
from alpaca.data.requests import StockBarsRequest
from alpaca.data.timeframe import TimeFrame

# Load keys from .env
load_dotenv()
API_KEY = os.getenv("ALPACA_API_KEY")
API_SECRET = os.getenv("ALPACA_API_SECRET")

# Initialize the market data client (no need for base_url here)
data_client = StockHistoricalDataClient(API_KEY, API_SECRET)

# Date range
end = pd.Timestamp.today(tz="UTC").normalize()
start = end - pd.DateOffset(months=15)

# Define the request (last 5 days of SPY daily bars)
request_params = StockBarsRequest(
    symbol_or_symbols=["SPY"],
    timeframe=TimeFrame.Day,
    start=start.to_pydatetime(),
    end=end.to_pydatetime(),
    adjustment='all',
)

# Fetch the bars
bars = data_client.get_stock_bars(request_params)

# JSON --&gt; DataFrame
df = bars.df.reset_index().rename(columns={"timestamp": "date"})
df["date"] = pd.to_datetime(df["date"]).dt.tz_localize(None)
df = df.loc[:, ["date", "open", "high", "low", "close", "volume"]]

# Print the raw response so you can inspect its format
bar_list = bars.data["SPY"]
print("\nFirst Bar:", bar_list[0])
print("Last Bar:", bar_list[-1])
print(df.head())

# Save into data/
Path("data").mkdir(exist_ok=True)
all_path = Path("data") / f"SPY_15mo.csv"
is_path = Path("data") / f"SPY_in_sample.csv"
os_path = Path("data") / f"SPY_out_sample.csv"

df.to_csv(all_path, index=False)

# Split Data
cutoff = df["date"].min() + pd.DateOffset(months=12)
df[df["date"] &lt; cutoff].to_csv(is_path, index=False)
df[df["date"] &gt;= cutoff].to_csv(os_path, index=False)

# Print to confirm csv data
print("\nPreview of saved CSVs:")
print("\nAll data:\n", pd.read_csv(all_path).head())
print("\nIn-sample:\n", pd.read_csv(is_path).head())
print("\nOut-of-sample:\n", pd.read_csv(os_path).head())</code></pre><p>Similar to the method we used before, this retrieves data from an API and then formats the fields we want and saves them into a CSV file for us. The biggest change is that we get the data in JSON format and not as a DataFrame. We use Pandas to convert the data to a DataFrame and then save it to CSV. This is pretty standard for web APIs, but there is no guarantee that the data will be in the same format. It is always good to check the data format in the documentation or just print it out like we did here to see what it looks like before saving or changing anything.</p><h2>Closing Notes</h2><p>The purpose of this post was to just show you some easy ways to use Python to get data. Both methods use freely available data, with the Alpaca data being more reliable than the <code>yfinance</code> data. Free data is still free, and you get what you pay for.</p><h3>Next time</h3><p>Part two will cover how to get data from your trading platform. For my example, I will be using Sierra Chart. Most platforms offer at least one to export data, but Sierra Chart actually has two methods for getting data. One, a simple export to CSV feature (the easiest if your goal is to just get data), and two, a server option that allows you to retrieve data via their own protocol (DTC) that makes it possible to use your programming language of choice to retrieve data, stream data, and even make trades.</p><p>Before part two, I will also cover the different protocols and formats of data that researchers will likely run into on their quant journeys.</p><p>Until next time, happy hunting!</p><blockquote><p>This post doesn&#8217;t represent any type of advice, financial or otherwise. Its purpose is to be informative and educational. Backtest results are based on historical data, not real-time data. There is no guarantee that these hypothetical results will continue in the future. Day trading is extremely risky, and I do not suggest running any of these strategies live.</p></blockquote>]]></content:encoded></item><item><title><![CDATA[Market Data for Quants]]></title><description><![CDATA[Honestly, the data matters no matter what kind of trader you are. It matters at least enough that you should know about it anyway.]]></description><link>https://newsletter.huntgathertrade.com/p/market-data-for-quants</link><guid isPermaLink="false">https://newsletter.huntgathertrade.com/p/market-data-for-quants</guid><dc:creator><![CDATA[Larry Kann]]></dc:creator><pubDate>Fri, 05 Sep 2025 19:09:49 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!cMd-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6c9fff4-8eb5-4173-ab8a-84a15607ce21_1024x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>So, Larry, you want to be a serious quant researcher. Well, let me ask myself a question then. Where are you going to start? Data? Why would you want to start there? I thought you were going deep in math, bragging about learning stochastic calculus and shit. Why, all of a sudden, does data matter?</p><p>Let me answer myself...</p><p>Data matters. I have mentioned this many times before, but it wasn't until recently, while avoiding work and contemplating all the different ways to try and build quantKit, that I realized, I can't test anything until I have data. Profound, right?</p><p>Well, then I started thinking about how I wanted to handle this data. Of course, I can do what everyone else does: just use CSV files and call it a day. But that shit gets messy quick. And it's slow. Sure, you can work some magic&#8212;compress files, stream the data in chunks, ensure you aren't storing anything to memory that doesn't need to be stored&#8212;but it's still slow. Especially when you want Python to handle this.</p><p>Also, it isn't exactly easy for the user, is it?</p><p>I mean, no one wants to have to constantly manually import CSV files of data. Imagine having to do this with hundreds of equities in an index. It gets old fast, and if I am going to take the time to abstract that away for the user, I might as well go ahead and manage the data more appropriately.</p><p>This got me thinking. I started reading about market data and asking AI to take up its role as my research assistant once again. After a few weeks of trying to consume as much information as I could, I came to a conclusion.</p><p>Data matters more than you think.</p><p>And because it matters more than you think, it should get a decent amount of consideration when you are attempting to build a robust research engine for traders to use.</p><p>So, I am going to go over some basics in this post. Just some food for thought. This will be a part of a mini-series that will explain market data, why it matters, and how I intend to handle it for quantKit. </p><p>Spoiler: It ain't with fucking CSV files.</p><h2>Types of Market  Data</h2><p>There are really only two main types of market data as far as an exchange is concerned: <strong>trade data</strong> and <strong>market depth</strong>.</p><p>Trade data is "tape". It is the source of truth: every executed transaction on the exchange, including price, size, and timestamp. </p><p>Market depth is the real-time record of resting buy/sell orders at multiple price levels, updated as orders are added, canceled, or executed.</p><p>From there, data gets aggregated into other formats such as snapshots and OHLCV data. The latter, which we are all familiar with, builds most of our charts and indicators.</p><p>Technically, exchanges also publish <strong>reference data</strong>. This is essentially metadata that the exchange broadcasts about symbols. It's not true market data, at least not as far as a quant is concerned. You can't math this data.</p><h2>How the data gets from the exchange to you</h2><p>This is where it gets fun.</p><p>The data has to get to your computer from the exchange somehow, and many of us don't have direct access to exchange data, so the data takes a path through several layers:</p><p><strong>Vendors</strong> (Rithmic, CQG, DTN IQFeed, etc) aggregate and redistribute exchange data.</p><p><strong>Brokers</strong> also received market data and redistribute it to you, usually throttled or normalized (IBKR's 250ms snapshots are a good example of this).</p><p><strong>Platforms</strong> (Sierra Chart, NinjaTrader, TradingView) sit on top of these feeds and present data visually, while also adding their own calculations and aggregations.</p><p><strong>Example</strong>:</p><p>Exchange &#8212;&gt; Vendor &#8212;&gt;  Broker &#8212;&gt;  Platform&#8212;&gt;  You</p><p>This isn't always the chain of events. Some brokers and vendors simply pass through exchange data without modification. For example, Alpaca's paid IEX stream is a direct redistribution of IEX exchange data. Sierra Chart's Denali feed works the same way.</p><p>The key point: every time the data changes hands, or hops, there's potential for increased <strong>latency</strong> and <strong>distortion</strong>, especially if the intermediary is throttling, batching, or applying its own adjustments.</p><h2>Why this matters for research</h2><p>As quants, we aren't just consuming charts. We are building systems and testing ideas. That means we need to understand exactly what kind of data we're working with, and how it was handled before it reached us.</p><p><strong>Historical data</strong> is what we use to populate charts and calculate our features/indicators for testing ideas. Not all historical data is the same. It could be raw data that we aggregate ourselves or pre-aggregated OHLCV bars from a vendor or a broker.</p><p><strong>Streaming data</strong> drives real-time execution and decisions. This is true tick-by-tick data or aggregated snapshots (like IBKR) that skip over many small events.</p><p>These distinctions matter because the fidelity of your backtests and research depends on the fidelity of the underlying data. Aggregated bar data is fine for forming ideas or running simple tests. Tick-level data gives you more realistic insights into <strong>slippage</strong> and <strong>execution</strong>. Order book data adds the missing dimension of <strong>liquidity</strong>, showing you how your order would have interacted with the market at the time of the trade.</p><p>If we want our research to reflect reality, we need to match the granularity of our data to the questions we are asking.</p><h2>Quant's Dilemma</h2><p>There is a common saying in trading that I've even repeated myself: "Test with the data you trade on." It sounds reasonable, but for quants and traders it's misleading.</p><p>When you place an order, it's executed against the <strong>raw exchange order book</strong>. Your broker's data feed, whether throttled, aggregated, or delayed, is not what determines your fill. Execution always happens on the exchange.</p><p>This means that your research data and execution broker don't have to match. In fact, separating them often gives you an edge. I remember when I was first learning about day trading and watched Ross Cameron trade. He used Lightspeed for trade execution and eSignal for his charting and market data. It was a simple but powerful example of why it doesn't really matter if you test and analyze on different data than the broker you execute through. What matters is pairing the best data for decision-making with the fastest broker for fills.</p><p>Data feeds and execution feeds are not the same, and they do not need to come from the same source. The goal is simple: use the highest-quality data you can for research and decision-making, and choose a broker that gives you the fastest, most reliable execution.</p><h2>Closing thoughts</h2><p>At the exchange level, all market data boils down to two streams: trade and market depth. Everything else is derived from them. Once it passes through vendors and brokers, it's often batched, throttled, or normalized before it ever reaches you. That's why understanding how your data is handled is critical for researchers.</p><p>Data quality drives research.</p><p>Execution depends on your broker.</p><p>Data feeds and execution feeds are separate.</p><p>For quants, this isn't a liability&#8212;it's an advantage. By doing a little work, we can get the best of both worlds.</p><h3>Coming up next</h3><p>The next post will explore the ways that data gets delivered. I will look at different protocols, see how the plumbing of these systems shapes the speed, granularity, and reliability of the feeds we depend on.</p><blockquote><p>This post doesn't represent any type of advice, financial or otherwise. Its purpose is to be informative and educational. Backtest results are based on historical data, not real-time data. There is no guarantee that these hypothetical results will continue in the future. Day trading is extremely risky, and I do not suggest running any of these strategies live.</p></blockquote>]]></content:encoded></item><item><title><![CDATA[The path to quant trading]]></title><description><![CDATA[Is there actually a destination at the end?]]></description><link>https://newsletter.huntgathertrade.com/p/the-path-to-quant-trading</link><guid isPermaLink="false">https://newsletter.huntgathertrade.com/p/the-path-to-quant-trading</guid><dc:creator><![CDATA[Larry Kann]]></dc:creator><pubDate>Tue, 24 Jun 2025 21:24:05 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!cMd-!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6c9fff4-8eb5-4173-ab8a-84a15607ce21_1024x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>There was a time when I first got into day trading that I thought, &#8220;oh, there are rules? This is going to be easy.&#8221; I started off well enough. I used a simple gap-and-go strategy, fast data, direct broker access, and hot keys. My first month I was up about 10k (amazing for how small my account was starting out), so I pulled what little I needed to pay bills for the next month and kept at it. </p><p>The first month led into summer and I made about two hundred dollars total the next 3 months with plenty of asshole puckering drawdowns in between. I decided this wasn&#8217;t the style of trading for me and did what any amateur (I am still one of those, don&#8217;t get it twisted) would do. I started looking for different ways to trade.<br><br>I switched platforms and started trading slower, with my mouse. This worked for a time, and then it didn&#8217;t. I switched again.</p><p>This went on for about 9 months, constantly changing up what I was doing until I landed on a slow and steady way to trade ES/MES that I felt comfortable with. I also discovered algorithmic trading.</p><p><em>Damn</em>, I thought. That sounds like the sweet spot. You mean I can use my wasting developer skills to research strategies and then program them to trade automatically for me? Yes, please.</p><p>So, while I traded slowly, manually, I started researching this algorithmic trading thing. I launched this Substack to document it along the way. My manual trading did okay, not bad enough to quit, not good enough to own a G-wagon. I dove in head first.</p><p>The first strategy that had great backtest results and drawdowns I could handle (I thought) went live about a week before a planned trip to Disney World with the family. That first week, it went great. It had an automatic stop at $2500, which backtests showed it rarely ever hit, typically only losing a few hundred dollars with bad trades. It took profits pretty fast, and would trade several times a day when criteria was met.</p><p>So, I felt comfortable setting it up to run while out at the parks, enjoying the theme parks.</p><p>The one thing the backtest never showed was that if the market gets volatile enough (not enough testing data), and criteria is still technically being met, there is nothing saying that it couldn&#8217;t take max losses multiple times a day. Like the rookie I was, I didn&#8217;t program in a hard stop. Of course, I came back into the room to find that it had failed twice (that&#8217;s 5k for those who can&#8217;t math) and was currently in a third losing trade. </p><p>Fuck me.</p><p>I pulled the plug on the trade, taking my licks, and shut down the strategy.</p><p>Back to the drawing board&#8230; back to manual trading for a while.</p><p>I think this was when I actually found the entrance to the rabbit hole. I started looking for anything and everything that was going to help me avoid that mistake again. I wanted a better trading platform, I wanted better testing techniques, I wanted in depth risk analysis with more data, I wanted my fucking money back!</p><p>I eventually dug myself out of that drawdown, but it was slow, and I was scared to take risks again. I even quit trading for a while, telling myself that I needed to know more, to learn more, so that I wouldn&#8217;t have any more black swan events like that one. Knowing what I know now, it is unfair to call it a black swan event. It was very possible for me to have known about that risk. I was just naive.</p><p>Anyway, I kept trading manually and I kept studying. HGT (that&#8217;s this Substack, keep up) started changing. I started focusing on mathematical concepts, and researching how to more accurately test strategies and research ideas. I looked into people like Jim Simons and picked up some obscure books, like those written by Timothy Masters.</p><p>There was no "aha!&#8221; moment. No mentor came to my rescue. There were times when I was in contact with other traders, but I eventually fell away from them all as I started learning more. I felt like I didn&#8217;t want any other influence while I was searching. It all felt hollow, like everyone had their own ideas and was confident they were correct. I wasn&#8217;t convinced.</p><p>During this time, I came to a conclusion: all day trading is gambling. Some people do it by feel; The cowboys, the  discretionary traders hyped up on <s>cocaine</s> caffeine, staring at charts all day long, year after year, fingers on the pulse (in the form of ticker tape, or the new age equivalent). Others study the data, monitor the news, and trade in a way that resembles valuation estimations, buying when an asset is undervalued, selling when it returns to value or holding it until it makes them millionaires (like anyone who bought Apple in the 90s).</p><p>People make a living gambling, right? The same principles apply: you need a system, you need to know the odds, you need to be able to read the room, and you need to know when to exit, before that big fucker in a suit who started moving closer to your table gets within reaching distance.</p><p>I asked myself, what is it that the pros are doing? What are the firms and people with too much money doing? Turns out, they are doing math. Lots of it. Hard math too. The kind that makes men weep, preferring instead to enter the breach once more, anything to avoid having to learn about something that can&#8217;t be fixed with a hammer or a bullet, let alone figure out what an epsilon means, or those tiny little numbers and letters below that weird fucking &#8216;E&#8217;.</p><p>After being displeased with every platform I was using, I decided to build something on my own. Enter quantKit. My way to give back to the community (assuming it is worth a damn).</p><p>But, there is a catch. It&#8217;s a pretty big undertaking, especially for someone who is self-taught. I didn&#8217;t go to school for this, I have never had a mentor (unless you count The Primeagen on YouTube), and I don&#8217;t have any idea if what I am doing is going to be any better than what others before me have done. I can guarantee this though: it will be free, it will be well documented, and it will be better than something proprietary, which requires you to conform to their way of thinking.</p><p>This undertaking has actually required me to stop trading actively, or day trading rather. It requires my full attention, which, as always, means that I ignore it until I feel overwhelming pressure and disappointment before binge studying/coding until my brain is leaking out of my ears and I am tired before noon every day.</p><p>That is the path though. This shit isn&#8217;t a flat stroll through the woods. It&#8217;s fucking treacherous. I don&#8217;t have any idea if there is anything at the end of this path or not, but I am sure as shit going to find out.</p><p>Because here's what keeps me up at night: maybe this is a game that can't be won. Maybe those retail traders making a living are just riding good luck until it runs out. Maybe when I see quant firms starting Substacks, dispensing wisdom like digital prophets, they're just the house telling the marks how to play better &#8212; keep losing, but with more style.</p><p>Am I building another tool to help people lose money more elegantly? At least it'll be free (as in speech). Maybe that's something. Maybe it's not.</p><p>The path to quant trading might not have a destination. But I'm walking it anyway.</p><p>Happy hunting everyone! Until the next one.</p><blockquote><p>This post doesn't represent any type of advice, financial or otherwise. Its purpose is to be informative and educational. Backtest results are based on historical data, not real-time data. There is no guarantee that these hypothetical results will continue in the future. Day trading is extremely risky, and I do not suggest running any of these strategies live.</p></blockquote><p><em>In case you were wondering where my usual AI art at the beginning of my articles went, after trying to defend the use of AI generated art on a Note thread, I convinced myself that I was indeed a piece of shit for using it. In place of it, you just get this explanation of why it isn&#8217;t there.</em></p><p></p>]]></content:encoded></item><item><title><![CDATA[Building quantKit -- Why I'm diving deep into stochastic finance]]></title><description><![CDATA[From burnout to breakthrough: Why I'm building quantKit from scratch]]></description><link>https://newsletter.huntgathertrade.com/p/building-quantkit-why-im-diving-deep</link><guid isPermaLink="false">https://newsletter.huntgathertrade.com/p/building-quantkit-why-im-diving-deep</guid><dc:creator><![CDATA[Larry Kann]]></dc:creator><pubDate>Sat, 07 Jun 2025 16:27:51 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ffFN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff20c5f89-c805-4de8-a07d-4ff37a6cc190_896x504.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p>Disclaimer: the following post is an organized representation of my research and project notes. It doesn't represent any type of advice, financial or otherwise. Its purpose is to be informative and educational. Backtest results are based on historical data, not real-time data. There is no guarantee that these hypothetical results will continue in the future. Day trading is extremely risky, and I do not suggest running any of these strategies live.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ffFN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff20c5f89-c805-4de8-a07d-4ff37a6cc190_896x504.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ffFN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff20c5f89-c805-4de8-a07d-4ff37a6cc190_896x504.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ffFN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff20c5f89-c805-4de8-a07d-4ff37a6cc190_896x504.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ffFN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff20c5f89-c805-4de8-a07d-4ff37a6cc190_896x504.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ffFN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff20c5f89-c805-4de8-a07d-4ff37a6cc190_896x504.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ffFN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff20c5f89-c805-4de8-a07d-4ff37a6cc190_896x504.jpeg" width="896" height="504" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f20c5f89-c805-4de8-a07d-4ff37a6cc190_896x504.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:504,&quot;width&quot;:896,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:60713,&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://newsletter.huntgathertrade.com/i/165416537?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff20c5f89-c805-4de8-a07d-4ff37a6cc190_896x504.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ffFN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff20c5f89-c805-4de8-a07d-4ff37a6cc190_896x504.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ffFN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff20c5f89-c805-4de8-a07d-4ff37a6cc190_896x504.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ffFN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff20c5f89-c805-4de8-a07d-4ff37a6cc190_896x504.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ffFN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff20c5f89-c805-4de8-a07d-4ff37a6cc190_896x504.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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>You know me - I hate vendor lock-in. I hate proprietary platforms that force you to think their way. And I really hate paying for tools that don't do exactly what I need them to do. So when I started working through "Stochastic Finance with Python" by Avishek Nag, it wasn't just academic curiosity. It was strategic.</p><p>I'm building quantKit because I want complete control over how I research and test trading strategies. But to build something truly useful, you need to understand the mathematical foundations that make quantitative finance actually work. That's where stochastic methods come in.</p><p>Of course, none of this excuses my radio silence recently. I have been a terrible content creator and a worse developer. I had so many things happen back to back that crushed my will and determination, planting me firmly in the "burn out" zone. Each time I thought everything was done, something else would happen. Then, when everything was done, I was too shot out to jump back into my work. My mind didn't want to focus, I couldn't force the work ethic, and I rapidly spiraled downward until I hit a ledge.</p><p>But it wasn't just exhaustion keeping me away. There's been this nagging feeling I can't shake - that most of the financial trading game is a setup. Like gambling, where the house is designed to win. Every platform wants their cut. Every data provider has restrictive agreements. Every backtesting engine forces you to think their way. And most retail traders? We're just playing at tables where we don't even know the real rules. </p><p>That's when the poker analogy really clicked for me...</p><h2>The Fundamental Truth About Markets (And Poker)</h2><p>Here's the thing everyone seems to forget: <strong>no one can predict the future. Full stop.</strong></p><p>Think about Texas Hold'em. Any decent player can calculate basic probabilities like the odds of hitting your flush draw or the probability of pocket aces. But that's just the starting point. The real game is about updating those probabilities in real-time based on how your opponents bet, when they get aggressive, when they get conservative, how often they bluff.</p><p>You're not just playing the cards. You're playing probability distributions that constantly shift based on new information and opponent behavior patterns.</p><p>Markets work the same way. There is no deterministic behavior in markets with unknown futures. Yet most trading platforms, backtesting engines, and even machine learning approaches treat uncertainty as noise to be filtered out rather than the fundamental nature of what we're trying to model.</p><p>This is backwards. Market uncertainty isn't a bug &#8212; it's a feature. It's the entire reason opportunities exist in the first place. And maybe, just maybe, if we stop pretending we can eliminate uncertainty and start modeling it properly, we can start figuring out the real rules of the game. Not enough to get kicked out of the casino, but enough to get what we need and walk away.</p><h2>What Makes Stochastic Finance Different</h2><p>Most people think quantitative finance is just about crunching numbers. It's not. It's about modeling uncertainty in a way that gives you an edge, like poker players who understand that the math is just the foundation for reading the game.</p><p>Here's the thing that clicked for me while working through this material:</p><p><strong>Traditional approaches assume you can predict exact outcomes. Stochastic methods assume you can predict probability distributions of outcomes that update based on new information.</strong></p><p>That's a massive difference. Instead of asking "what will this stock be worth tomorrow?", you're asking "what's the range of possible values, how likely is each one, and how should I update these probabilities as new information comes in?" </p><p>In poker terms: you're not just calculating your hand's strength - you're constantly updating your read on the entire table based on betting patterns, position, and player tendencies. For anyone building trading systems, this is gold.</p><p>Markets are fundamentally nondeterministic systems. The same market conditions can produce different outcomes because there are always unknown factors influencing price discovery. Stochastic methods embrace this reality instead of pretending it doesn't exist.</p><h2>Why This Matters for Strategy Development</h2><p>When I look at my previous strategies (the momentum systems, the mean reversion plays, the volatility-based approaches), they all work because they capture some aspect of market uncertainty. But most backtesting platforms treat this uncertainty as noise to be filtered out rather than signal to be modeled.</p><p>It's like playing poker but only looking at your own cards and ignoring everything else happening at the table.</p><p>Stochastic finance gives you the tools to:</p><ul><li><p><strong>Model the randomness directly</strong> instead of pretending it doesn't exist</p></li><li><p><strong>Quantify uncertainty</strong> in your forecasts (crucial for position sizing - your "bet sizing" in market terms)</p></li><li><p><strong>Build systems that adapt</strong> to changing market conditions (reading the table)</p></li><li><p><strong>Generate realistic scenarios</strong> for stress testing (playing against different opponent types)</p></li><li><p><strong>Create synthetic data</strong> that captures multiple market regimes your historical data might miss</p></li></ul><p>Take something as basic as calculating returns. Most platforms give you simple percentage returns and call it a day. But there's a reason quants prefer log returns: they have mathematical properties that make them much better for modeling and optimization. When you understand why these choices matter, you build better systems.</p><h2>The Real Problem with Proprietary Platforms</h2><p>Here's what really gets me: every backtesting platform makes assumptions about how you should model markets. RealTest assumes certain things about how you want to handle data. WealthLab has its own framework. Sierra Chart has its own approach. They're all good at what they do, but they're thinking for you.</p><p>It's like playing poker with someone else's strategy card that they won't let you modify.</p><p>Stochastic methods require you to think differently about fundamental concepts:</p><p><strong>Deterministic vs. Nondeterministic Systems</strong></p><ul><li><p>Your simple interest calculation? Deterministic. Same inputs always give same outputs.</p></li><li><p>Stock prices? Nondeterministic. Same market conditions can produce different outcomes.</p></li></ul><p>Most platforms are built for deterministic thinking. They want you to backtest as if the past will repeat exactly. Stochastic approaches assume the past gives you probability distributions, not exact forecasts.</p><h2>What I'm Building: The Foundation That Actually Makes Sense</h2><p>quantKit isn't trying to replace every trading platform. It's designed to give you the mathematical tools that most platforms ignore:</p><ol><li><p><strong>Proper uncertainty quantification</strong> - Instead of point estimates, get probability distributions</p></li><li><p><strong>Multiple return calculation methods</strong> - Simple, log, multiperiod - each with different mathematical properties</p></li><li><p><strong>Stochastic process modeling</strong> - Build systems that explicitly model randomness</p></li><li><p><strong>Flexible data handling</strong> - Work with any data source without vendor restrictions</p></li><li><p><strong>Realistic synthetic data generation</strong> - Create test scenarios based on actual stochastic processes</p></li><li><p><strong>Probabilistic backtesting</strong> - Test against multiple probable futures, not just one historical path</p></li><li><p><strong>Adaptive probability updating</strong> - Systems that adjust their "read" on market conditions in real-time</p></li></ol><p>The goal isn't to create another black box. It's to give you transparent, mathematically sound tools that you can modify, extend, and understand completely.</p><h2>Stochastic Methods + Machine Learning = The Future</h2><p>Here's where this gets really interesting. Stochastic finance isn't competing with machine learning - it's providing the mathematical foundation that makes ML applications to finance more robust and realistic.</p><p>Think of it this way: basic poker probabilities are like traditional ML models. But the real edge comes from combining those probabilities with dynamic reads on opponent behavior, position, betting patterns, and meta-game considerations. That's what stochastic methods + ML gives you in trading.</p><p><strong>For Simple Strategies</strong>:</p><p>Even an EMA crossover becomes more powerful when you can:</p><ul><li><p>Generate probability distributions for future crossover events</p></li><li><p>Size positions based on confidence levels (your "bet sizing")</p></li><li><p>Test against thousands of statistically valid market scenarios</p></li><li><p>Adapt to changing market "player types" (trending vs. choppy markets)</p></li></ul><p><strong>For Advanced ML Applications</strong>:</p><ul><li><p>Use stochastic processes as feature generators that capture market uncertainty</p></li><li><p>Train ML models on synthetically generated data that covers multiple market regimes</p></li><li><p>Build ensemble models where stochastic processes inform the base predictions</p></li><li><p>Get proper uncertainty quantification around your ML predictions</p></li><li><p>Create systems that update their "read" on market conditions just like a poker player adjusts to table dynamics</p></li></ul><p><strong>The Key Advantage</strong>:</p><p>Stochastic methods are less data hungry than pure ML approaches (crucial when clean financial data is expensive), more maintainable (you understand the mathematical relationships), and provide superior uncertainty quantification as a built-in feature rather than an afterthought.</p><h2>Real-World Applications</h2><p>Let me give you a concrete example. When I was developing Strategy 12 (the MES futures strategy with a profit factor of 2.03), I was essentially building a system that captured VIX/SPX relationship patterns using linear regression bands. But I was doing it intuitively, not mathematically.</p><p>With stochastic methods, you can:</p><ul><li><p>Model the underlying stochastic processes directly using stochastic differential equations</p></li><li><p>Quantify the uncertainty around your entry and exit signals</p></li><li><p>Generate multiple scenarios to test your position sizing</p></li><li><p>Build adaptive systems that adjust to changing volatility regimes (different "table dynamics")</p></li><li><p>Train ML models on synthetic data that captures regimes your historical data missed</p></li></ul><p>This isn't theoretical bullshit. These are practical tools that make your systems more robust.</p><h2>The Learning Process</h2><p>Working through this material has been eye-opening. Chapter 1 alone covers concepts that most trading platforms completely ignore:</p><ul><li><p>Why randomness in markets isn't noise -- it's the fundamental nature of price discovery</p></li><li><p><strong>How to think about financial instruments</strong> in terms of their stochastic properties</p></li><li><p><strong>Mathematical frameworks</strong> for modeling uncertainty that actually work</p></li></ul><p>The beautiful thing about building your own tools is that you understand every assumption being made. No black boxes. No "trust us, this works" algorithms. Just mathematical relationships you can verify and modify.</p><h2>Where This Is Heading</h2><p>I'm not abandoning everything else to become a pure quant. But understanding these foundations is making me a better system developer. When you know why log returns behave differently from simple returns, you make better choices about how to handle your data. When you understand the mathematical properties of different stochastic processes, you can design systems that are more aligned with how markets actually behave.</p><p>The crypto pivot I have been mentioning? That's partly about escaping restrictive data agreements, but it's also about having clean datasets to test these methods on. Crypto markets are perfect laboratories for stochastic methods because they're highly volatile, relatively new, and not constrained by traditional market structures.</p><h2>The Bottom Line</h2><p>Building quantKit isn't just about creating another backtesting tool. It's about building the first platform that properly integrates stochastic methods with modern machine learning techniques, giving users everything from simple probability-enhanced strategies to sophisticated ML systems built on sound mathematical foundations.</p><p>Most retail traders use tools built on these principles without understanding them. That's fine for some people, but I want to know exactly what's happening under the hood. More importantly, I want tools that acknowledge the fundamental truth about markets: they're uncertain by nature, and that uncertainty is where the opportunities live.</p><p>Just like in poker - the best players don't try to eliminate uncertainty. They embrace it, model it, and use it to their advantage.</p><p>If you're tired of being limited by what your platform thinks you should be able to do, this approach is worth considering. The math isn't insurmountable, and the tools you build will be exactly what you need them to be.</p><p>Plus, there's something deeply satisfying about solving problems with code that you actually understand, built on mathematical foundations that acknowledge reality instead of pretending it away.</p><p>Next week, I'll dive into the probability foundations and start showing some actual code. This is going to be a journey, but I think it's going to be worth it.</p><p>Happy hunting.</p><div><hr></div><p><em>Feel free to comment below or email me if you need help with anything, wish to criticize, or have thoughts on improvements. You can also DM me or start a chat thread. Red Team members can access this code and more at the private HGT GitHub repo. As always, this newsletter represents refined versions of my research notes. That means these notes are plastic. There could be mistakes or better ways to accomplish what I am trying to do. Nothing is perfect, and I always look for ways to improve my techniques.</em></p>]]></content:encoded></item><item><title><![CDATA[Tariffs, China, and the Real Cost of Chinese Manufacturing]]></title><description><![CDATA[This seems to be a hot topic for folks right now. Unfortunately, people seem to miss some key points when discussing this subject.]]></description><link>https://newsletter.huntgathertrade.com/p/tariffs-china-and-the-real-cost-of</link><guid isPermaLink="false">https://newsletter.huntgathertrade.com/p/tariffs-china-and-the-real-cost-of</guid><dc:creator><![CDATA[Larry Kann]]></dc:creator><pubDate>Thu, 08 May 2025 15:47:10 GMT</pubDate><enclosure url="https://substackcdn.com/image/youtube/w_728,c_limit/2wacXUrONUY" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p>Disclaimer: the following post is an organized representation of my research and project notes. It doesn&#8217;t represent any type of advice, financial or otherwise. Its purpose is to be informative and educational. Backtest results are based on historical data, not real-time data. There is no guarantee that these hypothetical results will continue in the future. Day trading is extremely risky, and I do not suggest running any of these strategies live.</p></blockquote><p>Okay, this is a new thing for me. Usually, I just stick to developing and finance specific research. However, the projects I want to explore for the rest of the year are going to require I do some heavy lifting first in Python. It seems very boring to write about the process and redundant to document it in more than one place. So, I decided to write about a topic I have been thinking about for some time and that seems to be on everyone's mind: US tariffs and Chinese (PRC) manufacturing.</p><p>First and foremost, I am not an expert. In anything. So, this is just an editorial or opinion piece. Whatever you want to call it. Where I can, I will reference sources I use to make my points.</p><p>Secondly, some of my information is second hand information that I received from US Federal Agents who worked overseas in China around the 2015 - 2019 time frame. So, that information is old, but still applicable. Other portions of my information come from literally living in China. In case you misunderstood that last sentence, I will state it again. I actually lived in China for months or so at a time. My wife lived outside of Shanghai and worked at private Chinese international school for 2 years. So, when I was in Iraq and got leave, I went to China (or other south Asian countries). I was in Hong Kong during the protests against the PRC taking over the SAR of Hong Kong. I will speak later on what happened with that...</p><p>Now that we have that out of the way, let's get into it.</p><h2>A collection of partial truths</h2><p>I'm going to post a few links here and briefly summarize the points of the speakers.</p><p>First up, Tim Cook (Apple CEO). I want to point out that I have been mostly impressed with Tim Cook taking over Apple. I wrote several papers on him in college that revolved around contrasting leadership styles. Anyway, the video is short, and he just gives his opinion on Chinese manufacturing and why they use it.</p><div id="youtube2-2wacXUrONUY" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;2wacXUrONUY&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/2wacXUrONUY?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><ul><li><p> Tim Cook says that we don't have the manufacturing infrastructure in the USA that the PRC has.</p></li><li><p>He also says they have more skilled laborers and engineers.</p></li></ul><p>Next, we've got one from Substack. I have seen a shit ton of these videos from various accounts, but they all pretty much say the same thing.</p><div class="comment" data-attrs="{&quot;url&quot;:&quot;https://open.substack.com/home&quot;,&quot;commentId&quot;:111964981,&quot;comment&quot;:{&quot;id&quot;:111964981,&quot;date&quot;:&quot;2025-04-25T12:42:12.095Z&quot;,&quot;edited_at&quot;:null,&quot;body&quot;:&quot;As I&#8217;ve been deep in research on the trade war between the US and China it is very odd to me to listen to US economists who seem totally divorced from reality of Chinese manufacturing in 2025 and the bespoke automation designed by CHINESE engineers and scientists.\n\nI stumbled on this clip from Nick Drom who absolutely aligns with my research.\n\nTrump is simply selling a dream from yesteryear that is frankly a joke. Front edge manufacturing is no longer people intensive.\n\n&#127909; TikTok - vm.tiktok.com/ZNd2rXcdc/&quot;,&quot;body_json&quot;:{&quot;type&quot;:&quot;doc&quot;,&quot;attrs&quot;:{&quot;schemaVersion&quot;:&quot;v1&quot;},&quot;content&quot;:[{&quot;type&quot;:&quot;paragraph&quot;,&quot;content&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;text&quot;:&quot;As I&#8217;ve been deep in research on the trade war between the US and China it is very odd to me to listen to US economists who seem totally divorced from reality of Chinese manufacturing in 2025 and the bespoke automation designed by CHINESE engineers and scientists.&quot;}]},{&quot;type&quot;:&quot;paragraph&quot;,&quot;content&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;text&quot;:&quot;I stumbled on this clip from Nick Drom who absolutely aligns with my research.&quot;}]},{&quot;content&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;text&quot;:&quot;Trump is simply selling a dream from yesteryear that is frankly a joke. Front edge manufacturing is no longer people intensive.&quot;}],&quot;type&quot;:&quot;paragraph&quot;},{&quot;type&quot;:&quot;paragraph&quot;,&quot;content&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;text&quot;:&quot;&#127909; TikTok - &quot;},{&quot;type&quot;:&quot;text&quot;,&quot;marks&quot;:[{&quot;type&quot;:&quot;link&quot;,&quot;attrs&quot;:{&quot;class&quot;:&quot;note-link&quot;,&quot;target&quot;:&quot;_blank&quot;,&quot;rel&quot;:&quot;nofollow ugc noopener&quot;,&quot;href&quot;:&quot;http://vm.tiktok.com/ZNd2rXcdc/&quot;}}],&quot;text&quot;:&quot;http://vm.tiktok.com/ZNd2rXcdc/&quot;}]}]},&quot;restacks&quot;:251,&quot;reaction_count&quot;:998,&quot;attachments&quot;:[{&quot;id&quot;:&quot;78ab6e3a-b120-4a44-aa25-a3b87ad099d4&quot;,&quot;user_id&quot;:309911880,&quot;comment_id&quot;:111964981,&quot;type&quot;:&quot;video&quot;,&quot;media_upload_id&quot;:&quot;c39f9c7e-e4b0-4023-ba2c-efc56436706c&quot;,&quot;mediaUpload&quot;:{&quot;id&quot;:&quot;c39f9c7e-e4b0-4023-ba2c-efc56436706c&quot;,&quot;name&quot;:&quot;1F5D2BE6-9476-4855-8EDC-1E90959474E3-23633-00000FBDF65F8C26.mp4&quot;,&quot;created_at&quot;:&quot;2025-04-25T12:42:02.601Z&quot;,&quot;uploaded_at&quot;:&quot;2025-04-25T12:42:08.276Z&quot;,&quot;publication_id&quot;:null,&quot;state&quot;:&quot;transcoded&quot;,&quot;post_id&quot;:null,&quot;user_id&quot;:309911880,&quot;duration&quot;:107.333336,&quot;height&quot;:1024,&quot;width&quot;:576,&quot;thumbnail_id&quot;:1,&quot;preview_start&quot;:null,&quot;preview_duration&quot;:null,&quot;media_type&quot;:&quot;video&quot;,&quot;primary_file_size&quot;:21201936,&quot;is_mux&quot;:true,&quot;mux_asset_id&quot;:&quot;BtrjUl01nK7Vf6ZddugFMoNh40200miKQxcw7OXDsvwOIo&quot;,&quot;mux_playback_id&quot;:&quot;ePaX88EiMkpZi1Y9n012jBQ5bv639Pri341RQiw2znYw&quot;,&quot;mux_preview_asset_id&quot;:null,&quot;mux_preview_playback_id&quot;:null,&quot;mux_rendition_quality&quot;:&quot;high&quot;,&quot;mux_preview_rendition_quality&quot;:null,&quot;explicit&quot;:false,&quot;copyright_infringement&quot;:null,&quot;src_media_upload_id&quot;:null,&quot;live_stream_id&quot;:null}}],&quot;name&quot;:&quot;Truth Matters&quot;,&quot;user_id&quot;:309911880,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a28705bb-a96d-4f68-a970-7c8b2ed9d11f_400x400.jpeg&quot;,&quot;user_bestseller_tier&quot;:100}}" data-component-name="CommentPlaceholder"></div><ul><li><p>There is a knowledge gap in how this manufacturing works.</p></li><li><p>A lot of this technology was developed in China by Chinese engineers and scientists.</p></li><li><p>A lot of this technology has never been made in the USA. Full stop.</p></li><li><p>White folk don&#8217;t tend to research brushless motor technology&#8230;</p></li></ul><p>Ok, that last bullet point is a joke, but he did point out that you don&#8217;t see many American (or European) names on the research papers, or they aren&#8217;t the majority. Brushless motors are pretty specific, so we can chock that up to an anecdotal joke. However, I have a theory as to why you might see this type of disparity and why there are more Chinese engineers and scientists.</p><p>These are the only two videos I am going to use because ever since Tim Cook&#8217;s comments, everyone seems to be jumping onto this same concept to make points against US tariff&#8217;s on China and to try and change the perspective of the American majority that seems to not quite understand everything that is going on here.</p><p>I think they missed the point too. As a matter of fact, I believe the information they are giving is purposefully misleading. They aren&#8217;t wrong. Not even close. They are stating facts, but they aren&#8217;t stating the ones that matter&#8230;</p><h2>Cost</h2><p>Tim Cook makes the claim that Apple (and presumably other technology companies) doesn&#8217;t go to China because it&#8217;s cheaper. He says that they stopped being cheap some time ago and that they use them solely for their expertise and infrastructure.  I want to break this down, because what he is saying isn&#8217;t exactly true. Actually, it's nowhere near true. It omits some pretty crucial points to consider when discussing &#8220;costs&#8221;.</p><p>Let's be real here - China's impressive manufacturing setup didn't just magically appear. It was deliberately built using our money, our technology, and massive government manipulation. The U.S.-China Economic and Security Review Commission (USCC, 2023) documented how American companies handed over billions in tech and manufacturing know-how just to access the Chinese market. We literally funded the creation of our future competition. And according to the Congressional Research Service, the Chinese government then piled on with massive subsidies, practically free land, and artificially cheap energy for manufacturing zones. The type of stuff that would get you slapped with WTO violations in any Western country (Morrison, 2023).</p><p>And the human cost? Absolutely staggering. The Lancet found that air pollution from this rapid industrialization killed about 1.24 million Chinese people annually (Burnett et al., 2020). That's not a typo. The International Labour Organization has documented systematic abuse of workers, with hours and safety conditions that would get you shut down instantly in the U.S. (ILO, 2022). Then there's China's "hukou" system, which Harvard's Ash Center studied extensively, that basically creates a second-class workforce of migrants with zero local rights or protections (Liang &amp; Lu, 2021). So yeah, of course Chinese manufacturing is "cheaper" than U.S. production&#8212;they're playing a completely different game with different rules, cutting corners that American companies legally can't.</p><p>In case you forgot about what working conditions in even Apple&#8217;s Chinese factories, here is a post from The Guardian to help remind you:</p><p><a href="https://www.theguardian.com/technology/2017/jun/18/foxconn-life-death-forbidden-city-longhua-suicide-apple-iphone-brian-merchant-one-device-extract">Life and death in Apple's forbidden city</a></p><h2>Expertise</h2><p>I am going to take the low hanging fruit first. The USA has a population of 334 million and the PRC has 1.4 <em>billion</em>. Do I need to explain how this math works?</p><p>When Tim Cook and others brag about China having more engineers and skilled laborers, they're conveniently ignoring basic population math. Of course China produces more engineers - they have more than four times our population! But the story goes much deeper than raw numbers.</p><p>What they're not telling you is how China's education system actually works. Unlike America, where students generally choose their own career paths, China's government actively directs education priorities based on national economic goals. The Ministry of Education literally sets quotas for engineering graduates to meet industrial needs (Li, 2019). This isn't about natural interest or market demand - it's central planning in action.</p><p>And those Chinese engineers? They earn dramatically less than their American counterparts. According to salary data from Glassdoor, the average engineer in China makes about $35,000 annually compared to $105,000 in the US (Glassdoor, 2023). So when tech execs praise China's "engineering talent," they're really saying "we can hire three Chinese engineers for the price of one American." That's not about superior skill - it's about cheaper labor dressed up as expertise.</p><p>Then there's the uncomfortable truth about innovation in China. A 2022 report from the Office of the U.S. Trade Representative estimated that Chinese intellectual property theft costs American businesses between $225 billion and $600 billion annually (USTR, 2022). Much of China's technological "development" comes from stealing and reproducing Western innovations. So when you see those Chinese names on research papers, remember that foundation was often built on technology that was either forcibly transferred or outright stolen.</p><p>Let's be honest about what's happening: China's engineering workforce isn't some magical resource that America lacks. It's the product of government-directed education, dramatically lower wages, and a system that has historically rewarded copying rather than creating. That's the reality behind the "expertise" argument.</p><p>I'm not suggesting China is incapable of innovation - far from it. In recent years, China has made advances in areas like mobile payment systems, high-speed rail, and renewable energy technology. However, there's an important context to this innovation timeline. The IP Commission, a bipartisan initiative led by Admiral Dennis Blair and Governor Jon Huntsman Jr., specifically recommended in 2021 that the U.S. "set a national goal to delegitimize Chinese indigenous innovation efforts that are dependent on the theft of foreign IP" (IP Commission, 2021). The Commission also noted that IP theft costs the U.S. economy "hundreds of billions of dollars annually and reduces U.S. companies' R&amp;D investment and innovation." China's technological leap forward came only after decades of acquiring foreign technology through joint ventures, technology transfer requirements, and forced technology transfer. It's much easier to innovate when you're building on a foundation of existing technology rather than developing it from scratch. The key point isn't that China can't innovate - it's that their current innovation capacity was jump-started through years of policies that appropriated technologies developed elsewhere at significant cost.</p><h2>Personal Experience</h2><p>Like I mentioned in the beginning of this post, my wife actually lived in and worked full-time in China. I spent several months there myself when I was on leave between the years of 2017 and 2020. Something tells me that a lot of people who speak about China, or defend their actions, have never actually been to China.</p><p>First, getting a visa isn't easy. Even with my spouse there, I had to hang out in Hong Kong for several weeks to work the system, eventually getting a 10-year business visa. This process wasn't easy, and it required business practices that are probably illegal in the USA.</p><p>While I was in Hong Kong, there were a lot of protests and riots. These were in an attempt to keep the PRC from having complete control over the SAR area of Hong Kong. This was a huge deal for the local nationals of the SAR (mostly Cantonese if I remember correctly). Then, in 2020, while the whole world was too busy paying attention to COVID-19, the PRC implemented the 2020 National Security Law and cleaned house. According to Human Rights Watch, this law criminalized virtually any form of dissent with vague charges like "subversion" and "collusion with foreign forces" (HRW, 2020). Within days, pro-democracy activists were arrested, books were removed from libraries, and freedom of speech effectively died. The PRC now has complete control of the area. This is just an example of how their government operates.</p><p>Then there is China actual and let me tell you, it reads just like your favorite books about society's potential future. Shanghai was a cool city. Public transportation was really good too. The air quality is terrible (read cancerous) and even if the streets don't have cars on them for miles, no one will cross the street until the crosswalk light turns and they wouldn't cross the street anywhere except where there is a designated cross walk.</p><p>At first, I thought that this was just a side effect of a culture built around respect, like Japan. But after actually talking to Chinese people (the few that spoke English well enough), I discovered that isn't the case. What keeps them from jay-walking? Fear. This fear of their government is so real that I had people return change to me at the wet market because they were afraid someone would report them for stealing it. This was change that didn't even add up to fifty cents in USD.</p><p>Research from the University of California confirms this observation - China's social credit system has created a pervasive surveillance state where citizens monitor their own behavior out of fear of consequences (Creemers, 2022). Every aspect of daily life - from crossing streets to online comments - carries the potential for punishment. This is the social control system that our manufacturing dollars help support.</p><p>I told you that my wife was a teacher, right? One day, while at work, she went to lunch, did some planning with folk, and then went back to her classroom. In the time that she was gone, the government had people inspect rooms (foreigner rooms). She had a bunch of random posters and such on the wall in English. All American-oriented posters (as all of her students were attempting to get into Western colleges) were ripped off the wall and replaced with PRC flags, creeds, and propaganda. Why do I say propaganda? Well, what would you call government advertising that says Tiananmen Square never happened and that Americans made it up?</p><p>This isn't isolated. According to a report from Freedom House, the Chinese government employs over two million "internet opinion analysts" to monitor and censor online content and extends this control into every aspect of education and daily life (Freedom House, 2021). What Tim Cook and others conveniently ignore is that when we manufacture in China, we're not just getting "infrastructure" and "expertise" - we're financially supporting one of the most sophisticated authoritarian control systems ever created.</p><h2>Closer to enemies than friends</h2><p>While American companies pour billions into Chinese manufacturing, we're overlooking a disturbing reality: China actively works against critical U.S. interests in ways that resemble hostile action more than friendly competition. The devastating fentanyl crisis killing over 70,000 Americans annually has direct links to China. According to a 2022 DEA report, Chinese chemical companies remain the primary source of fentanyl precursors and manufacturing equipment for Mexican cartels like Jalisco New Generation (DEA, 2022). Even after China's supposed crackdown on direct fentanyl production, they simply shifted to supplying the ingredients and equipment to Mexican partners, maintaining their role in a supply chain that's killing Americans daily.</p><p>This pattern extends beyond narcotics. The FBI has identified China as "the greatest long-term threat to our nation's information and intellectual property, and to our economic vitality" (FBI, 2023). Their analysis documented over 2,000 active investigations tied to the Chinese government, with new cases opening every 12 hours on average. The U.S. Cybersecurity and Infrastructure Security Agency (CISA) has attributed numerous sophisticated attacks on American infrastructure, government agencies, and businesses to state-sponsored Chinese hackers, including the massive Microsoft Exchange breach affecting tens of thousands of organizations (CISA, 2022). These aren't random criminals but coordinated operations with government backing.</p><p>Perhaps most concerning is China's strategic relationship with America's clearest adversaries. A 2023 Pentagon report detailed China's provision of dual-use technology and components to both Russia and Iran, materially supporting countries that openly threaten U.S. interests (DoD, 2023). The report noted that Chinese companies have supplied drone components used in Ukraine and missile technology utilized by Iran's proxies across the Middle East. This creates the disturbing scenario where American consumer dollars spent on Chinese-manufactured goods indirectly fund technologies being used against our allies and interests. When Tim Cook and others defend Chinese manufacturing as simply about "infrastructure" and "expertise," they conveniently omit this darker reality: we're economically strengthening a nation that systematically undermines American security across multiple fronts.</p><h2>Now, let&#8217;s talk tariffs</h2><p>Finally, we arrive at the topic at hand. When critics suggest that tariffs on Chinese goods are misguided or harmful, they're deliberately obscuring the complex reality we've just explored. Tariffs aren't simply about protecting American jobs or bringing manufacturing back - though these are worthy goals. They're about addressing a fundamentally uneven playing field created by decades of strategic manipulation.</p><p>The economic case for tariffs is straightforward: they help offset the artificial cost advantages China has created through labor exploitation, environmental degradation, intellectual property theft, and massive state subsidies. According to a 2023 Economic Policy Institute analysis, the U.S. lost approximately 3.7 million jobs to China between 2001-2021, with the greatest impact felt in manufacturing communities that haven't recovered (Scott &amp; Mokhiber, 2023). Tariffs create space for American manufacturing to rebuild without competing against a system designed to undercut fair competition.</p><p>Critics argue that tariffs ultimately hurt American consumers through higher prices. This narrow view ignores the broader economic and social costs of our China dependence. A RAND Corporation study estimated that IP theft alone costs the U.S. economy between $225-600 billion annually - costs that are distributed across all Americans whether they realize it or not (RAND, 2022). The Peterson Institute calculated that increased production diversity and reduced supply chain vulnerability resulting from reshoring critical industries would provide long-term economic benefits that outweigh short-term price increases (Lovely &amp; Xu, 2023).</p><p>Beyond economics, tariffs represent one of the few meaningful policy tools available to address China's systematic human rights abuses. The U.S. Holocaust Memorial Museum and the State Department have officially recognized China's treatment of Uyghurs as genocide, with forced labor being a central component (USHMM, 2021). When American companies manufacture in China without consequence, they become complicit in a system that violates our most basic values. Tariffs create economic consequences for this complicity and provide leverage for demanding change.</p><p>The fundamental question isn't whether tariffs will cause some short-term economic disruption - they will. The question is whether Americans are willing to pay a modest premium on consumer goods to support a manufacturing system that doesn't rely on authoritarian control, environmental destruction, worker exploitation, and technology theft. When viewed through this lens, tariffs aren't just economically justified; they're a moral imperative for a nation that claims to stand for freedom, fairness, and human dignity.</p><h2>My Conclusions</h2><p>I want to make sure that you understand that the conclusions I draw from this are personal. I know that people will see things differently than me. That's cool. It's good for conversation. The points that I bring up here are all backed by sound references and are rooted (to the best of my ability) in some core truths about China and how they operate.</p><p>So, what is my take?</p><p>I look at this through a very simple lens. I am not just American, I actually believe in what we are supposed to stand for and represent: freedom and equality for all. I don't believe that any company that sells to Americans should be able to profit more by abusing countries that do not have the standards and beliefs we do. I believe when you look at the facts, and the terrible/inhumane history of modern China, it becomes very difficult to support ANYONE who wishes to take advantage of disadvantaged people.</p><p>The fundamental disconnect in how we talk about Chinese manufacturing comes down to values. When Tim Cook and others frame their manufacturing choices as being about "infrastructure" and "expertise," they're deliberately avoiding the moral dimension of their decisions. According to business ethics research from the University of Pennsylvania's Wharton School, companies engage in this type of "ethical fading" when they reframe moral choices as purely business decisions (Tenbrunsel &amp; Messick, 2021). This allows executives to sleep at night while their companies profit from systems they would never tolerate in their home countries.</p><p>What's particularly frustrating is the dishonesty. If Cook simply said, "Look, we manufacture in China because it's dramatically more profitable despite the ethical concerns," I'd at least respect the transparency. Instead, we get this carefully constructed narrative about Chinese manufacturing superiority that conveniently omits the human rights abuses, environmental devastation, and authoritarian control that make their "efficiency" possible. As documented by the Business &amp; Human Rights Resource Centre, American companies have repeatedly failed to meaningfully address forced labor in their Chinese supply chains despite public commitments to ethical standards (BHRRC, 2022).</p><p>The tariff debate ultimately isn't about economics or even politics &#8211; it's about what kind of world we want to live in. When we purchase products manufactured in China without any economic consequences, we're tacitly endorsing a system that contradicts our most fundamental values. The Princeton philosopher Peter Singer has argued convincingly that our purchasing decisions have moral weight &#8211; they reflect what we're willing to accept and what we're willing to ignore (Singer, 2022). By this measure, our current trade relationship with China represents a massive moral compromise that we've normalized through clever marketing and willful ignorance.</p><p>I'm not suggesting we cut off all trade with China overnight or pretend there aren't complex economic realities at play. What I am suggesting is honesty about what we're actually doing and the true costs involved. Tariffs represent one imperfect but necessary step toward a trading system that aligns with our values rather than undermining them. If that means paying a bit more for our iPhones or accepting that some things can't be as cheap as they once were, that seems like a small price to pay for a world where prosperity doesn't depend on exploitation.</p><p>I don't have a solution for our problems, but I don't think we can go wrong if we keep our values and look at this through a lens that considers the humans that make it happen. When we strip away the marketing language, the economic theories, and the geopolitical complexities, we're left with a simple truth: <strong>our manufacturing choices have human consequences</strong>. Every purchase decision connects us to the hands that assembled our products and the systems that govern their lives. If we truly believe in human dignity, environmental stewardship, and fair competition, then we must demand that our economic relationships reflect these values. Perhaps that's the true measure of "expertise" and "infrastructure" that should matter most. The question isn't just how efficiently we can produce goods, but whether we can do so in ways that uplift rather than exploit the people involved. The most advanced manufacturing system in the world isn't worth much if it's built on human suffering. That's a truth no tariff debate can ever change.</p><p>As always, comment if you have something to say. If I got something wrong, let me know. If you disagree with my assessment, tell me why. Just remember, I strongly believe that ALL humans are worthy of freedom, equality, and entitled to live a life of love and peace. If you believe that I am not supposed to apply that to people who aren't American, we can't have a constructive conversation. I don't bend those beliefs just because another country or government doesn't believe in them. The way I see it, if we're willing to compromise on our fundamental values for economic convenience, then those values weren't really fundamental to begin with. And that's a far greater cost than any tariff could ever impose.</p><h2>References</h2><ol><li><p>USCC. (2023). Annual Report to Congress. U.S.-China Economic and Security Review Commission. Washington, DC: U.S. Government Publishing Office.</p></li><li><p>Morrison, W. M. (2023). China's Economic Rise: History, Trends, Challenges, and Implications for the United States. Congressional Research Service Report RL33534.</p></li><li><p>Burnett, R., Chen, H., Szyszkowicz, M., et al. (2020). Global estimates of mortality associated with long-term exposure to outdoor fine particulate matter. The Lancet, 391(10130), 1639-1649.</p></li><li><p>ILO. (2022). Labour standards in global supply chains: A programme of action for Asia and the garment sector. International Labour Organization. Geneva: ILO Publishing.</p></li><li><p>Liang, Z., &amp; Lu, J. (2021). Hukou Reform and Migration in China: Causes and Consequences. Harvard Kennedy School Ash Center for Democratic Governance and Innovation.</p></li><li><p>Li, Y. (2019). China's educational policy making: A policy analysis perspective. Journal of Education Policy, 34(5), 763-786.</p></li><li><p>Glassdoor. (2023). Salary Comparison: Engineers in United States vs. China. Glassdoor Economic Research.</p></li><li><p>USTR. (2022). Annual Report on Intellectual Property Protection and Enforcement. Office of the United States Trade Representative.</p></li><li><p>WIPO. (2020). World Intellectual Property Indicators 2020. World Intellectual Property Organization.</p></li><li><p>IP Commission. (2021). The Report of the Commission on the Theft of American Intellectual Property. National Bureau of Asian Research.</p></li><li><p>HRW. (2020). China: New Hong Kong Law a Roadmap for Repression. Human Rights Watch.</p></li><li><p>Creemers, R. (2022). China's Social Credit System: An Evolving Practice of Control. University of California Press.</p></li><li><p>Freedom House. (2021). Freedom on the Net 2021: China. Freedom House</p></li><li><p>DEA. (2022). 2022 National Drug Threat Assessment. Drug Enforcement Administration.</p></li><li><p>FBI. (2023). China's Economic Espionage and Theft of American IP. Federal Bureau of Investigation.</p></li><li><p>CISA. (2022). Chinese Government-Sponsored Cyber Operations: Observed TTPs. Cybersecurity and Infrastructure Security Agency.</p></li><li><p>DoD. (2023). Military and Security Developments Involving the People's Republic of China. Department of Defense Annual Report to Congress.</p></li><li><p>Scott, R. E., &amp; Mokhiber, Z. (2023). The China Trade Toll Revisited: U.S. Jobs Lost, Trade Deficit Increase, Twenty Years After China's Entry Into the WTO. Economic Policy Institute.</p></li><li><p>RAND. (2022). Economic Costs of Intellectual Property Theft: An Analysis of the Impact on the U.S. Economy. RAND Corporation.</p></li><li><p>Lovely, M., &amp; Xu, B. (2023). Resilient Supply Chains and Economic Security in a Post-Pandemic World. Peterson Institute for International Economics.</p></li><li><p>USHMM. (2021). "To Make Us Slowly Disappear": The Chinese Government's Assault on the Uyghurs. United States Holocaust Memorial Museum.</p></li><li><p>Tenbrunsel, A. E., &amp; Messick, D. M. (2021). Ethical Fading: The Role of Self-Deception in Unethical Behavior. Wharton School, University of Pennsylvania.</p></li><li><p>BHRRC. (2022). Beyond Compliance: Effective Reporting Under Modern Slavery Laws. Business &amp; Human Rights Resource Centre.</p></li><li><p>Singer, P. (2022). The Most Good You Can Do: How Effective Altruism Is Changing Ideas About Living Ethically. Yale University Press.</p></li></ol><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Updating quantKit, the Python tool kit we are creating for research]]></title><description><![CDATA[Discussing updates to Python code base and goals for the project.]]></description><link>https://newsletter.huntgathertrade.com/p/updating-quantkit-the-python-tool</link><guid isPermaLink="false">https://newsletter.huntgathertrade.com/p/updating-quantkit-the-python-tool</guid><dc:creator><![CDATA[Larry Kann]]></dc:creator><pubDate>Fri, 18 Apr 2025 17:38:04 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!gS4Q!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a312b9-0fc9-4f4c-bded-84ec5b8d2b2d_1246x912.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p>Disclaimer: the following post is an organized representation of my research and project notes. It doesn&#8217;t represent any type of advice, financial or otherwise. Its purpose is to be informative and educational. Backtest results are based on historical data, not real-time data. There is no guarantee that these hypothetical results will continue in the future. Day trading is extremely risky, and I do not suggest running any of these strategies live.</p></blockquote><p>Ok, my break was too long. After the basement flooding issue, my father had a medical emergency and has been in and out of ICU for the last month. With everything going on, I fell off for a bit, but now I am back and ready to work.</p><p>As we know, I am shifting focus for the time being to research and creating tools to help us research trade systems better, and without vendor lock-in. That's the goal, anyway. Ultimately, it is going to be a learning process, so we can learn why our tools matter and how they improve our testing and research process. For me (HGT), this will consist of 3-4 distinct projects.</p><p>I am going to focus on creating a set of tools for testing in Python, building on the statistical testing tools I created last year for feature/indicator testing. I am also going to focus on creating strategy and indicator libraries for RealTest and Wealth 8 for the HGT users to play with and use. While learning how to create tools in Python, I will also work on building a platform for testing and running algorithmic strategies in Zig.</p><p>Today, we focus on what has been updated so far in the Python tools and where to access the project ( it's open source).</p><p>First, the name of the project is quantKit, and the goal is to make an efficient backtesting and researching tool set for algorithmic trade system development. I have no intentions of using this tool for live trading, so I won't focus on that part.</p><p>If you recall from any of the statistical testing posts, we had several tests that we created in this project. Some tests were simple, others more complex. While they worked, and matched the calculations and logic from the source material, they weren't the most efficiently written functions. So, my goal is to go back through these functions and refactor them to be more efficient.</p><p>I also intend to begin orienting the tool to be used from the command line. This means that everything will be printed to the command line first, and saved to file second (or at user request). The idea is to streamline development and remove any abstractions that could create more overhead or limit developer capability.</p><p>As an example, I went through the first test in the library and updated it to use Numpy's built in vector functions to increase the speed of the test by 85%. This is the simplest test of the bunch, and was already pretty fast, so I don't know what kind of performance increase we will see at the end, but I am hopeful that we can get the overall testing speed down to something more reasonable when testing a large amount of features. The photo below shows an example of how long it took to generate the simple stats report ( with relative entropy).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gS4Q!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a312b9-0fc9-4f4c-bded-84ec5b8d2b2d_1246x912.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gS4Q!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a312b9-0fc9-4f4c-bded-84ec5b8d2b2d_1246x912.png 424w, https://substackcdn.com/image/fetch/$s_!gS4Q!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a312b9-0fc9-4f4c-bded-84ec5b8d2b2d_1246x912.png 848w, https://substackcdn.com/image/fetch/$s_!gS4Q!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a312b9-0fc9-4f4c-bded-84ec5b8d2b2d_1246x912.png 1272w, https://substackcdn.com/image/fetch/$s_!gS4Q!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a312b9-0fc9-4f4c-bded-84ec5b8d2b2d_1246x912.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gS4Q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a312b9-0fc9-4f4c-bded-84ec5b8d2b2d_1246x912.png" width="1246" height="912" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/59a312b9-0fc9-4f4c-bded-84ec5b8d2b2d_1246x912.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:912,&quot;width&quot;:1246,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:870199,&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://newsletter.huntgathertrade.com/i/161624619?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a312b9-0fc9-4f4c-bded-84ec5b8d2b2d_1246x912.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_!gS4Q!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a312b9-0fc9-4f4c-bded-84ec5b8d2b2d_1246x912.png 424w, https://substackcdn.com/image/fetch/$s_!gS4Q!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a312b9-0fc9-4f4c-bded-84ec5b8d2b2d_1246x912.png 848w, https://substackcdn.com/image/fetch/$s_!gS4Q!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a312b9-0fc9-4f4c-bded-84ec5b8d2b2d_1246x912.png 1272w, https://substackcdn.com/image/fetch/$s_!gS4Q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a312b9-0fc9-4f4c-bded-84ec5b8d2b2d_1246x912.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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>Not too shabby, right? This section is so simple that adding in multiprocessing for this test actually slowed down the overall speed of the report. I imagine I will see multiprocessing become more useful as we get to the more computational intensive tasks and permutation testing.</p><p>Next up is the mutual information function, then the mean break test, and lastly the optimal threshold test. Once these are complete, I will shift over to the backtesting engine and data management.</p><p>Check out the Python project repo below:</p><p><a href="https://github.com/larrykann/quantKit">quantKit Repository</a></p><p>Happy hunting!</p><p>Feel free to comment below or e-mail me if you need help with anything, wish to criticize, or have thoughts on improvements. You can also DM me or start a chat thread. Red Team members can access this code and more at the private <a href="https://github.com/Hunt-Gather-Trade">HGT GitHub repo</a>. As always, this newsletter represents refined versions of my research notes. That means these notes are plastic. There could be mistakes or better ways to accomplish what I am trying to do. Nothing is perfect, and I always look for ways to improve my techniques.</p>]]></content:encoded></item><item><title><![CDATA[HGT Polls]]></title><description><![CDATA[I want to know what you think, so I created a bunch of polls to find out.]]></description><link>https://newsletter.huntgathertrade.com/p/hgt-polls</link><guid isPermaLink="false">https://newsletter.huntgathertrade.com/p/hgt-polls</guid><dc:creator><![CDATA[Larry Kann]]></dc:creator><pubDate>Mon, 17 Mar 2025 15:23:06 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6c9fff4-8eb5-4173-ab8a-84a15607ce21_1024x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A collection of polls, so I can get to know you better. </p><div class="poll-embed" data-attrs="{&quot;id&quot;:288952}" data-component-name="PollToDOM"></div><p>What about markets? What is general lean here.</p><div class="poll-embed" data-attrs="{&quot;id&quot;:288956}" data-component-name="PollToDOM"></div><p>How do you like to learn/consume content?</p><div class="poll-embed" data-attrs="{&quot;id&quot;:288957}" data-component-name="PollToDOM"></div><p>I don&#8217;t do video, but I could get into it. </p><div class="poll-embed" data-attrs="{&quot;id&quot;:288959}" data-component-name="PollToDOM"></div><p>Let&#8217;s talk about programming languages.</p><div class="poll-embed" data-attrs="{&quot;id&quot;:288960}" data-component-name="PollToDOM"></div><p>What do you think about the recent shift in focus? Lay it on me.</p><div class="poll-embed" data-attrs="{&quot;id&quot;:288963}" data-component-name="PollToDOM"></div>]]></content:encoded></item><item><title><![CDATA[Updates -- TL;DR -- 03/17/2025]]></title><description><![CDATA[Stop updating and start publishing real content, Larry.]]></description><link>https://newsletter.huntgathertrade.com/p/updates-tldr-03172025</link><guid isPermaLink="false">https://newsletter.huntgathertrade.com/p/updates-tldr-03172025</guid><dc:creator><![CDATA[Larry Kann]]></dc:creator><pubDate>Mon, 17 Mar 2025 14:58:13 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6c9fff4-8eb5-4173-ab8a-84a15607ce21_1024x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This is a follow up to:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;7d5bdb99-7c97-4cd7-a8b3-7d22b05945f4&quot;,&quot;caption&quot;:&quot;Disclaimer: the following post is an organized representation of my research and project notes. It doesn&#8217;t represent any type of advice, financial or otherwise. Its purpose is to be informative and educational. Backtest results are based on historical data, not real-time data. There is no guarantee that these hypothetical results will continue in the fu&#8230;&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;md&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Stare long into the abyss...&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:104503946,&quot;name&quot;:&quot;Larry Kann&quot;,&quot;bio&quot;:&quot;I'm a trader, a father, a writer, and a husband. Before I was a trader, I was a damn good (self-proclaimed) paramedic. I dabble in programming Automated Trade Systems and I dig text manipulation tools, the terminal, and Linux.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9414cf23-7f4e-4f37-a6c2-3880d82c2a88_696x696.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-03-17T14:08:26.914Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4691a608-9876-42b9-9e4e-d6c76f0761ae_1024x1024.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://newsletter.huntgathertrade.com/p/stare-long-into-the-abyss&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:159253389,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:0,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;Hunt Gather Trade&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6c9fff4-8eb5-4173-ab8a-84a15607ce21_1024x1024.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>I am just summing up the changes and sketching a tentative timeline.</p><h3>Changes</h3><ul><li><p>No more proprietary platforms. This means I am shifting my entire focus to modelling and testing trade systems in Python. </p></li><li><p>No more Windows only and restrictive data providers. The previous article talked about why this change is happening. </p></li><li><p>Because of the two aforementioned points, I will be shifting my focus to using Cryptocurrency data for this development and testing process.</p></li><li><p>My Windows machine will become a network machine. This will give me access to any Windows specific needs, such as&#8230;</p></li><li><p>WealthLab 8 (WL8) will become the Windows platform of choice (at least for the next year). This platform appears to offer the most bang for your buck.</p></li><li><p>Paid subscribers will get access to the WL8 libraries and the paid content on Substack (obviously). All articles will still breakdown strategies in a way that they can be used in your platform of choice and will be accompanied by Python code for them as well.</p></li><li><p>Python tools will be made open source, so anyone can access them and play with them.</p></li></ul><h3>Why?</h3><p>I want to enjoy what I do, and this change will facilitate that. I love coding and I love having an intuitive coding environment that gives me control over everything I need. I also like using open-source tools and non-proprietary solutions for my needs. Embracing this will allow me to produce more content for the subscribers as a higher rate. I can document the entire process and provide value to other people who endeavor to participate in this field.</p><h3>Tasks and Timeline</h3><ul><li><p>Install Linux on desktop machine and setup current laptop as a network machine.</p></li></ul><ul><li><p>Move <code>quantKit</code> (previously just called <code>pyquanttools</code>) to a public repo and add open-source licensing. This will be the base of the tools I develop for research in Python.</p></li><li><p>Create extension libraries for WL8 to house indicators and strategies.</p><ul><li><p>This will take some a little time. Subscription based licensing will be first, and then I will start translating indicators and strategies into the libraries as we progress forward.</p></li></ul></li><li><p>Begin developing a trade simulation engine for <code>quantKit </code>turning it into a proper Python library/command line tool for easier use. </p></li><li><p>Archive HGT repos and setup new structure for GitHub repo to house Python indicators and strategies.</p></li></ul><p>I estimate that by the end of this week I will have my Windows machine setup as a remote network device. After that, the first thing we have to develop is the trade simulation (or backtesting) engine in Python. This is going to start out pretty basic, and we will fine tune it as we go along. </p><p>So, by next week I should be working the Python tools and getting indicators and strategies translated into C# for use in WL8. From there, it becomes much harder to create a proper timeline. I don&#8217;t know how long it will take developing the simulation engine before we get to test a strategy idea. I plan on trying to make this engine reliable, with a focus on statistical analysis and math.</p><p>During the engine development phase, I will still be able to create new indicators and translate indicators into C#, so I won&#8217;t just be posting about the development process.</p><p>Ideally, I would like to have up to date WL8 extensions and a working simulation engine inside 30 days. Unfortunately, I am keenly aware of how bad we (humans) are at guessing at how long it will take us to accomplish something. With that in mind, I will double it to 60 days, just to be safe.</p><h3>Summary</h3><p>This is a big shift. I know. But I don&#8217;t enjoy the games I am currently having to play, and I don&#8217;t want to stop researching, writing, and trading. So, I need to do it my way. A way that aligns with my principles and that I enjoy doing.</p><p>I plan to dabble in producing video content as well. We shall see how this goes. My time without toddler noise is limited, so I will have to play around with how I do this.</p><p>If anyone has any questions or concerns, reach out to me via message or email.</p><p>I am going to put out a poll or chat (or both, idk how they work yet) to see what strategies and indicators y&#8217;all want to see translated into C# first and what subjects you want to focus on.</p><p>As always, remember that I am not a professional anything. This is just something I love doing and researching.</p><p>Happy hunting.</p>]]></content:encoded></item><item><title><![CDATA[Stare long into the abyss...]]></title><description><![CDATA[Gettin' existential in this one, bruh.]]></description><link>https://newsletter.huntgathertrade.com/p/stare-long-into-the-abyss</link><guid isPermaLink="false">https://newsletter.huntgathertrade.com/p/stare-long-into-the-abyss</guid><dc:creator><![CDATA[Larry Kann]]></dc:creator><pubDate>Mon, 17 Mar 2025 14:08:26 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!7I57!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4691a608-9876-42b9-9e4e-d6c76f0761ae_1024x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p>Disclaimer: the following post is an organized representation of my research and project notes. It doesn&#8217;t represent any type of advice, financial or otherwise. Its purpose is to be informative and educational. Backtest results are based on historical data, not real-time data. There is no guarantee that these hypothetical results will continue in the future. Day trading is extremely risky, and I do not suggest running any of these strategies live.</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7I57!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4691a608-9876-42b9-9e4e-d6c76f0761ae_1024x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7I57!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4691a608-9876-42b9-9e4e-d6c76f0761ae_1024x1024.png 424w, https://substackcdn.com/image/fetch/$s_!7I57!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4691a608-9876-42b9-9e4e-d6c76f0761ae_1024x1024.png 848w, https://substackcdn.com/image/fetch/$s_!7I57!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4691a608-9876-42b9-9e4e-d6c76f0761ae_1024x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!7I57!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4691a608-9876-42b9-9e4e-d6c76f0761ae_1024x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7I57!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4691a608-9876-42b9-9e4e-d6c76f0761ae_1024x1024.png" width="1024" height="1024" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4691a608-9876-42b9-9e4e-d6c76f0761ae_1024x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1024,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2760999,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://newsletter.huntgathertrade.com/i/159253389?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4691a608-9876-42b9-9e4e-d6c76f0761ae_1024x1024.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_!7I57!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4691a608-9876-42b9-9e4e-d6c76f0761ae_1024x1024.png 424w, https://substackcdn.com/image/fetch/$s_!7I57!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4691a608-9876-42b9-9e4e-d6c76f0761ae_1024x1024.png 848w, https://substackcdn.com/image/fetch/$s_!7I57!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4691a608-9876-42b9-9e4e-d6c76f0761ae_1024x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!7I57!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4691a608-9876-42b9-9e4e-d6c76f0761ae_1024x1024.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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>My wife was chasing our 2-year-old from around the camper towards to the car the get packed up to go to dinner. It was then that I noticed my father at the side of the house, red in the face and out of breadth.</p><p>"I hate to be a bother, but we have a problem."</p><p>My father is a bit extra from time to time, so I blinked. Real slow like. After that millennia passed. I just replied, "show me."</p><p>I made my way down the hill and around the house to the basement entrance. He was talking to me while we were heading down there, but I wasn't paying attention. I heard something about a leak and water on the floor. I open the door and step inside, splashing straight into an inch or so of water.</p><p>A million things went through my head while I bolted to the pressure tank and to hit the emergency shut off valve for the water supply to the house. Where are the main water lines located downstairs? How far are they from the fucking door? How long was this happening to fill all the way to the door an inch deep? How many live electric outlets and power strips are about to start blowing circuits?</p><p>All of these questions got answered in pretty rapid succession. Of the square footage in my mostly unfinished basement, about a quarter of it got covered in water. The only finished portion of my basement (the in-law studio my father occupies) got hit pretty hard, of course. There were multiple power strips running real live electricity through them floating in the water like the door in the Atlantic from that one movie we've all seen more than once. You know the one, don't pretend. It was just one teeter totter away from blowing out a circuit and probably giving me a good kick.</p><p>In the end, I got the water off and the slammed all my basement circuits to off to assess the potentially deadly situation. I did pause, though. My dad has a cat that I wouldn't mind...</p><p>Anyway, that's what happened to me a couple of weeks ago. I got the pipe problem solved and a good lesson in basic water plumbing for houses. I had a guy come out to give me a quote on mitigation and repair the very next morning. I'm not sure if prices for this type of work are targeted at insurance prices plus average deductibles or contractor types just think people are stupid, but when I saw the quote, I realized I was going to need to do it myself.</p><p>This type of work isn't complicated. It's actually pretty damn simple. Pull water soaked/damaged materials, dry and dehumidify everything, continuously assess moisture levels, test for mold, and be proud of this proprietary knowledge you've just come up with. Insert eye roll. Then, of course, you need to be able to replace the damaged pieces you just cut out of your walls and floors.</p><p>Too easy. I'm no stranger to hard work and I'm not stranger to this kind of work. I've got all the tools, I've done it before, and anything I don't already know is just a few finger taps away on ye ole YouTube machine.</p><p>Then it took two weeks. Why? Because I was doing it alone, while trying to work from home (HGT and client work), watch and care for a toddler, and every couple of steps I took forward I had to backtrack because I discovered a new gift from the home's previous owners. Such as the fact that the plank flooring (now ruined, cause Linoleum ain't waterproof) that was previously installed directly on top of carpet (hydrophilic) which had been glued to the concrete with no less than 3 gallons of glue.</p><p>This went on the entire project. One new discovery after another.</p><p>But that's past me now. I mean, mostly. I have a trailer full of construction trash I need to get rid of, a little furniture to move around, and I have to have a conversation with an old Vietnam vet about hoarding in a studio apartment. Other than that, this nightmare is past me.</p><p>Now I am sitting at my keyboard, I have no idea what day it is unless I look at the calendar and I have to do it multiple times a day because I forget. My toddler has become an official and credentialled 2-year-old. I'm operating off of caffeine fumes and the occasional nicotine pouch to help me focus.</p><p>And I just stare. I just stare at the fucking screen and can't figure out what I'm supposed to do. Before this event I had plans, and they are still written out, but I look at them and I don't want to fucking do them.</p><p>If you ever need clarity in your life, or you want to start thinking straight (about the shit that matters), go do something hard. Physically hard. Not just once. Do it for a while. Wake up every day and do hard physical work for as many hours as you can manage. Think only about how much it fucking sucks (this will be easy, because if it's hard enough, it is all you can think about), and resign yourself to doing it until it's done at whatever pace you have to do the thing in. Then, when it's done, go back to the other thing in your life that needed some perspective.</p><p>That's what happened to me. Not by design. It just sort of happened, but here I am. I've been trying to dig back into my projects this week, but the drive isn't there. There is so much that I am unhappy with when it comes to researching trade systems. I hate trying to find the right program or having to make a program sort of do thing I want/need. I hate that there is a concept of "public" companies yet everything you need to play (platforms, data, etc) the game is private, proprietary and costs money.</p><p>Well, I don't want to play that game anymore. I don't want to keep getting lost in the different platforms and methods for researching strategies and trading. I don't want to have one program for chart trading, one for hot key trading, another for backtesting strategies, one for equites, another for futures, and STILL have to use 5 different coding languages to glue shit together or make the things I want to make. It's fucking exhausting and, probably by definition, insane.</p><p>So, I have to make some changes. I am solidifying the tools I use and switching my focus using my own code for researching and testing. I am going to focus on Python (as that is commonly used and the lowest barrier to entry) and a low-level language such as C or Zig. The latter of which will just be a side project to work on along the way.</p><blockquote><p>As of right now, for the platforms that I will use that run on Windows, I am looking at keeping Sierra Chart (but not why you think) and... well, that's it, really. I will continue to use Norgate Data for end-of-day data for futures and equities, and Sierra Chart has a built-in DTC messaging protocol that allows users to stream or get historical data, send and receive trades, etc. This is really cool, because Sierra Chart uses very minimal resources when running and can be used as a platform for testing and running algorithmic systems with, without having to use their built-in framework. We can let Python do all the work and generate trades directly to the platform.</p></blockquote><h3>Important Note</h3><p>The quote above is something I wrote the other day, when I first started this post. At the time, I was thinking that I would use Sierra Chart as my catch all for futures and equity data. Since they have a DTC protocol, this seemed like a good way to get good historical and streaming data through Sierra Chart for both testing and running live strategies on. However (this is the important part), it turns out that even sending data over your own home/personal network is a violation of the data usage agreements.</p><p>Wait, what?</p><p>That's right. Technically, sending the data from one machine to another, over any type of network, could be considered distribution of data and thus violate the data usage agreement. This got me thinking. Is this type of restriction/verbiage common amongst data providers?</p><p>Well, let's check out the ones I use and see...</p><p>First, let's look at how Sierra Chart words it.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!m_P_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a1e8d66-549e-4c7a-b892-2036135d20bd_1694x120.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!m_P_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a1e8d66-549e-4c7a-b892-2036135d20bd_1694x120.png 424w, https://substackcdn.com/image/fetch/$s_!m_P_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a1e8d66-549e-4c7a-b892-2036135d20bd_1694x120.png 848w, https://substackcdn.com/image/fetch/$s_!m_P_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a1e8d66-549e-4c7a-b892-2036135d20bd_1694x120.png 1272w, https://substackcdn.com/image/fetch/$s_!m_P_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a1e8d66-549e-4c7a-b892-2036135d20bd_1694x120.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!m_P_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a1e8d66-549e-4c7a-b892-2036135d20bd_1694x120.png" width="1456" height="103" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8a1e8d66-549e-4c7a-b892-2036135d20bd_1694x120.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:103,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:18831,&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://newsletter.huntgathertrade.com/i/159253389?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a1e8d66-549e-4c7a-b892-2036135d20bd_1694x120.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_!m_P_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a1e8d66-549e-4c7a-b892-2036135d20bd_1694x120.png 424w, https://substackcdn.com/image/fetch/$s_!m_P_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a1e8d66-549e-4c7a-b892-2036135d20bd_1694x120.png 848w, https://substackcdn.com/image/fetch/$s_!m_P_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a1e8d66-549e-4c7a-b892-2036135d20bd_1694x120.png 1272w, https://substackcdn.com/image/fetch/$s_!m_P_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a1e8d66-549e-4c7a-b892-2036135d20bd_1694x120.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>And this is how they interpret it.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hTDo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77daafd0-7c8b-4212-8810-915d86ba30c8_1852x134.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hTDo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77daafd0-7c8b-4212-8810-915d86ba30c8_1852x134.png 424w, https://substackcdn.com/image/fetch/$s_!hTDo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77daafd0-7c8b-4212-8810-915d86ba30c8_1852x134.png 848w, https://substackcdn.com/image/fetch/$s_!hTDo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77daafd0-7c8b-4212-8810-915d86ba30c8_1852x134.png 1272w, https://substackcdn.com/image/fetch/$s_!hTDo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77daafd0-7c8b-4212-8810-915d86ba30c8_1852x134.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hTDo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77daafd0-7c8b-4212-8810-915d86ba30c8_1852x134.png" width="1456" height="105" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/77daafd0-7c8b-4212-8810-915d86ba30c8_1852x134.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:105,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:32803,&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://newsletter.huntgathertrade.com/i/159253389?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77daafd0-7c8b-4212-8810-915d86ba30c8_1852x134.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_!hTDo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77daafd0-7c8b-4212-8810-915d86ba30c8_1852x134.png 424w, https://substackcdn.com/image/fetch/$s_!hTDo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77daafd0-7c8b-4212-8810-915d86ba30c8_1852x134.png 848w, https://substackcdn.com/image/fetch/$s_!hTDo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77daafd0-7c8b-4212-8810-915d86ba30c8_1852x134.png 1272w, https://substackcdn.com/image/fetch/$s_!hTDo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77daafd0-7c8b-4212-8810-915d86ba30c8_1852x134.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>That's pretty explicit.</p><p>Next, let's check Norgate's license agreement.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8lfu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e151b11-0888-4050-8320-d9504f297f0a_1155x248.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8lfu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e151b11-0888-4050-8320-d9504f297f0a_1155x248.png 424w, https://substackcdn.com/image/fetch/$s_!8lfu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e151b11-0888-4050-8320-d9504f297f0a_1155x248.png 848w, https://substackcdn.com/image/fetch/$s_!8lfu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e151b11-0888-4050-8320-d9504f297f0a_1155x248.png 1272w, https://substackcdn.com/image/fetch/$s_!8lfu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e151b11-0888-4050-8320-d9504f297f0a_1155x248.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8lfu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e151b11-0888-4050-8320-d9504f297f0a_1155x248.png" width="1155" height="248" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9e151b11-0888-4050-8320-d9504f297f0a_1155x248.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:248,&quot;width&quot;:1155,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:40220,&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://newsletter.huntgathertrade.com/i/159253389?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e151b11-0888-4050-8320-d9504f297f0a_1155x248.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_!8lfu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e151b11-0888-4050-8320-d9504f297f0a_1155x248.png 424w, https://substackcdn.com/image/fetch/$s_!8lfu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e151b11-0888-4050-8320-d9504f297f0a_1155x248.png 848w, https://substackcdn.com/image/fetch/$s_!8lfu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e151b11-0888-4050-8320-d9504f297f0a_1155x248.png 1272w, https://substackcdn.com/image/fetch/$s_!8lfu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e151b11-0888-4050-8320-d9504f297f0a_1155x248.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Hmm, "redistribute the Data in any way or form" seems to jump out, doesn't it? I guess the argument would focus on the definition of "redistribution". Regardless, it is ambiguous enough to make me uneasy. You see, my goal was to use Norgate data and the Python library to just copy the data bases and the data I need and make it accessible to my desktop machine for testing. It seems that this would probably qualify as "redistribution" to some, should they wish to get upset by it. Since this verbiage is similar to Sierra Chart's, a conservative person would believe that sharing across a network is probably prohibited.</p><p>If my intention was to have Windows be a secondary machine attached to my home network, I would probably be in violation of the data usage agreements with the two providers that I was looking towards for my data needs.</p><p>Fascinating development.</p><h3>Back to our regular programming...</h3><p>You may notice I didn't mention RealTest. That is because I am at a weird point where I don't really want to keep or use ANY proprietary backtesting engine. I still really enjoy RealTest, and I think it is one of the best backtesting engines there is. I also love that it is written in C (just C, not C++), and is very efficient. However, it lacks some of the features that I really want to start testing with my research. I don't have as much control as I would like when creating custom features for testing. Of course, I can always find work arounds, but I don't want to spend time on workarounds when I could spend that time developing a good system that does exactly what I need. I would also like the ability to test both end-of-day and intraday strategies.</p><p>I am currently trialing WealthLab too (for the next year). What I am thinking about doing with this is using it as a way to store libraries of strategies, indicators, and tools that I develop for the platform. It is written in C# (sigh), and the framework is in C#, but that's ok. It has extensive documentation for its framework and extension API. It also makes it easy to offer libraries and tools as subscriber-based extensions that are easy to install.</p><p>This would mean I could restructure how and what is offered to paid subscribers. GitHub access will remain the same (with some restructuring interiorly) for Red Team members, but paid subscribers will gain access to the HGT Indicators and Strategies extensions for WealthLab. This way, I can try and address all levels of reader. Research and ideas can remain focused on the development using Python (or whatever else seems fun), but users who want to test the strategies and indicators without having to code or compile something themselves, can access to the versions for WealthLab.</p><p>In case you are wondering, I chose WealthLab because it seems to have the most features that would suite many different levels of trader&#8217;s needs. The system is robust enough to handle strategies like the ones I have been testing in RealTest, and offers a strong extension eco system of tools, data and broker connections, and many others. It seems to have a pretty active user base and responsive development team.</p><p>While this endeavor may take several weeks of constant work, I think it will be worth it in the end. This way, I can start to focus on the work that I truly enjoy, solving problems with code and trade research.</p><h2>Conclusions</h2><p>Now, you might be wondering, "what does this mean, Larry?"</p><p>Let's recap:</p><ul><li><p>Hard work is good for the soul.</p></li><li><p>I hate Windows and feel very restricted using proprietary platforms for my research and trading needs.</p></li><li><p>I am going to stop using Windows regularly, turning my laptop into a network machine for remote access when I have a specific need for something on Windows.</p></li><li><p>I am no longer going to be testing my ideas on proprietary platforms. Instead, I am switching focus to using Python and (insert low-level language here) for my research needs.</p></li><li><p>I don't like restrictive data usage agreements that technically don't even let me share the data across my own network to another personal machine. So, I'm not going to use those data providers.</p></li></ul><p>Okay, so you don't like Windows, and you don't like the commonly used restrictive language in the data usage agreements. What are you going to do about it?</p><p>Well, I'm going to stop using them. I already didn't like the fact that data can't be retrieved for free. There is something about having a public domain for retail traders/investors that gate keeps data that rubs me the wrong way. Top this with the excessive restrictions on your own machine or network and it's just something that I can't get behind.</p><p>There are data providers out there that are API first and have less restrictive verbiage on their data usage agreements. I plan on looking at these types of providers in the future, but for now...</p><p>I'm switching to crypto.</p><p>Ha. Wait, are you serious?</p><p>Yup.</p><p>What better way is there to escape the platform lock in, restrictive data usage agreements, and still be able to provide useful and informational content to your subscribers?</p><p>If you can think of one, I'll be willing to listen. Put it in the comments.</p><p>Until next time, happy hunting.</p><p>Feel free to comment below or e-mail me if you need help with anything, wish to criticize, or have thoughts on improvements. You can also DM me or start a chat thread. Red Team members can access this code and more at the private <a href="https://github.com/Hunt-Gather-Trade">HGT GitHub repo</a>. As always, this newsletter represents refined versions of my research notes. That means these notes are plastic. There could be mistakes or better ways to accomplish what I am trying to do. Nothing is perfect, and I always look for ways to improve my techniques.</p>]]></content:encoded></item><item><title><![CDATA[Intraday Momentum, part 2 -- The Intraday Volatility Bands indicator]]></title><description><![CDATA[Building research backed intraday volatility bands indicators using C++ and Sierra Chart's ACSIL language. Breakdown and some code available to all readers.]]></description><link>https://newsletter.huntgathertrade.com/p/intraday-momentum-part-2-the-intraday</link><guid isPermaLink="false">https://newsletter.huntgathertrade.com/p/intraday-momentum-part-2-the-intraday</guid><dc:creator><![CDATA[Larry Kann]]></dc:creator><pubDate>Sun, 16 Feb 2025 17:40:32 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!MyO8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fa62a28-9210-4460-aeba-21abba331d0d_1916x878.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p>Disclaimer: the following post is an organized representation of my research and project notes. It doesn&#8217;t represent any type of advice, financial or otherwise. Its purpose is to be informative and educational. Backtest results are based on historical data, not real-time data. There is no guarantee that these hypothetical results will continue in the future. Day trading is extremely risky, and I do not suggest running any of these strategies live.</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MyO8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fa62a28-9210-4460-aeba-21abba331d0d_1916x878.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MyO8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fa62a28-9210-4460-aeba-21abba331d0d_1916x878.png 424w, https://substackcdn.com/image/fetch/$s_!MyO8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fa62a28-9210-4460-aeba-21abba331d0d_1916x878.png 848w, https://substackcdn.com/image/fetch/$s_!MyO8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fa62a28-9210-4460-aeba-21abba331d0d_1916x878.png 1272w, https://substackcdn.com/image/fetch/$s_!MyO8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fa62a28-9210-4460-aeba-21abba331d0d_1916x878.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MyO8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fa62a28-9210-4460-aeba-21abba331d0d_1916x878.png" width="1456" height="667" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9fa62a28-9210-4460-aeba-21abba331d0d_1916x878.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:667,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:84085,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!MyO8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fa62a28-9210-4460-aeba-21abba331d0d_1916x878.png 424w, https://substackcdn.com/image/fetch/$s_!MyO8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fa62a28-9210-4460-aeba-21abba331d0d_1916x878.png 848w, https://substackcdn.com/image/fetch/$s_!MyO8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fa62a28-9210-4460-aeba-21abba331d0d_1916x878.png 1272w, https://substackcdn.com/image/fetch/$s_!MyO8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fa62a28-9210-4460-aeba-21abba331d0d_1916x878.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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>Part two of this series covers creating the intraday volatility bands indicator that is being used in Mar&#243;y's<a href="C:\cyberBrain\index.html#fn-1-fcf0fc86e76b9387"><sup>[1]</sup></a> paper on intraday momentum strategies for SPY and QQQ. I created this indicator in using Sierra Chart's (SC) Advanced Custom Study Interface Language (ACSIL), which is just C++. The logic for this indicator can be translated into whatever flavor of language you want to use. I have done my best to mimic the logic presented in the research paper. I think I have done a good job, but I'm not a mathematician or computer engineer, so it's just my best attempt. We will really be able to tell how I did when I start the backtesting process.</p><p>In the previous post (the daily test of this concept), I believe I mentioned that my use of standard deviation for a quick calculation and that it differed from Mar&#243;y's<a href="C:\cyberBrain\index.html#fn-1-fcf0fc86e76b9387"><sup>[1-1]</sup></a> calculation, but now that I am going back through it to create this indicator it looks like they do use the standard deviation of mean returns. What they don't use are log returns, which I did use in the previous post. I will probably update this indicator in during the testing phase to have an option to use log returns instead. That way we can test the difference and see if we can use that to help make this indicator/strategy more robust.</p><p>I am leaving most of this post open for all readers. The pay wall will block the completed code, but there will be portions of the code used to create this indicator in the breakdown that can be used to help you recreate this indicator for yourself.</p><p>If you are a Sierra Chart user and you want to use this indicator, you will need to add all three files to the <code>ACS_Source</code> folder and then build/compile the indicator using all three files in the built in build tool in SC. I am using my own headers and helper function files to create indicators, so it isn't all contained in a single file. This way, I can eventually create and entire library of custom indicators without having to type code more than once.</p><h2>Intraday Volatility Bands</h2><p>The Intraday Volatility Bands identify significant price movements by creating dynamic boundaries that adapt to the time of day. The core idea is that a price move should be compared to what's typically expected at that specific time in the trading session. Below is the core formula for this indicator<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\sigma_{Symbol,t} = \\sqrt{\\frac{1}{14}\\sum_{i=1}^{14}(ret_{t-i} - \\mu_{Symbol,t})^2}&quot;,&quot;id&quot;:&quot;XQTYUJWOBF&quot;}" data-component-name="LatexBlockToDOM"></div><p>and</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mu_{Symbol,t} = \\frac{1}{14}\\sum_{i=1}^{14}ret_{t-i}&quot;,&quot;id&quot;:&quot;KJLGRVJMAT&quot;}" data-component-name="LatexBlockToDOM"></div><ol><li><p>The Main Volatility Formula (&#963;):</p><ul><li><p>&#963; (sigma) represents the historical volatility</p></li><li><p>It's taking a sum of squared differences between returns and their mean</p></li><li><p>The formula uses 14 days of data (hence the 14 in denominator)</p></li><li><p>The square root (&#8730;) is used to get back to the original units of measurement</p></li></ul></li><li><p>The Mean Return Formula (&#956;):</p><ul><li><p>&#956; (mu) represents the average return over the period</p></li><li><p>It's a simple arithmetic mean of returns over 14 days</p></li><li><p>Each ret&#8333;&#8348;&#8331;&#7522;&#8334; represents the return from a previous day</p></li></ul></li></ol><p>We calculate the volatility by first finding the average return over the past 14 days. Then for each day, we subtract this average from the actual return, square the difference, sum up all these squared differences, divide by 14, and take the square root. This gives us a measure of how much returns typically deviate from their average.</p><p>This volatility measure then determines how wide our bands should be around the price. Higher volatility = wider bands, lower volatility = narrower bands.</p><h3>Basic Calculation Logic</h3><p>For any given time during the trading day (let's say 9:45 AM), we:</p><ol><li><p>Look back at the same time (9:45 AM) on previous days for our lookback period</p></li><li><p>Calculate how much price typically moves from the open to that time</p></li><li><p>Use this average movement (&#963;) to create upper and lower boundaries</p></li><li><p>Adjust these boundaries if there was a gap at today's open</p></li></ol><p>For each of those historical bars, it calculates the percentage move from that day's gap-adjusted open (max of that day's open or previous close) to the price at 9:45. Then it averages all those moves to get &#963; (sigma), which represents the typical percentage move you might expect at that specific time of day.</p><h3>Gap Handling</h3><p>The bands handle gaps using a simple max/min approach:</p><ul><li><p>Upper Boundary Base = max(today's open, yesterday's close)</p></li><li><p>Lower Boundary Base = min(today's open, yesterday's close)</p></li></ul><p>Then the volatility multiplier is applied to these bases:</p><ul><li><p>Upper = upperBase &#215; (1 + multiplier &#215; &#963;)</p></li><li><p>Lower = lowerBase &#215; (1 - multiplier &#215; &#963;)</p></li></ul><p>This approach automatically adjusts the noise area for gaps by anchoring one band to the previous close when appropriate, without needing explicit gap percentage calculations.</p><h3>Implementation Details</h3><p>Let's break down how this is implemented in the code:</p><h4>1. Session Management</h4><p>First, we determine if we're in an active trading session. If we are not in session, we will carry forward the previous values and skip calculations. The code below also handles overnight sessions, so we can turn off the chart session times being used and define our own time window if we want to.</p><pre><code><code>bool isInSession;
if (MarketOpenSeconds &gt; MarketCloseSeconds) {
    // Overnight session handling
    isInSession = (currentTimeSeconds &gt;= MarketOpenSeconds || 
                  currentTimeSeconds &lt;= MarketCloseSeconds);
} else {
    // Regular session handling
    isInSession = (currentTimeSeconds &gt;= MarketOpenSeconds &amp;&amp; 
                  currentTimeSeconds &lt;= MarketCloseSeconds);
}
</code></code></pre><h4>2. Historical Volatility (&#963;) Calculation</h4><p>For each historical day, we:</p><ul><li><p>Find the same time of day</p></li><li><p>Calculate the return from that day's effective open</p></li><li><p>Calculate the mean of these returns</p></li><li><p>Calculate the standard deviation using squared deviations from the mean</p></li></ul><pre><code><code>float sumReturns = 0.0f;
float returns[60];  // Assuming max lookback is 60 days
int validDays = 0;

// First pass - collect returns and calculate mean
for (int day = 1; day &lt;= LookbackDays; day++) {
    // Get historical date
    SCDateTime HistoricalDate = sc.BaseDateTimeIn[sc.Index];
    HistoricalDate.SubtractDays(day);
    
    // Get session start and effective open
    SCDateTime SessionStart = sc.GetTradingDayStartDateTimeOfBar(HistoricalDate);
    float histOpen = sc.Open[SessionStartIndex];
    float histPrevClose = (SessionStartIndex &gt; 0 ? 
                          sc.Close[SessionStartIndex - 1] : histOpen);
    float histEffectiveOpen = (histOpen &gt; histPrevClose ? 
                              histOpen : histPrevClose);
    
    // Calculate historical return
    float historicalReturn = (sc.Close[targetBarIndex] / histEffectiveOpen) - 1;
    returns[validDays] = historicalReturn;
    sumReturns += historicalReturn;
    validDays++;
}

float meanReturn = sumReturns / validDays;
float sumSquaredDeviations = 0.0f;

// Calculate squared deviations from mean
for (int i = 0; i &lt; validDays; i++) {
    float deviation = returns[i] - meanReturn;
    sumSquaredDeviations += deviation * deviation;
}

float sigma = sqrt(sumSquaredDeviations / validDays);
</code></code></pre><h4>3. Band Calculation With Gap Adjustments</h4><p>Finally, we calculate today's bands with appropriate gap adjustments:</p><pre><code><code>float todayOpen = sc.Open[TodayStartIndex]; 
float prevClose = (TodayStartIndex &gt; 0 ? sc.Close[TodayStartIndex - 1] : todayOpen); 

float effectiveUpperBasis = max(todayOpen, prevClose); 
float effectiveLowerBasis = min(todayOpen, prevClose);

float upperMultiplier = (1 + VolatilityMultiplier * sigma); 
float lowerMultiplier = (1 - VolatilityMultiplier * sigma); 

UpperBoundary[sc.Index] = effectiveUpperBasis * upperMultiplier; 
LowerBoundary[sc.Index] = effectiveLowerBasis * lowerMultiplier;
</code></code></pre><h4>Key Implementation Features</h4><ol><li><p><strong>Update Intervals</strong>: Bands only update at specified intervals to reduce noise</p></li><li><p><strong>Gap Adjustment</strong>: One band gets "anchored" to the previous close during gaps</p></li><li><p><strong>Effective Open</strong>: Uses the higher of today's open or previous close as the base</p></li><li><p><strong>Data Validation</strong>: Includes checks for valid data and proper session times</p></li></ol><h3>Usage</h3><p>The resulting bands create a "noise area" that:</p><ul><li><p>Adapts to normal volatility patterns for each time of day</p></li><li><p>Accounts for overnight gaps</p></li><li><p>Updates at controlled intervals</p></li><li><p>Provides clear boundaries for significant moves</p></li></ul><p>When price moves outside these bands, it signals a potentially significant trend that has broken out of the normal volatility pattern for that time of day. At least, that is the idea.</p><h3>Complete Code</h3><p>The rest of this post is for paid subscribers. Paid subscribers will have access to all paid publications, strategies, code associated with posts, and access to the HGT chat room. Red Team members will have access to the community GitHub and more. </p>
      <p>
          <a href="https://newsletter.huntgathertrade.com/p/intraday-momentum-part-2-the-intraday">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Intraday Momentum -- Researched based strategy deep dive, part 1]]></title><description><![CDATA[Available to all readers. I create a rapid EOD model to test whether or not it is worth our time to look into this strategy. The daily strategy I created has a profit factor of 1.26 and a 1.13 Sharpe.]]></description><link>https://newsletter.huntgathertrade.com/p/intraday-momentum-researched-based</link><guid isPermaLink="false">https://newsletter.huntgathertrade.com/p/intraday-momentum-researched-based</guid><dc:creator><![CDATA[Larry Kann]]></dc:creator><pubDate>Thu, 13 Feb 2025 14:19:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!AZk4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3368b1d-e0a5-4f44-801a-36deeaf5ef15_1906x689.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p>Disclaimer: the following post is an organized representation of my research and project notes. It doesn&#8217;t represent any type of advice, financial or otherwise. Its purpose is to be informative and educational. Backtest results are based on historical data, not real-time data. There is no guarantee that these hypothetical results will continue in the future. Day trading is extremely risky, and I do not suggest running any of these strategies live.</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AZk4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3368b1d-e0a5-4f44-801a-36deeaf5ef15_1906x689.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AZk4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3368b1d-e0a5-4f44-801a-36deeaf5ef15_1906x689.png 424w, https://substackcdn.com/image/fetch/$s_!AZk4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3368b1d-e0a5-4f44-801a-36deeaf5ef15_1906x689.png 848w, https://substackcdn.com/image/fetch/$s_!AZk4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3368b1d-e0a5-4f44-801a-36deeaf5ef15_1906x689.png 1272w, https://substackcdn.com/image/fetch/$s_!AZk4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3368b1d-e0a5-4f44-801a-36deeaf5ef15_1906x689.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AZk4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3368b1d-e0a5-4f44-801a-36deeaf5ef15_1906x689.png" width="1456" height="526" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e3368b1d-e0a5-4f44-801a-36deeaf5ef15_1906x689.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:526,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:74982,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!AZk4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3368b1d-e0a5-4f44-801a-36deeaf5ef15_1906x689.png 424w, https://substackcdn.com/image/fetch/$s_!AZk4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3368b1d-e0a5-4f44-801a-36deeaf5ef15_1906x689.png 848w, https://substackcdn.com/image/fetch/$s_!AZk4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3368b1d-e0a5-4f44-801a-36deeaf5ef15_1906x689.png 1272w, https://substackcdn.com/image/fetch/$s_!AZk4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3368b1d-e0a5-4f44-801a-36deeaf5ef15_1906x689.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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 strategy is based on the research found in references Mar&#243;y's<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a> &amp; Zarattini's<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a>. Both of them discuss the same strategy, but reference 1 is the newer paper that attempts to expand on and improve the original strategy. The purpose of this test is to see if there is an efficacy to the strategy idea. Mar&#243;y's paper uses several different methods to improve on the original paper, but it is highly optimized and only has results on 1 instrument in a short time period for back testing results. With that in mind, my goal is to recreate the logic from the papers and then see if we can make it more robust and applicable to more instruments.</p><p>Before testing this logic on the 1-minute or 1-second chart (used in Mar&#243;y's<sup> </sup>paper), I want to do a fast and dirty check of the logic using a daily historical chart. The purpose is to create a simple daily strategy that uses the same concepts from the paper to see if there is any reason to continue down to intraday time periods for further investigation.</p><p>So, let's summarize the main points of the paper and create a strategy in RealTest (RT) that has similar logic. We will use QQQ for this test, since that is the test the most recent paper decided to focus on. I will use historical returns to create the volatility bands and then set the strategy to take positions only if a bar crosses the upper or lower band. I will also set the strategy use the actual fill price of the trade to place our limit exit orders. This will ensure that orders look more like what you would see with a true intraday strategy.</p><p>Setting <code>QtyPrice: FillPrice</code> technically introduces a "lookahead bias" in RT. Since RT operates on EOD data, and doesn't handle true streaming data throughout the day, it has to &#8220;look forward&#8221; to test this type of system. That means that this version has some inherent problems, if you were to try and use this strategy to actually auto trade a strategy. It can't know what price the instrument is going to open at so it can't generate accurate child/bracket orders if you try and use this strategy as is. That is perfectly fine for what I am doing with this strategy (and the reason it's freely available to all readers), but it should not be traded exactly how it is. At least, it shouldn't be traded with RT as it is.</p><p>Here's a quick breakdown of the logic I am applying for this test:</p><ul><li><p>Instrument being tested is QQQ</p></li><li><p>Dates match the paper: 10/01/2014 to 10/01/2025</p></li><li><p>Allow optimizable parameters for volatility multipliers and lookback periods separately for long and short strategies.</p></li><li><p>Calculate historical volatility bands.</p><ul><li><p>This is where I do something a little different. Since the paper uses an intraday chart to calculated historical volatility by time of day, I can't match that logic. Instead, I just measure volatility with historical daily returns.</p></li><li><p>I also use logarithmic returns here, instead of simple returns. When I recreate the intraday version, I will use both methods to see if we can make this strategy more robust. In our case here, since this is just a rapid idea test, using logarithmic returns should be fine. Feel free to experiment with simple returns if that is more your vibe.</p></li><li><p>I use a regular standard deviation calculation along with the volatility multipliers to create the upper and lower bands.</p></li></ul></li><li><p>Use target volatility and historical volatility to calculate dynamic entry sizes.</p></li><li><p>Set a simple drawdown-based stop for the strategy.</p></li><li><p>Set exit targets based on percent gain and take a partial position exit at target. Else, hold the position until close.</p></li></ul><p><strong>RealTest, EOD Test Code</strong>:</p><pre><code><code>Notes: &#9;
&#9;Based on a research paper.
&#9;
Import:&#9;// requires Norgate Platinum subscription
&#9;DataSource:&#9;Norgate
&#9;IncludeList:&#9;QQQ
&#9;IncludeList:&#9;SPY
&#9;StartDate:&#9;1/1/2014
&#9;EndDate:&#9;Latest
&#9;SaveAs:&#9;27_QQQ.rtd
&#9;
Settings:&#9;
&#9;DataFile: &#9;27_QQQ.rtd
&#9;StartDate: &#9;10/01/2014
&#9;EndDate: &#9;10/01/2024
&#9;BarSize: &#9;Daily
&#9;AccountSize:&#9;1e5
&#9;HolidayList:&#9;us_auto
&#9;
Parameters:
&#9;lookback_long:&#9;from 2 to 14 step 1 def 9&#9;// 2 - 14 days are most effective according to paper
&#9;lookback_short:&#9;from 2 to 14 step 1 def 6
&#9;volatility_mult_long:&#9;from 0.5 to 1.5 step 0.1 def 1
&#9;volatility_mult_short:&#9;from 0.5 to 1.5 step 0.1 def 1.3
&#9;target_volatility:&#9;0.01  &#9;// Target daily volatility (1%)
&#9;risk:&#9;0.2
&#9;&#9;
Data:
&#9;log_returns:&#9;Log(Close / Close[1])
&#9;
&#9;// Long indicators
&#9;historical_volatility_long:&#9;StdDev(log_returns, lookback_long)
&#9;upper_noise_band_long:&#9;C * Exp(volatility_mult_long * historical_volatility_long)
&#9;lower_noise_band_long:&#9;C * Exp(-volatility_mult_long * historical_volatility_long)
&#9;
&#9;// Short indicators
&#9;historical_volatility_short:&#9;StdDev(log_returns, lookback_short)
&#9;upper_noise_band_short:&#9;C * Exp(volatility_mult_short * historical_volatility_short)
&#9;lower_noise_band_short:&#9;C * Exp(-volatility_mult_short * historical_volatility_short)
&#9;
Library:
&#9;dynamic_position_size_long:&#9;(S.Equity * Min(1, target_volatility / historical_volatility_long)) / Close
&#9;dynamic_position_size_short:&#9;(S.Equity * Min(1, target_volatility / historical_volatility_short)) / Close
&#9;
&#9;drawdown_pct:&#9;(S.MaxEquity - S.Equity) / S.MaxEquity&#9;
&#9;
Charts:
&#9;upperNB:&#9;{}&#9;upper_noise_band_long[1]
&#9;lowerNB:&#9;{}&#9;lower_noise_band_long[1]

Benchmark: buy_and_hold
&#9;Side: &#9;Long
&#9;EntrySetup: &#9;Symbol = $SPY
&#9;ExitRule: &#9;Dividend  // reinvest

Strategy: strategy_x_long
&#9;Allocation:&#9;S.Equity
&#9;QtyType:&#9;Shares
&#9;// This changes the exit limits and stops to "look ahead" and simulates the orders based on entry price instead of the predetermined entry order price.
&#9;// This is for when price opens above the entry price. RT assumes entry on open if entry stop/limit is above/below the order price.
&#9;// This behavior will cause some orders to exit immediately, if price gapped up/down far enough to have gone past the exit order price.
&#9;QtyPrice:&#9;FillPrice
&#9;Commission:&#9;Min(0.01 * FillValue, Max(0.005 * Shares, 1))&#9;
&#9;Side: &#9;Long
&#9;Quantity:&#9;dynamic_position_size_long
&#9;EntrySetup:&#9;InList(2) and drawdown_pct &lt;= risk
&#9;EntryStop:&#9;upper_noise_band_long
&#9;ExitLimit:&#9;FillPrice * 1.01
&#9;ExitLimitQty: &#9;Shares * 0.75
&#9;ExitTime:&#9;ThisClose
&#9;ExitRule:&#9;Select(BarsHeld == 0, "EOD Exit")
&#9;
Strategy: strategy_x_short
&#9;Allocation:&#9;S.Equity
&#9;QtyType:&#9;Shares
&#9;// QtyPrice changes the exit limits and stops to "look ahead" and simulates the orders based on entry price instead of the predetermined entry order price.
&#9;// This is for when price opens above the entry price. RT assumes entry on open if entry stop/limit is above/below the order price.
&#9;// This behavior will cause some orders to exit immediately, if price gapped up/down far enough to have gone past the exit order price.
&#9;QtyPrice:&#9;FillPrice
&#9;Commission:&#9;Min(0.01 * FillValue, Max(0.005 * Shares, 1))&#9;
&#9;Side: &#9;Short
&#9;Quantity:&#9;dynamic_position_size_short
&#9;EntrySetup:&#9;InList(2) and drawdown_pct &lt;= risk
&#9;EntryStop: &#9;lower_noise_band_short
&#9;ExitLimit:&#9;FillPrice * 0.98
&#9;ExitLimitQty: &#9;Shares * 0.75
&#9;ExitTime:&#9;ThisClose
&#9;ExitRule:&#9;Select(BarsHeld == 0, "EOD Exit")
</code></code></pre><p><strong>Results</strong>:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uqmg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F969d83a6-8d52-46d2-a4f6-3bcb56e89851_1153x60.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uqmg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F969d83a6-8d52-46d2-a4f6-3bcb56e89851_1153x60.png 424w, https://substackcdn.com/image/fetch/$s_!uqmg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F969d83a6-8d52-46d2-a4f6-3bcb56e89851_1153x60.png 848w, https://substackcdn.com/image/fetch/$s_!uqmg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F969d83a6-8d52-46d2-a4f6-3bcb56e89851_1153x60.png 1272w, https://substackcdn.com/image/fetch/$s_!uqmg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F969d83a6-8d52-46d2-a4f6-3bcb56e89851_1153x60.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uqmg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F969d83a6-8d52-46d2-a4f6-3bcb56e89851_1153x60.png" width="1153" height="60" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/969d83a6-8d52-46d2-a4f6-3bcb56e89851_1153x60.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:60,&quot;width&quot;:1153,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:10172,&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;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!uqmg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F969d83a6-8d52-46d2-a4f6-3bcb56e89851_1153x60.png 424w, https://substackcdn.com/image/fetch/$s_!uqmg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F969d83a6-8d52-46d2-a4f6-3bcb56e89851_1153x60.png 848w, https://substackcdn.com/image/fetch/$s_!uqmg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F969d83a6-8d52-46d2-a4f6-3bcb56e89851_1153x60.png 1272w, https://substackcdn.com/image/fetch/$s_!uqmg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F969d83a6-8d52-46d2-a4f6-3bcb56e89851_1153x60.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The results aren't terrible, right? Test 2 shows the results for the strategy if we remove the exit logic and limits. There isn't much of a difference, but it does help the drawdown to simulate taking partial profits intraday.</p><p>What happens next?</p><p>I am going to move over to Sierra Chart and turn this into a true intraday strategy. First, I will create the indicator (gotta do a little C++ judo to set it up right). Then, I will create the actual strategy from the research papers we are looking at and see if I can get close to the same results.</p><p>And before I talk about what comes after that, I want to point out a few things about these papers. As far as I can tell, neither of them has been published in a traditional peer-reviewed journal. Mar&#243;y's paper doesn't have any academic affiliation (just the author's personal e-mail) and Zarattini's is published in a journal, but not a traditional peer-reviewed journal. The earlier paper also has affiliations with private trading and research firms. These facts already give me pause, but it doesn't mean there isn't some sort of edge here.</p><p>I think it's also important to point the very obvious problems that we know are present in the logic being presented to us in these papers. First, the strategies only focus on 1 instrument. This means they can easily be overfit. Second, the most recent paper uses a large amount of optimization to get the results it is presenting. It even points out that the results for the strategy are better on QQQ, so they are only focusing on QQQ and not SPY, like the original paper. That is basically saying (in the paper, none the less) that this strategy is overfit to a specific market/instrument.</p><p>We don't need to reproduce the strategy to know that it has some shortcomings. The papers practically admit their own faults while presenting their findings. Oddly enough, I don't believe that any of this means that you couldn't use this strategy to make money. I think it needs some real work, to go into the portfolio, but I am hopeful that it's possible.</p><h2>Conclusion</h2><p>Thanks for reading and hopefully you are excited about seeing what this strategy turns into in the end. The next post will cover creating the intraday volatility bands indicator. After that, we will dive into creating trying to recreate the strategy results from the paper. Finally, we will end with my attempt at updating the strategy so that it is more reliable. Ideally, I would like to be able to use something like this with ES. The idea is sound, I think.</p><p>Anyway, until the next one...</p><p>Happy hunting!</p><p>Feel free to comment below or e-mail me if you need help with anything, wish to criticize, or have thoughts on improvements. You can also DM me or start a chat thread. Red Team members can access this code and more at the private <a href="https://github.com/Hunt-Gather-Trade">HGT GitHub repo</a>. As always, this newsletter represents refined versions of my research notes. That means these notes are plastic. There could be mistakes or better ways to accomplish what I am trying to do. Nothing is perfect, and I always look for ways to improve my techniques.</p><p><strong>References</strong>:</p><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p>Mar&#243;y, &#193;. (2025). Improvements to intraday momentum strategies using parameter optimization and different exit strategies. Swiss Finance Institute Research Paper Series, No. 24-97. <a href="https://ssrn.com/abstract=5095349">https://ssrn.com/abstract=5095349</a></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-2" href="#footnote-anchor-2" class="footnote-number" contenteditable="false" target="_self">2</a><div class="footnote-content"><p>Zarattini, C., Aziz, A., &amp; Barbon, A. (2024). Beat the market: An effective intraday momentum strategy for S&amp;P500 ETF (SPY). SSRN Electronic Journal. <a href="https://doi.org/10.2139/ssrn.4824172">https://doi.org/10.2139/ssrn.4824172</a></p><p></p></div></div>]]></content:encoded></item><item><title><![CDATA[Strategy 6 gets updated -- It's probably still unrealistic, though.]]></title><description><![CDATA[This strategy is now a short-only, mean reversion strategy that trades the Russell 2000. It boasts a profit factor of 6.5, a Sharpe of 1.82, 75% accuracy, a 47% ROR, and a MaxxDD of -20% in 10 years.]]></description><link>https://newsletter.huntgathertrade.com/p/strategy-6-gets-updated-its-probably</link><guid isPermaLink="false">https://newsletter.huntgathertrade.com/p/strategy-6-gets-updated-its-probably</guid><dc:creator><![CDATA[Larry Kann]]></dc:creator><pubDate>Wed, 05 Feb 2025 16:19:03 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5afbd11b-a5a3-41a7-8c07-e2daaf92f9f2_1207x764.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p>Disclaimer: the following post is an organized representation of my research and project notes. It doesn&#8217;t represent any type of advice, financial or otherwise. Its purpose is to be informative and educational. Backtest results are based on historical data, not real-time data. There is no guarantee that these hypothetical results will continue in the future. Day trading is extremely risky, and I do not suggest running any of these strategies live.</p></blockquote><p>A reader reached out to me and asked me a couple of questions about <a href="https://newsletter.huntgathertrade.com/p/strategy-6-a-lean-mean-reverting">Strategy 6</a>. When I went back and looked at it, I realized that they were right to ask questions. This strategy was one of the earlier ones, and thus didn't get updated as I learned better ways to script strategies. So, I decided to fix the issues and see if that strategy was still usable.</p><p>During this process, I discovered that the long variation of the strategy was lackluster. I removed it and focused on the short side of the strategy since it still showed promise. I corrected some of the main issues (ranking and checking index status) and adjusted some of the calculations to use more reliable measures (such as log returns). The strategy looks like it could be a promising addition to a portfolio looking for some short-term short exposure.</p><p>Check out the results. The strategy is capped at using 25k (the starting account balance) each time it makes a trade. Meaning, there is no compounding here. This is to help make it more realistic, because incredibly large short positions on these stocks are unlikely. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qIJR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F198f776b-325d-4cff-860d-4c7925a5a54f_1203x692.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qIJR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F198f776b-325d-4cff-860d-4c7925a5a54f_1203x692.png 424w, https://substackcdn.com/image/fetch/$s_!qIJR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F198f776b-325d-4cff-860d-4c7925a5a54f_1203x692.png 848w, https://substackcdn.com/image/fetch/$s_!qIJR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F198f776b-325d-4cff-860d-4c7925a5a54f_1203x692.png 1272w, https://substackcdn.com/image/fetch/$s_!qIJR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F198f776b-325d-4cff-860d-4c7925a5a54f_1203x692.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qIJR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F198f776b-325d-4cff-860d-4c7925a5a54f_1203x692.png" width="1203" height="692" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/198f776b-325d-4cff-860d-4c7925a5a54f_1203x692.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:692,&quot;width&quot;:1203,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:34024,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!qIJR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F198f776b-325d-4cff-860d-4c7925a5a54f_1203x692.png 424w, https://substackcdn.com/image/fetch/$s_!qIJR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F198f776b-325d-4cff-860d-4c7925a5a54f_1203x692.png 848w, https://substackcdn.com/image/fetch/$s_!qIJR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F198f776b-325d-4cff-860d-4c7925a5a54f_1203x692.png 1272w, https://substackcdn.com/image/fetch/$s_!qIJR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F198f776b-325d-4cff-860d-4c7925a5a54f_1203x692.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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 class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PDKg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609a353c-715e-4818-b7a0-fb7147cf034e_1203x483.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PDKg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609a353c-715e-4818-b7a0-fb7147cf034e_1203x483.png 424w, https://substackcdn.com/image/fetch/$s_!PDKg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609a353c-715e-4818-b7a0-fb7147cf034e_1203x483.png 848w, https://substackcdn.com/image/fetch/$s_!PDKg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609a353c-715e-4818-b7a0-fb7147cf034e_1203x483.png 1272w, https://substackcdn.com/image/fetch/$s_!PDKg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609a353c-715e-4818-b7a0-fb7147cf034e_1203x483.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PDKg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609a353c-715e-4818-b7a0-fb7147cf034e_1203x483.png" width="1203" height="483" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/609a353c-715e-4818-b7a0-fb7147cf034e_1203x483.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:483,&quot;width&quot;:1203,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:51700,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!PDKg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609a353c-715e-4818-b7a0-fb7147cf034e_1203x483.png 424w, https://substackcdn.com/image/fetch/$s_!PDKg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609a353c-715e-4818-b7a0-fb7147cf034e_1203x483.png 848w, https://substackcdn.com/image/fetch/$s_!PDKg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609a353c-715e-4818-b7a0-fb7147cf034e_1203x483.png 1272w, https://substackcdn.com/image/fetch/$s_!PDKg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609a353c-715e-4818-b7a0-fb7147cf034e_1203x483.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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 class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qEgh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F623896af-32c0-4e3b-8b77-7229cc24de78_1196x746.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qEgh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F623896af-32c0-4e3b-8b77-7229cc24de78_1196x746.png 424w, https://substackcdn.com/image/fetch/$s_!qEgh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F623896af-32c0-4e3b-8b77-7229cc24de78_1196x746.png 848w, https://substackcdn.com/image/fetch/$s_!qEgh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F623896af-32c0-4e3b-8b77-7229cc24de78_1196x746.png 1272w, https://substackcdn.com/image/fetch/$s_!qEgh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F623896af-32c0-4e3b-8b77-7229cc24de78_1196x746.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qEgh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F623896af-32c0-4e3b-8b77-7229cc24de78_1196x746.png" width="1196" height="746" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/623896af-32c0-4e3b-8b77-7229cc24de78_1196x746.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:746,&quot;width&quot;:1196,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:27724,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!qEgh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F623896af-32c0-4e3b-8b77-7229cc24de78_1196x746.png 424w, https://substackcdn.com/image/fetch/$s_!qEgh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F623896af-32c0-4e3b-8b77-7229cc24de78_1196x746.png 848w, https://substackcdn.com/image/fetch/$s_!qEgh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F623896af-32c0-4e3b-8b77-7229cc24de78_1196x746.png 1272w, https://substackcdn.com/image/fetch/$s_!qEgh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F623896af-32c0-4e3b-8b77-7229cc24de78_1196x746.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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 class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Q3ey!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f826765-abf1-45a3-b192-e7a1d944f1ab_1204x748.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Q3ey!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f826765-abf1-45a3-b192-e7a1d944f1ab_1204x748.png 424w, https://substackcdn.com/image/fetch/$s_!Q3ey!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f826765-abf1-45a3-b192-e7a1d944f1ab_1204x748.png 848w, https://substackcdn.com/image/fetch/$s_!Q3ey!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f826765-abf1-45a3-b192-e7a1d944f1ab_1204x748.png 1272w, https://substackcdn.com/image/fetch/$s_!Q3ey!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f826765-abf1-45a3-b192-e7a1d944f1ab_1204x748.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Q3ey!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f826765-abf1-45a3-b192-e7a1d944f1ab_1204x748.png" width="1204" height="748" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0f826765-abf1-45a3-b192-e7a1d944f1ab_1204x748.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:748,&quot;width&quot;:1204,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:38431,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Q3ey!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f826765-abf1-45a3-b192-e7a1d944f1ab_1204x748.png 424w, https://substackcdn.com/image/fetch/$s_!Q3ey!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f826765-abf1-45a3-b192-e7a1d944f1ab_1204x748.png 848w, https://substackcdn.com/image/fetch/$s_!Q3ey!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f826765-abf1-45a3-b192-e7a1d944f1ab_1204x748.png 1272w, https://substackcdn.com/image/fetch/$s_!Q3ey!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f826765-abf1-45a3-b192-e7a1d944f1ab_1204x748.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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 class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UWMg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5afbd11b-a5a3-41a7-8c07-e2daaf92f9f2_1207x764.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UWMg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5afbd11b-a5a3-41a7-8c07-e2daaf92f9f2_1207x764.png 424w, https://substackcdn.com/image/fetch/$s_!UWMg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5afbd11b-a5a3-41a7-8c07-e2daaf92f9f2_1207x764.png 848w, https://substackcdn.com/image/fetch/$s_!UWMg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5afbd11b-a5a3-41a7-8c07-e2daaf92f9f2_1207x764.png 1272w, https://substackcdn.com/image/fetch/$s_!UWMg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5afbd11b-a5a3-41a7-8c07-e2daaf92f9f2_1207x764.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UWMg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5afbd11b-a5a3-41a7-8c07-e2daaf92f9f2_1207x764.png" width="1207" height="764" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5afbd11b-a5a3-41a7-8c07-e2daaf92f9f2_1207x764.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:764,&quot;width&quot;:1207,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:59880,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!UWMg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5afbd11b-a5a3-41a7-8c07-e2daaf92f9f2_1207x764.png 424w, https://substackcdn.com/image/fetch/$s_!UWMg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5afbd11b-a5a3-41a7-8c07-e2daaf92f9f2_1207x764.png 848w, https://substackcdn.com/image/fetch/$s_!UWMg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5afbd11b-a5a3-41a7-8c07-e2daaf92f9f2_1207x764.png 1272w, https://substackcdn.com/image/fetch/$s_!UWMg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5afbd11b-a5a3-41a7-8c07-e2daaf92f9f2_1207x764.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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><em><strong>Important Notes about this Strategy</strong></em>:</p><ul><li><p>This strategy is a short-term strategy that shorts instruments in the Russel 2000. I have had several people advise me that it is difficult to trade strategies like this (especially with EOD data and simple entries) and get the same results in the real world. I trust their advice, since they have history trading these types of strategies and I do not.</p></li><li><p>Russel 2000 stocks can be illiquid and difficult to short (not as many stocks available).</p></li><li><p>Lump sum limit entries will be difficult to fill during volatility spikes.</p></li><li><p>This version uses EOD data to get an idea about the efficacy of the idea. It makes the assumption that the entire position will get filled at the predetermined limit price should price hit that order. Because of this, and the aforementioned issues with shorting stocks in this index, this strategy is meant to be a framework for further investigation on an intraday chart. It would likely benefit from scaled, dynamic entries that take advantage of volatility spikes and liquidity.</p></li><li><p>I make my best effort to limit issues within the strategy criteria, but it should be understood that taken exactly as is, this strategy has some holes that I plan to try and address with an intraday platform (rapidly scaling into positions).</p></li></ul><h2>Strategy 6_RUT</h2><p>This strategy is still the same concept as the original strategy 6, but with upgrades and dropping of the long variation. It uses volatility and overbought conditions to time short-term mean reversion opportunities in small cap, low price stocks. The concept is that these stocks will see heightened volatility short-term and then revert back to the mean. The goal is to capitalize on those days and short the stock after the move.</p><p>You will notice that this strategy does use a custom indicator in its calculations. I will attach that custom code here as well. This is just a custom ATR (average true range) that calculates either a regular ATR or log ATR with simple smoothing. Code is attached below. You can change this in the strategy if you wish to use a different version of ATR.</p><p>The rest of this post is for paid subscribers. Paid subscribers will have access to all paid publications, strategies, code associated with posts, and access to the HGT chat room. Red Team members will have access to the community GitHub and more.</p>
      <p>
          <a href="https://newsletter.huntgathertrade.com/p/strategy-6-gets-updated-its-probably">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Using individual futures contracts for backtesting in RealTest]]></title><description><![CDATA[I quickly cover how to go about handling contract rollover manually instead of using continuous contracts in RealTest.]]></description><link>https://newsletter.huntgathertrade.com/p/using-individual-futures-contracts</link><guid isPermaLink="false">https://newsletter.huntgathertrade.com/p/using-individual-futures-contracts</guid><dc:creator><![CDATA[Larry Kann]]></dc:creator><pubDate>Wed, 29 Jan 2025 14:15:33 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6c9fff4-8eb5-4173-ab8a-84a15607ce21_1024x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p>Disclaimer: the following post is an organized representation of my research and project notes. It doesn&#8217;t represent any type of advice, financial or otherwise. Its purpose is to be informative and educational. Backtest results are based on historical data, not real-time data. There is no guarantee that these hypothetical results will continue in the future. Day trading is extremely risky, and I do not suggest running any of these strategies live.</p></blockquote><p>I use continuous contracts when backtesting futures in RealTest. The data comes from Norgate. They also have individual contracts. In RealTest, you can import the individual contracts and manage the rollover logic yourself. I believe you can also use CSI futures data and manage the rollover logic in their software, but I don't use CSI data.</p><p>I tend to use continuous contracts in my backtesting because it is the fastest way to model and test out ideas. Since I day trade futures (ES, specifically), I actually use the strategies I built in RealTest as a scanner. I'll generate orders and see what the orders are generated to help me get a "lean" on the day. Since the tests are ran assuming buy at the open and exit at close, I can use the accuracy percentages of each strategy to gauge the strength of the edge.</p><p>However, if you want to actually generate accurate orders for trading these strategies live (or automating the process), you will want to use the individual contracts. This also gives you more control of the rollover logic. If that is what you want to do, I am going to show you how I have done this in the past.</p><p>First, the results of both variations on the most recent strategy (26_NQ).</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oPBw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c574e1d-8638-4f62-ae10-9a3a8a0aa53e_1151x65.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oPBw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c574e1d-8638-4f62-ae10-9a3a8a0aa53e_1151x65.png 424w, https://substackcdn.com/image/fetch/$s_!oPBw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c574e1d-8638-4f62-ae10-9a3a8a0aa53e_1151x65.png 848w, https://substackcdn.com/image/fetch/$s_!oPBw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c574e1d-8638-4f62-ae10-9a3a8a0aa53e_1151x65.png 1272w, https://substackcdn.com/image/fetch/$s_!oPBw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c574e1d-8638-4f62-ae10-9a3a8a0aa53e_1151x65.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oPBw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c574e1d-8638-4f62-ae10-9a3a8a0aa53e_1151x65.png" width="1151" height="65" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6c574e1d-8638-4f62-ae10-9a3a8a0aa53e_1151x65.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:65,&quot;width&quot;:1151,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:10236,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!oPBw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c574e1d-8638-4f62-ae10-9a3a8a0aa53e_1151x65.png 424w, https://substackcdn.com/image/fetch/$s_!oPBw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c574e1d-8638-4f62-ae10-9a3a8a0aa53e_1151x65.png 848w, https://substackcdn.com/image/fetch/$s_!oPBw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c574e1d-8638-4f62-ae10-9a3a8a0aa53e_1151x65.png 1272w, https://substackcdn.com/image/fetch/$s_!oPBw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c574e1d-8638-4f62-ae10-9a3a8a0aa53e_1151x65.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>As you can see, it has very similar results.</p><p>I will show how to do this witch strategy 26 below the paywall, but for free subsribers, I am going to provide snippets in case you want to implement this. Before you get started, make sure you have a watchlist of the idnividual contracts that you want to trade and import them into RealTest. I use Norgate for this so it is very simple.</p><p><code>Import</code>:</p><pre><code><code>DataSource:&#9;Norgate
IncludeList:&#9;.@NQ_Individual_Contracts&#9;{"NQ"}</code></code></pre><p>We need to define our rollover logic. Below is an example of a simple volume based rollover and a check to make sure we aren't trading the outgoing contract during triple witching.</p><p><code>Data</code>:</p><pre><code><code>// Contract Rollover
turnover_min:&#9;5e4
lowest_turnover:&#9;Lowest(Extra ,5)
turnover_ma:&#9;MA(Extra, 5)
DaysToExp:&#9;Days(BarDate, InfoExpiry, True)
TripleWitching:&#9;DaysToExp &lt; 5
liquid:&#9;lowest_turnover &gt; turnover_min and not TripleWitching
&#9;
MktRank:&#9;#Rank #ByMkt If(liquid and inlist("MicroES"), turnover_ma, -1)</code></code></pre><p>We can use the <code>Library</code> section to store a constant variable that checks the market rank to determine if we can hold the contract per the logic defined about</p><p><code>Library</code>:</p><pre><code><code>CanHold: &#9;MktRank = 1</code></code></pre><p>From there, you can use the <code>CanHold</code> boolean to check for the correct contract in the Strategy section.</p><p><code>Strategy</code>:</p><pre><code><code>EntrySetup: &#9;long and CanHold</code></code></pre><p>Too easy. If you are using indicators with long lookbacks, it would be wise to import a second list with the continuous contracts that you are looking to trade as well. That way you can use them to calculate whatever indicators you need.</p><h2>Code</h2><p>The rest of this post is for paid subscribers. Paid subscribers will have access to all paid publications, strategies, code associated with posts, and access to the HGT chat room. Red Team members will have access to the community GitHub and more.</p>
      <p>
          <a href="https://newsletter.huntgathertrade.com/p/using-individual-futures-contracts">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[I updated the CMF indicator to C, new strategy (NQ) results and code included]]></title><description><![CDATA[A new way to create custom indicators in RealTest using C (that's right). The strategy produced a PF of 1.7 and Sharpe of 1.33 on 525 trades in the last 10 years of NQ data.]]></description><link>https://newsletter.huntgathertrade.com/p/i-updated-the-cmf-indicator-to-c</link><guid isPermaLink="false">https://newsletter.huntgathertrade.com/p/i-updated-the-cmf-indicator-to-c</guid><dc:creator><![CDATA[Larry Kann]]></dc:creator><pubDate>Wed, 29 Jan 2025 11:13:10 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!mdMK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac61c6e6-855e-45ac-9d82-6325351f7026_1196x747.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mdMK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac61c6e6-855e-45ac-9d82-6325351f7026_1196x747.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mdMK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac61c6e6-855e-45ac-9d82-6325351f7026_1196x747.png 424w, https://substackcdn.com/image/fetch/$s_!mdMK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac61c6e6-855e-45ac-9d82-6325351f7026_1196x747.png 848w, https://substackcdn.com/image/fetch/$s_!mdMK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac61c6e6-855e-45ac-9d82-6325351f7026_1196x747.png 1272w, https://substackcdn.com/image/fetch/$s_!mdMK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac61c6e6-855e-45ac-9d82-6325351f7026_1196x747.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mdMK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac61c6e6-855e-45ac-9d82-6325351f7026_1196x747.png" width="1196" height="747" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ac61c6e6-855e-45ac-9d82-6325351f7026_1196x747.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:747,&quot;width&quot;:1196,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:39220,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!mdMK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac61c6e6-855e-45ac-9d82-6325351f7026_1196x747.png 424w, https://substackcdn.com/image/fetch/$s_!mdMK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac61c6e6-855e-45ac-9d82-6325351f7026_1196x747.png 848w, https://substackcdn.com/image/fetch/$s_!mdMK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac61c6e6-855e-45ac-9d82-6325351f7026_1196x747.png 1272w, https://substackcdn.com/image/fetch/$s_!mdMK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac61c6e6-855e-45ac-9d82-6325351f7026_1196x747.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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>Disclaimer: the following post is an organized representation of my research and project notes. It doesn&#8217;t represent any type of advice, financial or otherwise. Its purpose is to be informative and educational. Backtest results are based on historical data, not real-time data. There is no guarantee that these hypothetical results will continue in the future. Day trading is extremely risky, and I do not suggest running any of these strategies live.</p></blockquote><h2>Important!</h2><p><em>This strategy has been updated. When I was working on adding this strategy to a portfolio project, I ran across an error I made in the short logic. I accidentally had it set to take longs instead of shorts. When I fixed this, it changed the results. The short portion of the strategy only accounted for about 1/5 of the trades. The new results for just the long side are posted directly below this paragraph. The strategy code has been updated for the paid subscribers. Sorry for the mistake!</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6qXV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a71fd2a-9779-44af-a33a-d8c2d84b73d7_1200x659.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6qXV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a71fd2a-9779-44af-a33a-d8c2d84b73d7_1200x659.png 424w, https://substackcdn.com/image/fetch/$s_!6qXV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a71fd2a-9779-44af-a33a-d8c2d84b73d7_1200x659.png 848w, https://substackcdn.com/image/fetch/$s_!6qXV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a71fd2a-9779-44af-a33a-d8c2d84b73d7_1200x659.png 1272w, https://substackcdn.com/image/fetch/$s_!6qXV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a71fd2a-9779-44af-a33a-d8c2d84b73d7_1200x659.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6qXV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a71fd2a-9779-44af-a33a-d8c2d84b73d7_1200x659.png" width="1200" height="659" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3a71fd2a-9779-44af-a33a-d8c2d84b73d7_1200x659.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:659,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:26564,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6qXV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a71fd2a-9779-44af-a33a-d8c2d84b73d7_1200x659.png 424w, https://substackcdn.com/image/fetch/$s_!6qXV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a71fd2a-9779-44af-a33a-d8c2d84b73d7_1200x659.png 848w, https://substackcdn.com/image/fetch/$s_!6qXV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a71fd2a-9779-44af-a33a-d8c2d84b73d7_1200x659.png 1272w, https://substackcdn.com/image/fetch/$s_!6qXV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a71fd2a-9779-44af-a33a-d8c2d84b73d7_1200x659.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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>I have been doing a lot of experimenting with creating custom indicators for RealTest (RT) using C. Just a few weeks ago, I didn't even know that this was something that could be done in RT. Now, I am working on converting all of my favorite indicators to C so I can program them in a way that works better for my brain. Of course, this requires that I learn some C code along the way. You don't have to though. If you are interested (and a paid subscriber), the code will be provided for you to experiment with or use.</p><p>Below are the results from this strategy. You can see longs and shorts tested separately and in-sample/out-of-sample results.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5tIs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b35104-b2e5-45a6-8c24-bf041b03038e_1179x107.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5tIs!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b35104-b2e5-45a6-8c24-bf041b03038e_1179x107.png 424w, https://substackcdn.com/image/fetch/$s_!5tIs!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b35104-b2e5-45a6-8c24-bf041b03038e_1179x107.png 848w, https://substackcdn.com/image/fetch/$s_!5tIs!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b35104-b2e5-45a6-8c24-bf041b03038e_1179x107.png 1272w, https://substackcdn.com/image/fetch/$s_!5tIs!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b35104-b2e5-45a6-8c24-bf041b03038e_1179x107.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5tIs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b35104-b2e5-45a6-8c24-bf041b03038e_1179x107.png" width="1179" height="107" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/66b35104-b2e5-45a6-8c24-bf041b03038e_1179x107.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:107,&quot;width&quot;:1179,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19935,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!5tIs!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b35104-b2e5-45a6-8c24-bf041b03038e_1179x107.png 424w, https://substackcdn.com/image/fetch/$s_!5tIs!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b35104-b2e5-45a6-8c24-bf041b03038e_1179x107.png 848w, https://substackcdn.com/image/fetch/$s_!5tIs!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b35104-b2e5-45a6-8c24-bf041b03038e_1179x107.png 1272w, https://substackcdn.com/image/fetch/$s_!5tIs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b35104-b2e5-45a6-8c24-bf041b03038e_1179x107.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p>Stats for the entire strategy are below. I am updating my subdomain for strategy results, so bare with me for a couple of weeks until I get that updated. Once updated, all strategy results can be found there again. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9Mco!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab5035b-cc11-44e9-947c-37c73bbaa966_1198x658.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9Mco!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab5035b-cc11-44e9-947c-37c73bbaa966_1198x658.png 424w, https://substackcdn.com/image/fetch/$s_!9Mco!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab5035b-cc11-44e9-947c-37c73bbaa966_1198x658.png 848w, https://substackcdn.com/image/fetch/$s_!9Mco!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab5035b-cc11-44e9-947c-37c73bbaa966_1198x658.png 1272w, https://substackcdn.com/image/fetch/$s_!9Mco!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab5035b-cc11-44e9-947c-37c73bbaa966_1198x658.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9Mco!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab5035b-cc11-44e9-947c-37c73bbaa966_1198x658.png" width="1198" height="658" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5ab5035b-cc11-44e9-947c-37c73bbaa966_1198x658.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:658,&quot;width&quot;:1198,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:35874,&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;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9Mco!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab5035b-cc11-44e9-947c-37c73bbaa966_1198x658.png 424w, https://substackcdn.com/image/fetch/$s_!9Mco!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab5035b-cc11-44e9-947c-37c73bbaa966_1198x658.png 848w, https://substackcdn.com/image/fetch/$s_!9Mco!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab5035b-cc11-44e9-947c-37c73bbaa966_1198x658.png 1272w, https://substackcdn.com/image/fetch/$s_!9Mco!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab5035b-cc11-44e9-947c-37c73bbaa966_1198x658.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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 class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vTuv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bc23af7-d277-4eff-b747-95cb41cd49a6_1202x489.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vTuv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bc23af7-d277-4eff-b747-95cb41cd49a6_1202x489.png 424w, https://substackcdn.com/image/fetch/$s_!vTuv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bc23af7-d277-4eff-b747-95cb41cd49a6_1202x489.png 848w, https://substackcdn.com/image/fetch/$s_!vTuv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bc23af7-d277-4eff-b747-95cb41cd49a6_1202x489.png 1272w, https://substackcdn.com/image/fetch/$s_!vTuv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bc23af7-d277-4eff-b747-95cb41cd49a6_1202x489.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vTuv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bc23af7-d277-4eff-b747-95cb41cd49a6_1202x489.png" width="1202" height="489" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9bc23af7-d277-4eff-b747-95cb41cd49a6_1202x489.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:489,&quot;width&quot;:1202,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:53811,&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;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vTuv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bc23af7-d277-4eff-b747-95cb41cd49a6_1202x489.png 424w, https://substackcdn.com/image/fetch/$s_!vTuv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bc23af7-d277-4eff-b747-95cb41cd49a6_1202x489.png 848w, https://substackcdn.com/image/fetch/$s_!vTuv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bc23af7-d277-4eff-b747-95cb41cd49a6_1202x489.png 1272w, https://substackcdn.com/image/fetch/$s_!vTuv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bc23af7-d277-4eff-b747-95cb41cd49a6_1202x489.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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 class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xKeX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d55371b-beb6-4f24-ae0a-4e08733dfec8_1196x747.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xKeX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d55371b-beb6-4f24-ae0a-4e08733dfec8_1196x747.png 424w, https://substackcdn.com/image/fetch/$s_!xKeX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d55371b-beb6-4f24-ae0a-4e08733dfec8_1196x747.png 848w, https://substackcdn.com/image/fetch/$s_!xKeX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d55371b-beb6-4f24-ae0a-4e08733dfec8_1196x747.png 1272w, https://substackcdn.com/image/fetch/$s_!xKeX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d55371b-beb6-4f24-ae0a-4e08733dfec8_1196x747.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xKeX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d55371b-beb6-4f24-ae0a-4e08733dfec8_1196x747.png" width="1196" height="747" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4d55371b-beb6-4f24-ae0a-4e08733dfec8_1196x747.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:747,&quot;width&quot;:1196,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:39220,&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;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!xKeX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d55371b-beb6-4f24-ae0a-4e08733dfec8_1196x747.png 424w, https://substackcdn.com/image/fetch/$s_!xKeX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d55371b-beb6-4f24-ae0a-4e08733dfec8_1196x747.png 848w, https://substackcdn.com/image/fetch/$s_!xKeX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d55371b-beb6-4f24-ae0a-4e08733dfec8_1196x747.png 1272w, https://substackcdn.com/image/fetch/$s_!xKeX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d55371b-beb6-4f24-ae0a-4e08733dfec8_1196x747.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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 class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cyku!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49126cd0-e0ed-43af-ba9e-4b4fb5982fdf_1195x742.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cyku!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49126cd0-e0ed-43af-ba9e-4b4fb5982fdf_1195x742.png 424w, https://substackcdn.com/image/fetch/$s_!cyku!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49126cd0-e0ed-43af-ba9e-4b4fb5982fdf_1195x742.png 848w, https://substackcdn.com/image/fetch/$s_!cyku!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49126cd0-e0ed-43af-ba9e-4b4fb5982fdf_1195x742.png 1272w, https://substackcdn.com/image/fetch/$s_!cyku!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49126cd0-e0ed-43af-ba9e-4b4fb5982fdf_1195x742.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cyku!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49126cd0-e0ed-43af-ba9e-4b4fb5982fdf_1195x742.png" width="1195" height="742" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/49126cd0-e0ed-43af-ba9e-4b4fb5982fdf_1195x742.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:742,&quot;width&quot;:1195,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:36171,&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;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!cyku!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49126cd0-e0ed-43af-ba9e-4b4fb5982fdf_1195x742.png 424w, https://substackcdn.com/image/fetch/$s_!cyku!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49126cd0-e0ed-43af-ba9e-4b4fb5982fdf_1195x742.png 848w, https://substackcdn.com/image/fetch/$s_!cyku!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49126cd0-e0ed-43af-ba9e-4b4fb5982fdf_1195x742.png 1272w, https://substackcdn.com/image/fetch/$s_!cyku!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49126cd0-e0ed-43af-ba9e-4b4fb5982fdf_1195x742.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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><h2>Chaikin's Money Flow (CMF), C-style</h2><p>I have come full circle with this indicator. I learned about it and it's logic from "Statistically Sound Indicators" by Timothy Masters. In that book, the code examples provided are in C. So, I took that logic and translated it into Python (infinitely easier to learn and work with), and tested it from there. Then, I took the calculation logic and figured out how to create it using RT script. I got annoyed with creating indicators in RT Script and at some point in my questioning on the forum, I was instructed to look at the <code>RTDLL</code> directory inside the RT install directory. There, I discovered that I can actually code an indicator in C and call it from inside RealTest. The following is the first indicator I completed and tested.</p><p>It's important to mention that RT exposes a header file with pointers you can use to design your indicators. It works on a single pass principle, meaning that the indicators designed this way will work with 1 array of data at a time unless you actively pass in different arrays of data with the function call (more on this in future posts). In this indicator, we actually need to calculate and store a rolling window of data to make further calculations. I attempted to comment this as best I could.</p><p>The rest of this post is for paid subscribers. Paid subscribers will have access to all paid publications, strategies, code associated with posts, and access to the HGT chat room. Red Team members will have access to the community GitHub and more. </p>
      <p>
          <a href="https://newsletter.huntgathertrade.com/p/i-updated-the-cmf-indicator-to-c">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Strategy 9 goes live, day trading ES, and platform overload]]></title><description><![CDATA[Strategy 9 went live on Monday. It's up 4% this week. I got in some good trades on ES this week, so I decided to brag about one. Hot take: All trading platforms suck.]]></description><link>https://newsletter.huntgathertrade.com/p/strategy-9-goes-live-day-trading</link><guid isPermaLink="false">https://newsletter.huntgathertrade.com/p/strategy-9-goes-live-day-trading</guid><dc:creator><![CDATA[Larry Kann]]></dc:creator><pubDate>Sat, 18 Jan 2025 16:48:05 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!9j2c!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85d17c16-0cf6-4fb1-abaa-ebb2e8a7e2d3_1682x880.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9j2c!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85d17c16-0cf6-4fb1-abaa-ebb2e8a7e2d3_1682x880.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9j2c!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85d17c16-0cf6-4fb1-abaa-ebb2e8a7e2d3_1682x880.png 424w, https://substackcdn.com/image/fetch/$s_!9j2c!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85d17c16-0cf6-4fb1-abaa-ebb2e8a7e2d3_1682x880.png 848w, https://substackcdn.com/image/fetch/$s_!9j2c!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85d17c16-0cf6-4fb1-abaa-ebb2e8a7e2d3_1682x880.png 1272w, https://substackcdn.com/image/fetch/$s_!9j2c!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85d17c16-0cf6-4fb1-abaa-ebb2e8a7e2d3_1682x880.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9j2c!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85d17c16-0cf6-4fb1-abaa-ebb2e8a7e2d3_1682x880.png" width="1456" height="762" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/85d17c16-0cf6-4fb1-abaa-ebb2e8a7e2d3_1682x880.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:762,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:47125,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9j2c!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85d17c16-0cf6-4fb1-abaa-ebb2e8a7e2d3_1682x880.png 424w, https://substackcdn.com/image/fetch/$s_!9j2c!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85d17c16-0cf6-4fb1-abaa-ebb2e8a7e2d3_1682x880.png 848w, https://substackcdn.com/image/fetch/$s_!9j2c!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85d17c16-0cf6-4fb1-abaa-ebb2e8a7e2d3_1682x880.png 1272w, https://substackcdn.com/image/fetch/$s_!9j2c!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85d17c16-0cf6-4fb1-abaa-ebb2e8a7e2d3_1682x880.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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><figcaption class="image-caption">Chart from Sierra Chart using Rithmic Data.</figcaption></figure></div><blockquote><p>Disclaimer: the following post is an organized representation of my research and project notes. It doesn&#8217;t represent any type of advice, financial or otherwise. Its purpose is to be informative and educational. Backtest results are based on historical data, not real-time data. There is no guarantee that these hypothetical results will continue in the future. Day trading is extremely risky, and I do not suggest running any of these strategies live.</p></blockquote><p>This is a practice in controlled word vomit, folks. I am just talking about things that I either did or thought about this week while trading and researching. </p><h2>Best trade of the week</h2><p>I've been working on my day trading game recently and thought it would be cool to review any good trades (or good, bad trades) I made during the week. I only got to trade 3 days this week, so I don't have too many candidates for good trades, but I did take a nice ten point move in ES. As you can see from the screenshot below, I don't use too much in the way of indicators and my technical analysis is very simple.</p><p>Most of the day (Friday), all I did was watch. This moved here came near lunchtime and was an easy setup. The day had been trending up since early morning, so I was looking for a pullback into an area of interest. In this case, just a recent low. I only use the RSI indicator you see below as extra confirmation and the ATR is just there so I know how to place my first target if I am trading multiple contracts. The blue represents the high of day.</p><p>That's it. Just two lines.</p><p>It's been a decent week for me, despite only trading 3 days. Or maybe it's been a good week because I only traded 3 days? Either way, it doesn't matter. Just gotta keep refining the process.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!d6jQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c5bdde1-ed16-49bd-a01f-dffea4154e84_1682x880.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!d6jQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c5bdde1-ed16-49bd-a01f-dffea4154e84_1682x880.png 424w, https://substackcdn.com/image/fetch/$s_!d6jQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c5bdde1-ed16-49bd-a01f-dffea4154e84_1682x880.png 848w, https://substackcdn.com/image/fetch/$s_!d6jQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c5bdde1-ed16-49bd-a01f-dffea4154e84_1682x880.png 1272w, https://substackcdn.com/image/fetch/$s_!d6jQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c5bdde1-ed16-49bd-a01f-dffea4154e84_1682x880.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!d6jQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c5bdde1-ed16-49bd-a01f-dffea4154e84_1682x880.png" width="1456" height="762" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5c5bdde1-ed16-49bd-a01f-dffea4154e84_1682x880.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:762,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:47125,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!d6jQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c5bdde1-ed16-49bd-a01f-dffea4154e84_1682x880.png 424w, https://substackcdn.com/image/fetch/$s_!d6jQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c5bdde1-ed16-49bd-a01f-dffea4154e84_1682x880.png 848w, https://substackcdn.com/image/fetch/$s_!d6jQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c5bdde1-ed16-49bd-a01f-dffea4154e84_1682x880.png 1272w, https://substackcdn.com/image/fetch/$s_!d6jQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c5bdde1-ed16-49bd-a01f-dffea4154e84_1682x880.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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><figcaption class="image-caption"><em>Chart from Sierra Chart using Rithmic Data.</em></figcaption></figure></div><h2>Strategy 9</h2><p>While working on setting up my trading environments and getting ready to start forward testing some of the HGT strategies, I went ahead and got Strategy 9 running in a small account I have. If you don't recall what Strategy 9 is, check out the link below:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;c0b82387-3dd0-4c4b-84e0-34dcbf909a60&quot;,&quot;caption&quot;:&quot;Disclaimer: the following post is an organized representation of my research and project notes. It doesn&#8217;t represent any type of advice, financial or otherwise. Its purpose is to be informative and educational. Backtest results are based on historical data, not real-time data. There is no guarantee that these hypothetical results will continue in the future. Day trading is extremely risky, and I do not suggest running any of these strategies live.&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Strategy 9 -- An NDX rotational momentum strategy&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:104503946,&quot;name&quot;:&quot;Larry Kann&quot;,&quot;bio&quot;:&quot;I'm a trader, a father, a writer, and a husband. Before I was a trader, I was a damn good (self-proclaimed) paramedic. I dabble in programming Automated Trade Systems and I dig text manipulation tools, the terminal, and Linux.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9414cf23-7f4e-4f37-a6c2-3880d82c2a88_696x696.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2024-08-09T14:19:10.901Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2e31e94-d712-42d7-963f-959aa380aa3e_1184x761.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://newsletter.huntgathertrade.com/p/strategy-9-an-ndx-rotational-momentum&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:147520846,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:13,&quot;comment_count&quot;:7,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;Hunt Gather Trade&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6c9fff4-8eb5-4173-ab8a-84a15607ce21_1024x1024.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>Strategy 9 is a rotational Nasdaq 100 strategy that we created back in September. We tested the strategy from 2007 up to 07/12/2024. It had a CAGR of 22%, Max Drawdown of -20%, a 62% win rate, and a profit factor of 2 and Sharpe of 1.21.</p><p>If we run the backtest up to December (giving up almost six months of true OOS data), we get these results:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JbCm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bc53e37-94a4-4e37-adc6-77f3ed9787fc_1207x694.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JbCm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bc53e37-94a4-4e37-adc6-77f3ed9787fc_1207x694.png 424w, https://substackcdn.com/image/fetch/$s_!JbCm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bc53e37-94a4-4e37-adc6-77f3ed9787fc_1207x694.png 848w, https://substackcdn.com/image/fetch/$s_!JbCm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bc53e37-94a4-4e37-adc6-77f3ed9787fc_1207x694.png 1272w, https://substackcdn.com/image/fetch/$s_!JbCm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bc53e37-94a4-4e37-adc6-77f3ed9787fc_1207x694.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JbCm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bc53e37-94a4-4e37-adc6-77f3ed9787fc_1207x694.png" width="1207" height="694" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8bc53e37-94a4-4e37-adc6-77f3ed9787fc_1207x694.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:694,&quot;width&quot;:1207,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:35794,&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;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!JbCm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bc53e37-94a4-4e37-adc6-77f3ed9787fc_1207x694.png 424w, https://substackcdn.com/image/fetch/$s_!JbCm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bc53e37-94a4-4e37-adc6-77f3ed9787fc_1207x694.png 848w, https://substackcdn.com/image/fetch/$s_!JbCm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bc53e37-94a4-4e37-adc6-77f3ed9787fc_1207x694.png 1272w, https://substackcdn.com/image/fetch/$s_!JbCm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bc53e37-94a4-4e37-adc6-77f3ed9787fc_1207x694.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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><figcaption class="image-caption">Created with RealTest.</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!noor!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8cfc1ab-9ffd-46f9-a5d2-9d18d656cd38_1912x695.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!noor!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8cfc1ab-9ffd-46f9-a5d2-9d18d656cd38_1912x695.png 424w, https://substackcdn.com/image/fetch/$s_!noor!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8cfc1ab-9ffd-46f9-a5d2-9d18d656cd38_1912x695.png 848w, https://substackcdn.com/image/fetch/$s_!noor!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8cfc1ab-9ffd-46f9-a5d2-9d18d656cd38_1912x695.png 1272w, https://substackcdn.com/image/fetch/$s_!noor!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8cfc1ab-9ffd-46f9-a5d2-9d18d656cd38_1912x695.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!noor!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8cfc1ab-9ffd-46f9-a5d2-9d18d656cd38_1912x695.png" width="1456" height="529" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b8cfc1ab-9ffd-46f9-a5d2-9d18d656cd38_1912x695.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:529,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:39826,&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;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!noor!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8cfc1ab-9ffd-46f9-a5d2-9d18d656cd38_1912x695.png 424w, https://substackcdn.com/image/fetch/$s_!noor!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8cfc1ab-9ffd-46f9-a5d2-9d18d656cd38_1912x695.png 848w, https://substackcdn.com/image/fetch/$s_!noor!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8cfc1ab-9ffd-46f9-a5d2-9d18d656cd38_1912x695.png 1272w, https://substackcdn.com/image/fetch/$s_!noor!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8cfc1ab-9ffd-46f9-a5d2-9d18d656cd38_1912x695.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" 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"><g><title></title><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 tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"><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><figcaption class="image-caption">Created with RealTest.</figcaption></figure></div><p>As you can see, it had a drawdown after the summer and has since then been slowly grinding it's way out. It looks like it was probably just a hair away from triggering the drawdown filter. Regardless, I decided to start trading this strategy live to see how it does. It rebalances every Friday, so I figured I could keep a rolling update of it's performance here.</p><p>This strategy took it's first positions on Monday (01/13/2025). We close this week out at X%...</p><p>I took the positions on Monday well after open, which is not how it is supposed to be done. The orders are meant to be placed on open. I will make sure that happens going forward.</p><p>Here are the trades that I took Monday:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1GS7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e9e6737-f563-4edf-9856-e924006afda2_612x114.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1GS7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e9e6737-f563-4edf-9856-e924006afda2_612x114.png 424w, https://substackcdn.com/image/fetch/$s_!1GS7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e9e6737-f563-4edf-9856-e924006afda2_612x114.png 848w, https://substackcdn.com/image/fetch/$s_!1GS7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e9e6737-f563-4edf-9856-e924006afda2_612x114.png 1272w, https://substackcdn.com/image/fetch/$s_!1GS7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e9e6737-f563-4edf-9856-e924006afda2_612x114.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1GS7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e9e6737-f563-4edf-9856-e924006afda2_612x114.png" width="612" height="114" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7e9e6737-f563-4edf-9856-e924006afda2_612x114.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:114,&quot;width&quot;:612,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:13550,&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;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!1GS7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e9e6737-f563-4edf-9856-e924006afda2_612x114.png 424w, https://substackcdn.com/image/fetch/$s_!1GS7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e9e6737-f563-4edf-9856-e924006afda2_612x114.png 848w, https://substackcdn.com/image/fetch/$s_!1GS7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e9e6737-f563-4edf-9856-e924006afda2_612x114.png 1272w, https://substackcdn.com/image/fetch/$s_!1GS7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e9e6737-f563-4edf-9856-e924006afda2_612x114.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p> </p><p>And here is the performance from this week:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NjfZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcf0b8e7-cfd1-4ab4-a3a3-9ec1364e4880_603x170.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NjfZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcf0b8e7-cfd1-4ab4-a3a3-9ec1364e4880_603x170.png 424w, https://substackcdn.com/image/fetch/$s_!NjfZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcf0b8e7-cfd1-4ab4-a3a3-9ec1364e4880_603x170.png 848w, https://substackcdn.com/image/fetch/$s_!NjfZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcf0b8e7-cfd1-4ab4-a3a3-9ec1364e4880_603x170.png 1272w, https://substackcdn.com/image/fetch/$s_!NjfZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcf0b8e7-cfd1-4ab4-a3a3-9ec1364e4880_603x170.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NjfZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcf0b8e7-cfd1-4ab4-a3a3-9ec1364e4880_603x170.png" width="603" height="170" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fcf0b8e7-cfd1-4ab4-a3a3-9ec1364e4880_603x170.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:170,&quot;width&quot;:603,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:15922,&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;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!NjfZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcf0b8e7-cfd1-4ab4-a3a3-9ec1364e4880_603x170.png 424w, https://substackcdn.com/image/fetch/$s_!NjfZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcf0b8e7-cfd1-4ab4-a3a3-9ec1364e4880_603x170.png 848w, https://substackcdn.com/image/fetch/$s_!NjfZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcf0b8e7-cfd1-4ab4-a3a3-9ec1364e4880_603x170.png 1272w, https://substackcdn.com/image/fetch/$s_!NjfZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcf0b8e7-cfd1-4ab4-a3a3-9ec1364e4880_603x170.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Not bad, for the first week. Hopefully I can create a better way to track this strategy, so I don't have to take screenshots of IBKR's desktop application...</p><p><em>Important Note: I am not going to be providing any &#8220;signals&#8221;. The update for 9 is going to come on a weekly basis AFTER the trade week. What you see are orders generated for this week. New orders are generated after close on Friday. If you want to see what it generates each week, you will need to get the strategy and do it at your own risk.</em></p><h2>Platform overload</h2><p>Remember when I said, "all trading platforms suck"? I was only kidding a little bit. Like, a tiny little bit. A negligible amount, really. It seems like a big sweeping generalization, but I think it's one of the more accurate ones. Want to know why I feel this way? Sure you do. </p><p>Time to vent a little (<em>cracks knuckles, positions keyboard</em>).</p><p>Why doesn't IBKR offer direct API access (to non-institutional customers)? Why does IBGateway and TWS take so much fucking memory (between 750MB to 1.5G in my experience) to run in the background doing nothing? It's almost like they really just want you running their software on your desktop as often as possible. Why?</p><p>Why do good data providers (Norgate, CSI) require you use their software to download the data? This goes back to APIs. I just want to access the data when I need to and then I can store and backup local copies on my own without having to worry about yet another program running in the background all day long.</p><p>Why do other traders seem to focus on the shit that doesn't matter? I know that IBKR has super cheap data. But you get what you pay for. Also, streaming data is the one part of a platform that requires the most work to make sure it works well. When I was trading equities, I used a program called DAS Trader Pro to connect to my IBKR account. This was the smoothest shit ever. I literally only used it for direct access order routing (look it up) and high-speed, efficient streaming data. Both of these where offerings from the platform. The only thing it did with IBKR was connect to my account to place orders. And it did it WITHOUT the TWS or IBGateway software. I wonder how they managed to do that...</p><p>Why are people happy with Python performance? Do you know how long it would take to backtest a strategy across all SP500 constituents for the last 20 years? It might only take an hour to create the backtesting engine, but it will also take the better part of the hour to pre-calculate all your extra values and loop through the history to perform the test. No thanks. I would rather take the 10 years to learn C++... &lt;-- Jokes.</p><p>Ok, I'm done. Moving on.</p><h3>My Current Platform list (absolutely subject to change, and hopefully soon)</h3><p>I have been doing a lot of messing around with different platforms this week. I can't begin to explain how much it annoys me that there isn't a single platform that does everything I need it to do. Right now, the platforms I am having to deal with are:</p><ul><li><p>Interactive Brokers (IBKR) TWS or IBGateway</p><ul><li><p>There is no good option here. Both of these products kind of suck a lot of ass. They use excessive resources just to run in the background and IBKR doesn't offer direct API access unless you are institutional customer.</p></li></ul></li><li><p>Rithmic Trader Pro</p><ul><li><p>This is used for trading futures prop firm accounts. There is no getting around it. Oddly, I don't have any issues with this software. It's simple and I only use it to monitor trades and orders when I'm day trading.</p></li></ul></li><li><p>Sierra Chart</p><ul><li><p>This is the software I chart and day trade from. Really, I don't have anything bad to say about it. It's a bit harder to get the hang of in the beginning, but it does everything you need it to do for an all-in-one platform. If I had to keep only one platform, this would be it.</p></li></ul></li><li><p>RealTest</p><ul><li><p>This is for researching and backtesting EOD strategies. When it finally gets intraday capability, I will use it for that too. I don't think there is anything better that handles multiple strategies and multiple instrument universes better. This one stays.</p></li></ul></li><li><p>OrderClerk</p><ul><li><p>This software comes with RealTest and creates a bridge between RealTest and IBKR. It places orders to IBKR via CSV and tracks trades from IBKR to feed accurate trade lists back to RealTest so it generates accurate order sizes for any strategy that you are trading live. It's pretty dope, but it still requires the localhost gateway API's through IBKR's TWS or IBGateway, the latter of which is mother fucker to work with for this purpose due to trade history request limitations.</p></li></ul></li><li><p>Norgate Data</p><ul><li><p>This is for good EOD data. For now, this is what I use. I don't like having to use their software to get their data, but the software is pretty simple and does everything you need it to do without consuming too many system resources. Still, I would like direct API access.</p></li></ul></li><li><p>TradeStation</p><ul><li><p>Shocking, I know. I just recently opened up a tiny account with TradeStation so I could learn how to make strategies and indicators in EasyLanguage (EL). I don't imagine that I will be doing any trading or running any automations through this platform for myself. I have it mostly for any prospective clients or subscribers who want something in EL.</p></li></ul></li></ul><p>That's a lot of different platforms just to research and day trade, right? And not a single one does everything I would like to see in a single platform. Sierra Chart comes hella close, but it lacks good connections for trading stocks. It connects to IBKR, but like every third-party connection to IBKR, this is only a half-assed solution that requires use of their software as a middleman to connect to their API.</p><p>As you can tell, I am quite frustrated with IBKR's lack of a modern API. I am stuck with them for now, since I am using them to test out Strategy 9. I plan on rectifying this situation by creating my own tool to submit CSV orders to IBKR. They have a small client portal option that can be used with docker to get access to the API without all the resource hogging (and God only knows what else). This solution will probably work until IBKR opens the API up to regular clients. Or maybe I will just switch to something like Alpaca, who knows.</p><p>Since I am currently day trading in a prop firm account (evaluation, I am testing if my day trading methodology lines up with their consistency rules), I can't avoid using Rithmic. Sierra Chart lets you run multiple instances of itself (so does RealTest), so it's fairly simple to just dedicate one install to the Rithmic data feed and leave it alone. For futures trading, this setup is just about perfect.</p><h2>Actions to take</h2><p>First, keep trading well.</p><p>Second, slim up this platform overload. I'm thinking I'll drop the IBKR software and OrderClerk and replace this with my own command line tool for submitting orders to IBKR (looking at Go for this). I will still have to use a gateway, but they have a tiny little java program that I can use in a docker image for this. It's better, but still not the perfect setup. For now, everything else will have to stay.</p><p>I want to drop Norgate by the time my renewal comes up in about 5 months, but I will need to really figure out how to handle certain things in RealTest, like historical constituency checks... ok, that might actually be all I have to solve. Then, I need to test backtest performance for the different data sources. I know data matters, but my hypothesis is that I don't see that much of a difference. We shall see.</p><p>TradeStation stays because it's just there for prospective clients (hit me up if you want something developed privately) and to learn EasyLanguage.</p><p>Sierra Chart is my favorite trading platform for active day trading right now. So, it ain't going anywhere. Rithmic is required for prop accounts, so I am stuck with it for the time being.</p><p>These actions would really just leave me with Sierra Chart, Rithmic, and RealTest (since TradeStation is just kind of there). That's way better than all the shit I currently have plaguing my machine. I know that these are first-world problems, but they are problem that irk me to no end. So, I just need to create my own solutions.</p><h3>Learning C/C++</h3><p>If you don't know, RealTest and Sierra Chart are both programs that are written in highly efficient C code. If you want to make any custom functions for either of them (bet you didn't know that you could do that with RealTest), it is a good idea to understand C. Which I don't, really. So, I am going to learn.</p><p>In order to learn this, I am hoping to create some research tools in C. They will probably be open source, but they will be oriented towards the developer/researcher. I do not intend to abstract anything away for the "user". I think this is the issue I am having with all of the proprietary platforms. It's about making it "easy" for the user. In order to make things easier for the user, certain things get sacrificed. Simple scripting languages are cool, but I would rather be able to use the full power of a programming language. I'm sure I fall into a very small group of users, but that's fine. The goal is to build something that can be built upon to suite whatever needs the researcher/trader has.</p><h2>Conclusion</h2><p>That's it for this week&#8217;s updates. Next week I am going to start breaking down a stupid complicated indicator and how I am using it in RealTest. Then, we will explore whether or not it is actually useful for trading by backtesting it's signals with some new strategies. Get ready for some silliness, because this indicator is a little complicated and it will require that I make some parts in C and leave some parts as scripts inside RealTest. I will not create this indicator in Python, because it would just take too long for it make its calculations across large universes.</p><p>Happy hunting.</p><p>Feel free to comment below or e-mail me if you need help with anything, wish to criticize, or have thoughts on improvements. You can also DM me or start a chat thread. Red Team members can access this code and more at the private <a href="https://github.com/Hunt-Gather-Trade">HGT GitHub repo</a>. As always, this newsletter represents refined versions of my research notes. That means these notes are plastic. There could be mistakes or better ways to accomplish what I am trying to do. Nothing is perfect, and I always look for ways to improve my techniques.</p>]]></content:encoded></item></channel></rss>