<?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[ML for Trading Insights]]></title><description><![CDATA[Notes on ML for trading — and applied AI more broadly — from the author of the third edition.]]></description><link>https://insights.ml4trading.io</link><image><url>https://substackcdn.com/image/fetch/$s_!5KbB!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7c2e3b8-b91b-41ba-a42d-a371f6359359_800x800.png</url><title>ML for Trading Insights</title><link>https://insights.ml4trading.io</link></image><generator>Substack</generator><lastBuildDate>Tue, 21 Jul 2026 03:43:06 GMT</lastBuildDate><atom:link href="https://insights.ml4trading.io/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Stefan Jansen]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[ml4t@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[ml4t@substack.com]]></itunes:email><itunes:name><![CDATA[Stefan Jansen]]></itunes:name></itunes:owner><itunes:author><![CDATA[Stefan Jansen]]></itunes:author><googleplay:owner><![CDATA[ml4t@substack.com]]></googleplay:owner><googleplay:email><![CDATA[ml4t@substack.com]]></googleplay:email><googleplay:author><![CDATA[Stefan Jansen]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[The Coding-Agent Toolkit: A Workflow Loop You Can Install]]></title><description><![CDATA[Seven host-neutral steps to improve agent productivity, now public, that run the same on Claude Code and OpenAI Codex.]]></description><link>https://insights.ml4trading.io/p/the-coding-agent-toolkit-a-workflow</link><guid isPermaLink="false">https://insights.ml4trading.io/p/the-coding-agent-toolkit-a-workflow</guid><dc:creator><![CDATA[Stefan Jansen]]></dc:creator><pubDate>Tue, 07 Jul 2026 17:57:24 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/d78b4951-e2e5-4feb-85da-b6440587cce7_2400x1260.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The <a href="https://insights.ml4trading.io/p/a-coding-agent-reading-list-behind">previous issue</a> was a reading list on coding agents. It separated three loops that run around one: </p><ul><li><p>the <strong>agent loop</strong> that writes or edits code, </p></li><li><p>the <strong>harness loop</strong> that decides whether the work is acceptable, and </p></li><li><p>the <strong>workflow loop</strong> that decides what work should exist, who reviews it, and what state survives into the next run. </p></li></ul><p>The argument was that the workflow loop is where the engineer stays. The issue closed on a design rule &#8212; decide what the agent may change, define how the harness checks it, preserve the evidence needed for review, and keep the research claim outside the automation boundary &#8212; and then stopped, because a reading list describes a loop without handing you one.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sr_A!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56db89a-9cb5-468f-ae24-e3a1d48979a8_3000x1875.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sr_A!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56db89a-9cb5-468f-ae24-e3a1d48979a8_3000x1875.png 424w, https://substackcdn.com/image/fetch/$s_!sr_A!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56db89a-9cb5-468f-ae24-e3a1d48979a8_3000x1875.png 848w, https://substackcdn.com/image/fetch/$s_!sr_A!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56db89a-9cb5-468f-ae24-e3a1d48979a8_3000x1875.png 1272w, https://substackcdn.com/image/fetch/$s_!sr_A!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56db89a-9cb5-468f-ae24-e3a1d48979a8_3000x1875.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sr_A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56db89a-9cb5-468f-ae24-e3a1d48979a8_3000x1875.png" width="1456" height="910" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b56db89a-9cb5-468f-ae24-e3a1d48979a8_3000x1875.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:910,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:110304,&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://insights.ml4trading.io/i/205851940?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56db89a-9cb5-468f-ae24-e3a1d48979a8_3000x1875.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_!sr_A!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56db89a-9cb5-468f-ae24-e3a1d48979a8_3000x1875.png 424w, https://substackcdn.com/image/fetch/$s_!sr_A!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56db89a-9cb5-468f-ae24-e3a1d48979a8_3000x1875.png 848w, https://substackcdn.com/image/fetch/$s_!sr_A!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56db89a-9cb5-468f-ae24-e3a1d48979a8_3000x1875.png 1272w, https://substackcdn.com/image/fetch/$s_!sr_A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56db89a-9cb5-468f-ae24-e3a1d48979a8_3000x1875.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><em>The three loops from the last issue. The agent loop writes code; the harness loop checks whether the work is acceptable; the workflow loop decides whether the work should exist, who reviews it, and how state persists. This release is one implementation of that outer loop.</em></p><p><code>coding-agent-toolkit</code> <a href="https://github.com/stefan-jansen/coding-agent-toolkit">is now public</a>: seven host-neutral steps that take a piece of work from a rough idea to a merged pull request, on both Claude Code and OpenAI Codex. It is the specific workflow loop I run daily, released now because the shape has stopped moving. The agent does the work; the toolkit keeps the state.</p><p>A concrete case for what &#8220;keeps the state&#8221; buys you. An agent starts a data-loader fix, patches the imports, and gets three tests green before it runs out of context. The next morning, a fresh session &#8212; maybe on the other host &#8212; picks up the branch. With nothing durable on disk, it re-reads the repo, guesses at what was in flight, and quietly widens a loader fix into a refactor of the ingestion layer. With a spec, a plan, an open issue, and a handoff snapshot to read first, it resumes the same scoped task: finish the loader fix, keep the diff reviewable, and stop. The workflow loop is what makes the second outcome the default.</p><h2>What The Seven Steps Do</h2><p>Five steps carry a piece of work forward &#8212; <code>align</code>, <code>plan</code>, <code>plan-issues</code>, <code>next-issue</code>, <code>ship</code> &#8212; and two, <code>handoff</code> and <code>continue</code>, carry state across the gaps between sessions. Each writes one file the next step reads, so state lives on disk rather than in a conversation, and each exists to head off a specific way delegated work goes wrong.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!C779!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e950934-111b-4226-959d-a7b1871d24f3_3200x1520.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!C779!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e950934-111b-4226-959d-a7b1871d24f3_3200x1520.png 424w, https://substackcdn.com/image/fetch/$s_!C779!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e950934-111b-4226-959d-a7b1871d24f3_3200x1520.png 848w, https://substackcdn.com/image/fetch/$s_!C779!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e950934-111b-4226-959d-a7b1871d24f3_3200x1520.png 1272w, https://substackcdn.com/image/fetch/$s_!C779!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e950934-111b-4226-959d-a7b1871d24f3_3200x1520.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!C779!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e950934-111b-4226-959d-a7b1871d24f3_3200x1520.png" width="1456" height="692" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6e950934-111b-4226-959d-a7b1871d24f3_3200x1520.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:692,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:192752,&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://insights.ml4trading.io/i/205851940?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e950934-111b-4226-959d-a7b1871d24f3_3200x1520.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_!C779!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e950934-111b-4226-959d-a7b1871d24f3_3200x1520.png 424w, https://substackcdn.com/image/fetch/$s_!C779!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e950934-111b-4226-959d-a7b1871d24f3_3200x1520.png 848w, https://substackcdn.com/image/fetch/$s_!C779!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e950934-111b-4226-959d-a7b1871d24f3_3200x1520.png 1272w, https://substackcdn.com/image/fetch/$s_!C779!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e950934-111b-4226-959d-a7b1871d24f3_3200x1520.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><em>The five delivery steps, the file or GitHub object each writes, and the two transition steps that carry state across boundaries. The file on disk is the contract that the next step reads.</em></p><ul><li><p><code>align</code><strong> &#8594; </strong><code>spec.md</code><strong>.</strong> Interrogates a rough request into a verifiable end-state, one question at a time, before any code is written &#8212; so the agent is not optimizing toward an implicit, private definition of done.</p></li><li><p><code>plan</code><strong> &#8594; </strong><code>plan.md</code><strong>.</strong> Breaks the spec into issue-sized chunks with dependencies, so one request does not arrive as a single sprawling change that no one can review.</p></li><li><p><code>plan-issues</code><strong> &#8594; a GitHub milestone and one issue per chunk.</strong> Dry-run by default; <code>--apply</code> writes. The work becomes reviewable units under version control, not lines in a chat transcript.</p></li><li><p><code>next-issue</code><strong> &#8594; a branch, an implementation, tests, and a PR.</strong> Takes the lowest-numbered open issue in the active milestone, so the agent works the next scoped unit instead of whatever is convenient.</p></li><li><p><code>ship</code><strong> &#8594; a squash-merge and a closed milestone.</strong> Runs only after verifying that every issue has a commit with a closing footer, so nothing merges while leaving the work graph half-open.</p></li><li><p><code>handoff</code><strong> / </strong><code>continue</code><strong> &#8594; a durable session transition.</strong> <code>handoff</code> writes a snapshot; <code>continue</code> replays it and flags drift &#8212; so the next session does not trust stale prose, and drift does not stay invisible until it corrupts the next task.</p></li></ul><p>Six of the seven ship as a Claude skill and a mirrored Codex prompt. <code>plan</code> is the exception: it delegates to each host&#8217;s native plan mode and a capture hook, because re-implementing plan mode as a shell command would discard the structured output the host already produces.</p><p><code>Closes #N</code> in a PR body is the signal that bubbles state up: a merged PR closes its issue, and <code>ship</code> closes the milestone once every issue is closed by a commit footer. GitHub is the projection; the file each step writes to disk is the contract the next step &#8212; or the next agent &#8212; reads, rather than re-deriving where things stand.</p><p>The same steps apply to non-code work when the deliverable consists of reviewable files. <code>Closes #N</code> closes an issue about a chapter draft or a research report as cleanly as one about a bug fix.</p><h2>How It Answers The Design Rule</h2><p>The last issue&#8217;s rule had four clauses. The toolkit maps onto three directly; the harness clause it leaves to your existing tests and review.</p><ul><li><p><strong>Decide what the agent may change.</strong> <code>align</code> produces a spec with acceptance criteria before the agent touches a file. The scope is written down and reviewable in advance, so &#8220;the agent wrote something&#8221; and &#8220;the agent did the agreed work&#8221; become separate, checkable claims.</p></li><li><p><strong>Preserve the evidence needed for review.</strong> The chain produces a milestone, issues, branches, and a merged PR &#8212; a trail a human reads, rather than an agent transcript to reconstruct afterward. The diff arrives scoped to one issue, tied to a stated spec, with a closing footer.</p></li><li><p><strong>Keep the research claim outside the automation boundary.</strong> The last issue&#8217;s sharpest example was a data-loader test made to pass by dropping the tickers that had stopped returning history: the suite goes green, and the backtest quietly runs on survivors only. The code is correct; the research claim has changed. A host-neutral workflow layer does not prevent that edit by itself &#8212; domain checks do that: a frozen universe, a survivorship guard, an invariant test.</p></li></ul><p>What the workflow changes is visibility. The edit arrives as a scoped PR against a spec that stated what the loader was for, so a reviewer sees a change to the ticker universe instead of a green checkmark, and the domain checks have somewhere to run. The same reading list noted that many agent failures are workflow failures &#8212; abandoned reviews, duplicate work, task mismatches &#8212; rather than syntax errors, and that this is the layer this works on.</p><p>The toolkit does not make the model write better code, nor does it replace tests, domain invariants, data checks, cost models, or review. It makes the agent work legible enough that those checks &#8212; and a human &#8212; can still own the result.</p><h2>Cross-Host State</h2><p>The same workflow runs on Claude Code and OpenAI Codex because there is no orchestrator between them. The cross-host primitive is a shared durable state under <code>.workspace/</code>, read natively by both.</p><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/a7xTr/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/958d3cc3-9d96-4a3c-b30b-f8bf22b89a4b_1220x628.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ce7077c2-01b1-4bbc-83cf-9678deb0146b_1220x752.png&quot;,&quot;height&quot;:400,&quot;title&quot;:&quot;What lives under .workspace/&quot;,&quot;description&quot;:&quot;Shared, host-neutral state that both Claude Code and Codex read.&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/a7xTr/1/" width="730" height="400" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><p>Swapping hosts mid-feature works because the next session &#8212; whichever host it runs on &#8212; picks up where the last one left off by reading what the last one wrote. There is deliberately no &#8220;execute as the other host&#8221; command; the file is the swap.</p><p>Session continuity has one refinement worth calling out. A prose handoff goes stale silently: the next session cannot tell whether what it describes is still true. <code>handoff</code> pairs the summary with a fenced block of read-only commands, each carrying an inline <code># expect: &lt;value&gt;</code>. <code>continue</code> runs each command, compares the output to the expected value, and flags every divergence. Drift is information: a repo one commit ahead is fine; a milestone that has since closed may matter. <code>continue</code> surfaces suggested next steps and does not act on them.</p><p>This release supersedes <code>claude-code-toolkit</code>, the broader, Claude-only predecessor &#8212; a wide collection of patterns and plugins. This one is narrower: seven steps, two hosts, one job. It is a sibling, not a competitor, to code review: if you run <a href="https://github.com/kenn-io/roborev">roborev</a>, open reviews on the current branch surface when a session starts, and stay silent when it is not installed. One reviews code, one drives work, and they compose.</p><h2>Installing It</h2><p><strong>Claude Code.</strong> Copy or symlink <code>skills/</code> into your project&#8217;s <code>.claude/skills/</code>, or install the <code>workflow</code> plugin from the <a href="https://github.com/stefan-jansen/coding-agent-plugins">coding-agent-plugins</a> marketplace, which mirrors the same steps. The marketplace is Claude-side; the toolkit itself is cross-host.</p><p><strong>OpenAI Codex.</strong> Point your prompts directory at <code>codex/prompts/</code>, or copy the files in.</p><p>Then invoke the steps in order on a new piece of work, and <code>handoff</code> / <code>continue</code> at the boundaries of anything long-running. The <code>SKILL.md</code> in each step directory is that step&#8217;s authoritative documentation; there is no separate runtime to install.</p><p>The toolkit is pre-1.0 and MIT-licensed. The step contracts are stable enough for daily use, but their shape may still shift in response to friction encountered in real work. Issues and PRs are welcome. Repository: <a href="https://github.com/stefan-jansen/coding-agent-toolkit">github.com/stefan-jansen/coding-agent-toolkit</a>.</p><h2>Where This Sits In The ML4T Work</h2><p>The near-term value of coding agents for ML4T readers is the bounded, checkable work: environment repair, notebook maintenance, data-loader fixes, test scaffolding, CI triage, reproducible experiment plumbing. The workflow loop is what keeps that work reviewable as you delegate more of it, and what draws the line the last issue insisted on &#8212; between the changes you hand to the loop and the ones that decide whether a result is real.</p><p>Today I am teaching a free Maven Lightning Lesson, <a href="https://maven.com/p/8394ac/getting-stuff-done-with-coding-agents">Getting stuff done with coding agents</a> (4:00 PM UTC), which walks through this chain end-to-end: turning an ambiguous goal into a scoped work unit, keeping state across sessions, and using review gates so a human still owns the result.</p><p>For the hands-on version, I am running a workshop, <a href="https://maven.com/stefan-jansen/loop-engineering">Loop Engineering: Reliable Work From Coding Agents</a>, on July 18 (10 am&#8211;2 pm EDT). It builds what this issue describes, on your own keyboard: turn a vague goal into a verifiable spec, project the plan onto GitHub issues, and write a handoff that survives the session boundary. It also puts you in front of the green-but-wrong failure &#8212; the suite passes while the result is corrupted &#8212; and has you write a verification skill the agent cannot satisfy by quietly dropping the tickers that stopped reporting.</p><p>The same division of labor &#8212; what you hand to the loop, what stays with you because it decides whether the result is real &#8212; runs through the <a href="https://maven.com/stefan-jansen/research-to-production">Machine Learning for Trading: From Research to Production</a> cohort across nine case studies; the current summer cohort is full, with a waitlist for the next.</p>]]></content:encoded></item><item><title><![CDATA[A Coding-Agent Reading List: Behind the Loops]]></title><description><![CDATA[Loop engineering is only the surface. A reading path through the older control problems underneath &#8212; and the line between what a coding agent may change and the experimental decisions that determine whether a result is valid.]]></description><link>https://insights.ml4trading.io/p/a-coding-agent-reading-list-behind</link><guid isPermaLink="false">https://insights.ml4trading.io/p/a-coding-agent-reading-list-behind</guid><dc:creator><![CDATA[Stefan Jansen]]></dc:creator><pubDate>Thu, 02 Jul 2026 13:45:26 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/52e7b314-049a-4002-946d-75f670c095e0_1200x630.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This is a sourced reading list on coding agents, split into six kinds of source &#8212; practitioner essays, control-theory foundations, LLM-agent primitives, systems and harness papers, field studies, and benchmarks &#8212; so you can match a question to the evidence that can settle it. The through-line: &#8220;loop engineering&#8221; is the visible surface; the problems underneath &#8212; bounded search, partial observability, delegation, verification &#8212; are older and better studied.</p><p>&#8220;Loop engineering&#8221; names a real shift in practice: developers spend less time on single prompts and more time designing the system around the agent &#8212; context, tools, state, branches, tests, permissions, review, and stop rules. That is worth naming.</p><p>But a serious reading list cannot stop with the current discourse. The current labels give new names to problems that control theory, planning, and human-automation research have studied for decades: bounded search, partial observability, shared state, reusable actions, delegation, verification, and supervisory control. The newer work matters because LLMs made these problems operational in software repositories, where the agent can change files and the environment can push back through tests, logs, compilers, benchmarks, diffs, and code review.</p><p>This list separates six kinds of sources:</p><ol><li><p>practitioner pieces that explain why &#8220;loops&#8221; became the current label;</p></li><li><p>older control and agent foundations that give the label depth;</p></li><li><p>LLM-agent primitives that explain the mechanism;</p></li><li><p>coding-agent systems and harness papers;</p></li><li><p>empirical studies of adoption, review, refactoring, context, and test quality;</p></li><li><p>benchmarks and safety work that measure task completion or risk.</p></li></ol><p>That separation matters. A benchmark is not the same as a field study. A product essay is not the same as evidence. A context-file study is not the same as a repository-level benchmark. Mixing them into one bucket makes the field look thinner than it is.</p><p>Match your question to the bucket, and note what that kind of source can and cannot settle:</p><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/Fi7uo/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9c3b57bc-15d1-4897-964f-c8aefbd812f1_1220x808.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bd6b77f0-fa9d-40b8-b7bc-699634ccd1a7_1220x932.png&quot;,&quot;height&quot;:400,&quot;title&quot;:&quot;What each kind of source can and cannot settle&quot;,&quot;description&quot;:&quot;Match your reading to the question you actually have.&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/Fi7uo/1/" width="730" height="400" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!grXV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc716092b-cd26-4ece-bfb7-96bcc144101e_3000x1687.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!grXV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc716092b-cd26-4ece-bfb7-96bcc144101e_3000x1687.png 424w, https://substackcdn.com/image/fetch/$s_!grXV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc716092b-cd26-4ece-bfb7-96bcc144101e_3000x1687.png 848w, https://substackcdn.com/image/fetch/$s_!grXV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc716092b-cd26-4ece-bfb7-96bcc144101e_3000x1687.png 1272w, https://substackcdn.com/image/fetch/$s_!grXV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc716092b-cd26-4ece-bfb7-96bcc144101e_3000x1687.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!grXV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc716092b-cd26-4ece-bfb7-96bcc144101e_3000x1687.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c716092b-cd26-4ece-bfb7-96bcc144101e_3000x1687.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:103293,&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://insights.ml4trading.io/i/204557345?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc716092b-cd26-4ece-bfb7-96bcc144101e_3000x1687.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_!grXV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc716092b-cd26-4ece-bfb7-96bcc144101e_3000x1687.png 424w, https://substackcdn.com/image/fetch/$s_!grXV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc716092b-cd26-4ece-bfb7-96bcc144101e_3000x1687.png 848w, https://substackcdn.com/image/fetch/$s_!grXV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc716092b-cd26-4ece-bfb7-96bcc144101e_3000x1687.png 1272w, https://substackcdn.com/image/fetch/$s_!grXV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc716092b-cd26-4ece-bfb7-96bcc144101e_3000x1687.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><em>Prompt quality still matters, but the engineering surface expands as agents gain context, tools, state, permissions, verification, and persistence.</em></p><h2>From Prompting To Loop Engineering: The Current Discourse</h2><p>Read these first to understand the vocabulary. Then move on.</p><ul><li><p><strong><a href="https://addyosmani.com/blog/loop-engineering/">Addy Osmani, &#8220;Loop Engineering&#8221;</a>.</strong> The term&#8217;s current anchor. Osmani frames loop engineering as designing the system that prompts, monitors, and resumes the agent. The useful primitives are automations, worktrees, skills, plugins or connectors, subagents, and external memory. Read it for language, not for empirical proof.</p></li><li><p><strong><a href="https://www.deeplearning.ai/the-batch/issue-359">Andrew Ng on three product-building loops (The Batch #359, June 2026)</a>.</strong> The highest-profile statement of the frame, published as the naming wave crested. Ng separates three loops by timescale and who acts: an agentic coding loop (minutes), a developer-feedback loop (tens of minutes to hours), and an external-feedback loop (days to weeks). That is a different cut than Figure 2 below, which separates loops by what each one validates &#8212; evidence, not contradiction, that &#8220;loops&#8221; already names several things. Ng also traces the phrase&#8217;s spread to Boris Cherny (Claude Code) and Peter Steinberger (OpenClaw).</p></li><li><p><strong><a href="https://lucumr.pocoo.org/2026/6/23/the-coming-loop/">Armin Ronacher, &#8220;The Coming Loop&#8221;</a>.</strong> The skeptical counterpart. Ronacher separates the model&#8217;s tool-result cycle from the external harness that restarts, redirects, or escalates work. Read it for comprehension debt: the risk that code becomes easier for machines to change than for humans to understand.</p></li><li><p><strong><a href="https://simonwillison.net/2025/Sep/30/designing-agentic-loops/">Simon Willison, &#8220;Designing agentic loops&#8221;</a>.</strong> A cleaner earlier statement of the loop idea: agents run tools in a loop to achieve a goal. The value is that it predates the June 2026 naming wave.</p></li><li><p><strong><a href="https://martinfowler.com/articles/harness-engineering.html">Birgitta B&#246;ckeler, &#8220;Harness engineering for coding agent users&#8221;</a>.</strong> Published on martinfowler.com. Note the pieces around the model: guides, sensors, tests, feedback, and the boundaries that make delegated work reviewable.</p></li><li><p><strong><a href="https://ghuntley.com/loop/">Geoffrey Huntley, &#8220;everything is a ralph loop&#8221;</a>.</strong> A reminder that the external while-loop around a coding agent existed before the current name. The practice predates the label.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jOVn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8311203a-1dde-4907-a019-e3bad47f2911_3000x1875.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jOVn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8311203a-1dde-4907-a019-e3bad47f2911_3000x1875.png 424w, https://substackcdn.com/image/fetch/$s_!jOVn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8311203a-1dde-4907-a019-e3bad47f2911_3000x1875.png 848w, https://substackcdn.com/image/fetch/$s_!jOVn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8311203a-1dde-4907-a019-e3bad47f2911_3000x1875.png 1272w, https://substackcdn.com/image/fetch/$s_!jOVn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8311203a-1dde-4907-a019-e3bad47f2911_3000x1875.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jOVn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8311203a-1dde-4907-a019-e3bad47f2911_3000x1875.png" width="1456" height="910" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8311203a-1dde-4907-a019-e3bad47f2911_3000x1875.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:910,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:110304,&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://insights.ml4trading.io/i/204557345?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8311203a-1dde-4907-a019-e3bad47f2911_3000x1875.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_!jOVn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8311203a-1dde-4907-a019-e3bad47f2911_3000x1875.png 424w, https://substackcdn.com/image/fetch/$s_!jOVn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8311203a-1dde-4907-a019-e3bad47f2911_3000x1875.png 848w, https://substackcdn.com/image/fetch/$s_!jOVn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8311203a-1dde-4907-a019-e3bad47f2911_3000x1875.png 1272w, https://substackcdn.com/image/fetch/$s_!jOVn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8311203a-1dde-4907-a019-e3bad47f2911_3000x1875.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><em>The agent loop writes code; the harness loop checks whether the work is acceptable; the workflow loop decides whether the work should exist, who reviews it, and how state persists.</em></p><h2>Older Agent And Control Foundations</h2><p>This is the layer the previous draft underdeveloped. These sources are not ornaments. They are the reason the current vocabulary makes sense.</p><ul><li><p><strong><a href="https://archive.org/details/humanproblemsolv0000newe">Newell and Simon, </a></strong><em><strong><a href="https://archive.org/details/humanproblemsolv0000newe">Human Problem Solving</a></strong></em><strong>.</strong> The starting point for problem solving as search through a structured problem space under bounded computation. Coding agents explore repo states, command outputs, and patch candidates under similar limits.</p></li><li><p><strong><a href="https://ai.stanford.edu/~nilsson/OnlinePubs-Nils/PublishedPapers/astar.pdf">Hart, Nilsson, and Raphael, &#8220;A Formal Basis for the Heuristic Determination of Minimum Cost Paths&#8221;</a>.</strong> The A* paper. It belongs here because loop design is partly about spending search budget intelligently: which branch, which tool call, which retry, which stop condition.</p></li><li><p><strong><a href="https://ai.stanford.edu/~nilsson/OnlinePubs-Nils/PublishedPapers/strips.pdf">Fikes and Nilsson, &#8220;STRIPS&#8221;</a>.</strong> Preconditions, operators, and effects. Modern tool calls look different, but safe agent design still asks what must be true before an action runs and what the action changes.</p></li><li><p><strong><a href="https://projects.laas.fr/planning/">Ghallab, Nau, and Traverso, </a></strong><em><strong><a href="https://projects.laas.fr/planning/">Automated Planning: Theory and Practice</a></strong></em><strong>.</strong> A broad synthesis of planning, decomposition, actions, goals, temporal structure, and uncertainty. It gives a broader frame than &#8220;prompt a model to make a plan.&#8221;</p></li><li><p><strong><a href="https://people.csail.mit.edu/lpk/papers/aij98-pomdp.pdf">Kaelbling, Littman, and Cassandra, &#8220;Planning and Acting in Partially Observable Stochastic Domains&#8221;</a>.</strong> A coding agent never sees the full system. Files, logs, tests, prior runs, and issue text are observations. Context engineering is better belief-state maintenance, not larger prompts.</p></li><li><p><strong><a href="https://stacks.stanford.edu/file/druid%3Ats923xj4709/ts923xj4709.pdf">Erman, Hayes-Roth, Lesser, and Reddy, &#8220;The Hearsay-II Speech-Understanding System&#8221;</a>.</strong> The canonical blackboard architecture. Multiple specialized knowledge sources coordinate through shared state. Modern versions include issue trackers, state files, memory logs, CI summaries, and review artifacts.</p></li><li><p><strong><a href="https://aaai.org/papers/icmas95-042-bdi-agents-from-theory-to-practice/">Rao and Georgeff, &#8220;BDI Agents: From Theory to Practice&#8221;</a>.</strong> The belief-desire-intention model is still useful for separating what an agent knows, what it is trying to achieve, and what course of action it has committed to.</p></li><li><p><strong><a href="https://www-anw.cs.umass.edu/~barto/courses/cs687/Sutton-Precup-Singh-AIJ99.pdf">Sutton, Precup, and Singh, &#8220;Between MDPs and Semi-MDPs&#8221;</a>.</strong> The options framework gives the clean lineage for skills: reusable, temporally extended actions that can be selected like primitives.</p></li><li><p><strong><a href="https://erichorvitz.com/chi99horvitz.pdf">Horvitz, &#8220;Principles of Mixed-Initiative User Interfaces&#8221;</a>.</strong> Good agent systems need rules for initiative: when the system proceeds, asks, pauses, escalates, or hands control back.</p></li><li><p><strong><a href="https://web.mit.edu/16.459/www/parasuraman.pdf">Parasuraman and Riley, &#8220;Humans and Automation: Use, Misuse, Disuse, Abuse&#8221;</a>.</strong> The automation-trust paper to read before giving agents more authority. Coding-agent failures often come from overtrust, under-specification, or weak supervision rather than local syntax errors.</p></li><li><p><strong><a href="https://archive.org/details/teleroboticsauto0000sher">Sheridan, </a></strong><em><strong><a href="https://archive.org/details/teleroboticsauto0000sher">Telerobotics, Automation, and Supervisory Control</a></strong></em><strong>.</strong> A durable treatment of human supervision over semi-autonomous systems. It is directly relevant to agent loops that operate while a human reviews only the artifacts.</p></li></ul><h2>LLM-Agent Primitives</h2><p>This layer is closer to the earlier agent canon, but here the emphasis is on what each source adds to coding-agent loops.</p><ul><li><p><strong><a href="https://arxiv.org/abs/2112.09332">WebGPT</a>.</strong> Browse, gather evidence, cite. It is an early template for language models acting through tools rather than answering from memory.</p></li><li><p><strong><a href="https://arxiv.org/abs/2205.00445">MRKL</a>.</strong> Modular routing across tools and symbolic systems. It foreshadows the connector/plugin layer.</p></li><li><p><strong><a href="https://arxiv.org/abs/2210.03629">ReAct</a>.</strong> The atom of the modern agent loop: reason, act, observe.</p></li><li><p><strong><a href="https://arxiv.org/abs/2302.04761">Toolformer</a>.</strong> Tool use as a learnable behavior, not only an inference-time wrapper.</p></li><li><p><strong><a href="https://arxiv.org/abs/2303.11366">Reflexion</a>.</strong> Actor, evaluator, self-reflection, and memory. Coding agents need the same separation between making a change and judging it.</p></li><li><p><strong><a href="https://arxiv.org/abs/2305.10601">Tree of Thoughts</a>.</strong> Branch, score, and backtrack. Maps onto parallel worktrees, alternate patches, and explicit search over candidate plans.</p></li><li><p><strong><a href="https://arxiv.org/abs/2305.16291">Voyager</a>.</strong> Executable skills that accumulate over time. It is the clearest ancestor for practical skill libraries.</p></li><li><p><strong><a href="https://arxiv.org/abs/2402.01030">CodeAct</a>.</strong> Executable code as the action language. This is central to why coding agents feel different from generic chat agents.</p></li><li><p><strong><a href="https://arxiv.org/abs/2405.15793">SWE-agent</a>.</strong> The agent-computer interface becomes a first-class variable. The environment and harness shape the observed capability.</p></li><li><p><strong><a href="https://arxiv.org/abs/2407.01502">AI Agents That Matter</a>.</strong> Cost, holdout validity, benchmark shortcuts, and complexity discipline. Read this before believing any agent leaderboard.</p></li></ul><h2>Coding-Agent Systems, Harnesses, And Configuration</h2><p>This group is about the engineering layer between the model and the repo.</p><ul><li><p><strong><a href="https://arxiv.org/abs/2310.06770">SWE-bench</a>.</strong> The most widely cited benchmark for repository-level issue resolution. It belongs in this section as the benchmark that shaped coding-agent systems, not as a field study about adoption.</p></li><li><p><strong><a href="https://arxiv.org/abs/2405.15793">SWE-agent</a>.</strong> Also belongs here because it showed that the agent-computer interface changes performance. The same model can behave differently under a different scaffold.</p></li><li><p><strong><a href="https://arxiv.org/abs/2401.07339">CodeAgent</a>.</strong> Early repo-level, tool-integrated code generation. Useful for seeing how tool use entered repository work before the current loop vocabulary.</p></li><li><p><strong><a href="https://arxiv.org/abs/2504.15228">SICA: A Self-Improving Coding Agent</a>.</strong> A coding agent modifies its own codebase and improves from 17 to 53 percent on a random SWE-bench Verified subset. Read it as a harness/self-improvement result, not as proof of open-ended autonomy.</p></li><li><p><strong><a href="https://arxiv.org/abs/2605.18747">Code as Agent Harness</a>.</strong> A synthesis of the idea that code is not only the agent output; it is also part of the harness that structures reasoning, action, and verification.</p></li><li><p><strong><a href="https://arxiv.org/abs/2602.14690">Configuring Agentic AI Coding Tools</a>.</strong> A practical taxonomy of configuration mechanisms across coding tools.</p></li><li><p><strong><a href="https://arxiv.org/abs/2605.08435">A Dataset of Agentic AI Coding Tool Configurations</a>.</strong> Shows what configuration patterns appear in real repositories, rather than only in vendor docs.</p></li><li><p><strong><a href="https://arxiv.org/abs/2511.12884">Agent READMEs</a>.</strong> Descriptive evidence on context files in the wild: what teams put in them, how they vary, and why they behave more like configuration than prose.</p></li><li><p><strong><a href="https://arxiv.org/abs/2602.11988">Evaluating AGENTS.md</a>.</strong> The corrective to context-file enthusiasm. Repository instructions can reduce success and increase cost if they add irrelevant or distracting guidance.</p></li></ul><h2>Empirical Studies Of Use, Review, And Maintenance</h2><p>This section is distinct from benchmarks. These studies look at adoption, pull requests, review, refactoring, context use, and test quality in practice.</p><ul><li><p><strong><a href="https://arxiv.org/abs/2601.18341">Agentic Much?</a>.</strong> A GitHub-scale adoption study. The current arXiv version reports 22.20 to 28.66 percent adoption across 128,018 GitHub projects. It measures traces of use, not net value.</p></li><li><p><strong><a href="https://arxiv.org/abs/2602.09185">AIDev</a>.</strong> A dataset of agent-authored pull requests &#8212; 932,791 PRs across 116,211 repositories, produced by five agents. Keep it separate from companion studies that analyze acceptance or failure.</p></li><li><p><strong><a href="https://arxiv.org/abs/2507.15003">The Rise of AI Teammates in SE 3.0</a>.</strong> Uses an earlier AIDev slice to study agentic PR behavior. Read for the acceptance gap and the difference between speed and accepted contribution.</p></li><li><p><strong><a href="https://arxiv.org/abs/2601.15195">Where Do AI Coding Agents Fail?</a>.</strong> A failure study of agent-authored PRs. It is valuable because many failures are workflow failures: abandoned review, duplicate work, CI/test failures, or task mismatch.</p></li><li><p><strong><a href="https://arxiv.org/abs/2511.04824">Agentic Refactoring</a>.</strong> Refactoring is not one thing. Agents can make local structural changes while leaving deeper design issues intact.</p></li><li><p><strong><a href="https://arxiv.org/abs/2602.00409">Are Coding Agents Generating Over-Mocked Tests?</a>.</strong> Test quality matters because shallow verification is easy to satisfy. Agent commits change tests more often than non-agent commits (23 versus 13 percent) and add mocks more often (36 versus 26 percent).</p></li><li><p><strong><a href="https://arxiv.org/abs/2602.05892">ContextBench</a>.</strong> Process-oriented evidence that finding relevant code and using it correctly are different skills.</p></li><li><p><strong><a href="https://arxiv.org/abs/2602.08316">SWE-ContextBench</a>.</strong> Prior experience can help, but only when retrieved and summarized correctly. This is the right paper to read before building memory-heavy loops.</p></li><li><p><strong><a href="https://arxiv.org/abs/2603.20432">Coding Agents Are Effective Long-Context Processors</a>.</strong> Supports the idea that agents can externalize long-context processing through filesystems and tools. Do not generalize it to all long-horizon maintenance.</p></li></ul><h2>Benchmarks, Stress Tests, And Safety</h2><p>Benchmarks are not field studies. They measure task performance under a protocol. They are useful when the protocol is visible.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wr_3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6879bb89-1cde-4cd4-be2a-2665e5dcf84e_3375x2100.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wr_3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6879bb89-1cde-4cd4-be2a-2665e5dcf84e_3375x2100.png 424w, https://substackcdn.com/image/fetch/$s_!wr_3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6879bb89-1cde-4cd4-be2a-2665e5dcf84e_3375x2100.png 848w, https://substackcdn.com/image/fetch/$s_!wr_3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6879bb89-1cde-4cd4-be2a-2665e5dcf84e_3375x2100.png 1272w, https://substackcdn.com/image/fetch/$s_!wr_3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6879bb89-1cde-4cd4-be2a-2665e5dcf84e_3375x2100.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wr_3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6879bb89-1cde-4cd4-be2a-2665e5dcf84e_3375x2100.png" width="1456" height="906" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6879bb89-1cde-4cd4-be2a-2665e5dcf84e_3375x2100.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:906,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:163168,&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://insights.ml4trading.io/i/204557345?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6879bb89-1cde-4cd4-be2a-2665e5dcf84e_3375x2100.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_!wr_3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6879bb89-1cde-4cd4-be2a-2665e5dcf84e_3375x2100.png 424w, https://substackcdn.com/image/fetch/$s_!wr_3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6879bb89-1cde-4cd4-be2a-2665e5dcf84e_3375x2100.png 848w, https://substackcdn.com/image/fetch/$s_!wr_3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6879bb89-1cde-4cd4-be2a-2665e5dcf84e_3375x2100.png 1272w, https://substackcdn.com/image/fetch/$s_!wr_3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6879bb89-1cde-4cd4-be2a-2665e5dcf84e_3375x2100.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>Read benchmark scores as protocol results. A benchmark can say what an agent did under a task set, scaffold, tool policy, and evaluation rule. It does not by itself establish production value, review cost, or research validity.</p><ul><li><p><strong><a href="https://arxiv.org/abs/2310.06770">SWE-bench</a>.</strong> Real GitHub issues as repository-level tasks. Essential, but easy to overread once leaderboards saturate or scaffolds diverge.</p></li><li><p><strong><a href="https://arxiv.org/abs/2504.08703">SWE-PolyBench</a>.</strong> Multi-language repository-level evaluation. It helps counter Python-only benchmark bias.</p></li><li><p><strong><a href="https://arxiv.org/abs/2506.22598">RExBench</a>.</strong> Research-extension tasks in real repositories. A useful ceiling check for hard, novel work.</p></li><li><p><strong><a href="https://arxiv.org/abs/2605.17526">SaaSBench</a>.</strong> Long-horizon enterprise SaaS engineering. Its main lesson is integration: failures often happen before agents reach deep business logic.</p></li><li><p><strong><a href="https://arxiv.org/abs/2411.07781">RedCode</a>.</strong> Risky code execution and generation. This belongs in the core path because coding agents operate tools, shells, files, and sometimes networks.</p></li><li><p><strong><a href="https://owasp.org/www-project-top-10-for-large-language-model-applications/">OWASP Top 10 for LLM Applications</a>.</strong> The security frame for prompt injection, supply chain risk, sensitive data, and excessive agency.</p></li></ul><p>When reading a benchmark score, ask: which task set, which date, which model, which scaffold, which tools, which permissions, and which evaluation protocol? A model score without the harness is not a product capability claim.</p><h2>What This Means For ML4T Work</h2><p>For ML4T readers, the near-term value of coding agents is practical: environment repair, notebook maintenance, data-loader fixes, test scaffolding, documentation updates, CI triage, and reproducible experiment plumbing. These tasks are useful because they are bounded and checkable. To make the work more reliable, we published <a href="https://ml4trading.io/skills/">60+ ML4T agent skills</a>.</p><p>The risky step is letting an agent mutate the research claim. In trading and ML, the dangerous errors are often leakage, wrong timestamps, stale data assumptions, broken evaluation windows, accidental survivorship, weak baselines, or transaction-cost assumptions that no longer match the text.</p><p>The failure is rarely a syntax error. A more typical case: an agent makes a failing data-loader test pass by dropping the tickers that stopped returning history. The suite goes green, and the backtest quietly runs on survivors only. The code is correct; the research claim has changed.</p><p>For an ML4T notebook, loader, or backtest change, an agent-generated patch should record:</p><ul><li><p>data source and snapshot date;</p></li><li><p>timestamp convention and decision-time availability;</p></li><li><p>label definition;</p></li><li><p>train/test split or walk-forward window;</p></li><li><p>baseline comparison;</p></li><li><p>transaction-cost assumption where relevant;</p></li><li><p>exact command to reproduce the result;</p></li><li><p>files changed and why;</p></li><li><p>tests added or modified;</p></li><li><p>reviewer note on whether the research claim changed.</p></li></ul><p>Do not delegate changes that redefine the target variable, change the backtest window, select the best run after repeated iteration, add data that would not have been known at decision time, or rewrite the published claim to fit the new output. Those choices belong to the research process, not to the coding loop.</p><p>On Tuesday, July 7, I am teaching a free Maven Lightning Lesson, <a href="https://maven.com/p/8394ac/getting-stuff-done-with-coding-agents">Getting stuff done with coding agents</a>. The lesson is the practical companion to this reading list: how to turn an ambiguous goal into a scoped work unit, keep state across sessions, use review gates, and make agent work legible enough that a human can still own the result.</p><p>The same boundary sits at the center of <em><a href="http://maven.com/stefan-jansen/research-to-production">Machine Learning for Trading: From Research to Production</a></em>, the cohort course I am running this summer: it works nine case studies through that exact division of labor &#8212; what you can hand to the loop, and what stays with you because it decides whether the result is real. Watch the <a href="https://youtu.be/Ksxv9QVZSOo?si=IxUZVO3j1enFEzVJ">video overview</a>.</p><h2>Compressed Reading Path</h2><p>If the full list is too much, start here:</p><ol><li><p>Osmani, Ronacher, Willison, B&#246;ckeler, and Huntley for the current loop and harness debate.</p></li><li><p>Newell/Simon, POMDPs, Hearsay-II, options, mixed initiative, automation misuse, and supervisory control for the older design problems.</p></li><li><p>ReAct, Reflexion, Voyager, CodeAct, SWE-agent, and AI Agents That Matter for the LLM-agent mechanism.</p></li><li><p>Evaluating AGENTS.md, Agentic Much?, AIDev, Where Do AI Coding Agents Fail?, Agentic Refactoring, Over-mocked Tests, and ContextBench for field evidence.</p></li><li><p>SWE-bench, RExBench, SaaSBench, SWE-PolyBench, and RedCode for benchmark and safety constraints.</p></li></ol><p>The practical result is a design rule: decide what the agent may change, define how the harness checks it, preserve the evidence needed for review, and keep the research claim outside the automation boundary.</p>]]></content:encoded></item><item><title><![CDATA[From Research to Production with Nine Case Studies]]></title><description><![CDATA[A hands-on ML4T course built on nine case studies: one research workflow from feasibility through deployment &#8212; equities, options, futures, FX, and crypto.]]></description><link>https://insights.ml4trading.io/p/from-research-to-production-with</link><guid isPermaLink="false">https://insights.ml4trading.io/p/from-research-to-production-with</guid><dc:creator><![CDATA[Stefan Jansen]]></dc:creator><pubDate>Wed, 01 Jul 2026 12:42:07 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/1fe4b3ec-a8b9-4531-9e07-bd9eb9674849_1200x630.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This summer we&#8217;re opening the first cohort of <em>Machine Learning for Trading: From Research to Production</em> &#8212; a hands-on course built around nine case studies, where you take one trading strategy from a first feasibility check all the way through deployment. See <a href="https://maven.com/stefan-jansen/research-to-production">course page</a> and <a href="https://youtu.be/Ksxv9QVZSOo">overview video</a> for more details.</p><p>Here is the kind of problem that workflow has to handle.</p><p>One of those nine case studies runs the ML4T workflow on thirty CME futures, daily, from 2011 through 2025. The model is a gradient-boosted ranker on a five-day forward return, traded as a long-short book &#8212; long the top-ranked contracts, short the bottom, inverse-volatility weighted across both sides. The label that feeds it is built on a ratio-adjusted continuous price series: back-adjusting the price level at each contract roll keeps the roll gap from registering as a price move, so it never lands in the forward returns the model trains on. Leave the series unadjusted and every roll embeds that artifact. Both decisions matter, and so does the validation around them: the result is measured on a holdout never touched during model selection, and against a long-only equal-weight basket of the same contracts.</p><p>Put together, they hold up. The validation Sharpe &#8212; the inverse-vol book under a 5% trailing-stop overlay &#8212; is 1.36, and on the 2024&#8211;2025 holdout it comes in at 1.11 &#8212; close enough that the profile carries, though the window is short enough that the gap between the two is not statistically resolved. The robust part is the signal itself: a daily information coefficient near 0.03 that clears the 5% significance threshold on both windows (on autocorrelation-robust standard errors, since the five-day labels overlap), and a result that survives the cost model &#8212; a Sharpe near 1.0 net of a tick-implied trading cost of about 10 basis points of notional per leg (modeled, not realized fills), against a breakeven near 30 basis points per leg, a roughly threefold cushion. It sits above the long-only basket too (about 0.6 in validation, 0.8 on the holdout), though a long-short book against a long-only directional basket is a floor rather than a risk-matched comparison. In this market the data construction shapes the result just as much as the model family does: get the roll handling wrong and even the cleanest model trains on a price path you could never have held. The case works because the data, the model, the cost model, and the holdout each carry their weight, and the workflow is built to show which stage carries how much.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OIqc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8402ed-5205-4124-8cae-660bb87c9fd4_3017x2104.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OIqc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8402ed-5205-4124-8cae-660bb87c9fd4_3017x2104.png 424w, https://substackcdn.com/image/fetch/$s_!OIqc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8402ed-5205-4124-8cae-660bb87c9fd4_3017x2104.png 848w, https://substackcdn.com/image/fetch/$s_!OIqc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8402ed-5205-4124-8cae-660bb87c9fd4_3017x2104.png 1272w, https://substackcdn.com/image/fetch/$s_!OIqc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8402ed-5205-4124-8cae-660bb87c9fd4_3017x2104.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OIqc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8402ed-5205-4124-8cae-660bb87c9fd4_3017x2104.png" width="1456" height="1015" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4e8402ed-5205-4124-8cae-660bb87c9fd4_3017x2104.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1015,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:437026,&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://insights.ml4trading.io/i/204355791?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8402ed-5205-4124-8cae-660bb87c9fd4_3017x2104.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_!OIqc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8402ed-5205-4124-8cae-660bb87c9fd4_3017x2104.png 424w, https://substackcdn.com/image/fetch/$s_!OIqc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8402ed-5205-4124-8cae-660bb87c9fd4_3017x2104.png 848w, https://substackcdn.com/image/fetch/$s_!OIqc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8402ed-5205-4124-8cae-660bb87c9fd4_3017x2104.png 1272w, https://substackcdn.com/image/fetch/$s_!OIqc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8402ed-5205-4124-8cae-660bb87c9fd4_3017x2104.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></p><p><em>Validation (left) and a holdout the model never saw (right), each against a long-only equal-weight basket of the same thirty contracts. Validation Sharpe 1.36; holdout 1.11 &#8212; the profile carries across the split.</em></p><p>None of those decisions is glamorous on its own: most of a strategy&#8217;s fate is settled in the handoffs between stages, not in the choice of model. We ran this loop nine times, and the new cohort is built so you run it too: you walk away with the workflow and one case you took all the way through yourself.</p><p>That workflow is the same on every case: a feasibility check, labels and features, a ladder of models, backtesting, portfolio construction, cost and risk analysis, an out-of-sample holdout, the deployment path, and the monitoring after. Running it nine times is what makes the handoffs visible: the decision that carries each case moves from one market to the next, so you learn the pattern instead of one example. Every run is logged, and you keep the notebooks, the run registry, and the deployment scaffold.</p><h2>The comparative lab</h2><p>The pipeline is fixed; what it has to handle changes with the market. ETFs anchor the set as a shared reference &#8212; daily frequency, an inspectable universe, a cost model you can reason about, an allocator you can deploy &#8212; and the other eight show how the same workflow adapts when the market does.</p><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/07mtd/2/&quot;,&quot;thumbnail_url&quot;:&quot;https://datawrapper.dwcdn.net/07mtd/full.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://datawrapper.dwcdn.net/07mtd/full.png&quot;,&quot;height&quot;:600,&quot;title&quot;:&quot;&quot;,&quot;description&quot;:&quot;One research workflow across nine markets, and what each case teaches.&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/07mtd/2/" width="730" height="600" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><p>The two S&amp;P rows describe different problems on the same underlying: one uses options data as side information to forecast equities; the other trades the options directly &#8212; the same instrument posed as two different trading problems. Each setting shows where an edge comes from, and how much of it survives once costs and capacity are real.</p><h2>What the workflow forces you to confront</h2><p>A working pipeline, stage by stage, in the same numbered sequence on every case &#8212; one notebook per stage, mapped to the chapter that teaches it:</p><ul><li><p><strong>Feasibility</strong> &#8212; confirm the universe and its cost structure can support a strategy before you model anything; the straddle case is a feasibility problem before it is a modeling one.</p></li><li><p><strong>Labels and features</strong> &#8212; forward returns at the horizon you actually trade, walk-forward splits, and features from momentum and carry to model-based ones: walk-forward GARCH, HMM regimes, particle-filtered stochastic volatility.</p></li><li><p><strong>A model ladder</strong> &#8212; linear baselines, Optuna-tuned gradient boosting, neural tabular and sequence models, latent-factor methods, and double machine learning for the causal question.</p></li><li><p><strong>Strategy construction</strong> &#8212; backtest, covariance cleaning with random-matrix methods (following Paleologo&#8217;s treatment), an instrument-appropriate cost model, and risk overlays.</p></li><li><p><strong>Validation</strong> &#8212; an out-of-sample holdout scored with deflated performance measures and multiple-testing corrections.</p></li><li><p><strong>Production</strong> &#8212; a deployment loop, then drift monitoring once it is running.</p></li></ul><p>The work that decides the outcome lives in the handoffs between these stages, and one principle keeps reappearing: use only data you would have known at decision time. In the CME opener it was building the label on a roll-adjusted series, so the model never learns from a continuation no one could have traded. In NASDAQ microstructure it is bar-close timestamps &#8212; whether an order-book feature was observable when the 15-minute bar closed. In the firm-characteristics panel it is reporting lags and restatements, aligning each fundamental field to the date it was actually known. Different markets, same decision, and it separates a tradable result from a notebook artifact &#8212; which you only learn by working the case.</p><h2>The record, and the right to deploy</h2><p>Model work is where people expect the course to get technical. It does, and the discipline that makes it pay off is being able to prove, six weeks later, exactly what you ran.</p><p>Every training run, prediction set, causal estimate, and backtest is written to a run log: a SQLite registry where each entry is content-addressed by a hash of its full configuration, with its artifacts and results recorded against that hash. A hyperparameter sweep becomes an auditable archive you can query rather than a folder of guesses. That is what makes a model comparison honest: the synthesis step reads the registry to recover how many configurations you effectively tried, then scores each candidate against that count &#8212; deflated and probabilistic Sharpe ratios, multiple-testing corrections, the probability of backtest overfitting, and a block-bootstrap comparison against an equal-weight benchmark. (The deflated-Sharpe and overfitting measures are L&#243;pez de Prado&#8217;s.) Your best result is judged against the number of attempts it took to find it, and then it meets an out-of-sample holdout it has never touched.</p><p>When validation and the holdout agree, you have evidence to carry the strategy forward: paper trading, limited deployment, or further monitoring. The firm-characteristics case is the cleanest version of that agreement: a monthly cross-sectional ranker over roughly 2,500 US stocks whose validation Sharpe of 2.75 carries to 1.77 on a holdout the model never saw, with its drawdown profile holding intact alongside the Sharpe &#8212; the cleanest such transfer of the nine. When validation and the holdout disagree instead, the course teaches you to read why &#8212; whether the prediction degraded, the portfolio translation lost it, or the regime changed. Where a causal question is well defined, a double-ML treatment-effect estimate with a refutation test asks whether the relationship survives a different specification &#8212; a separate question from whether the strategy is tradable after costs. That diagnostic ability is what lets you tell the strategies worth more of your time from the ones that are not.</p><h2>Through deployment, and after</h2><p>A research result is not the finish line. The deployment chapters run the strategy as a live loop: a unified framework that shares feature and signal code between research and live paths so they cannot silently diverge, a verification step that checks that parity, an order state machine, broker integrations for paper and live trading, and runtime safety controls. In the cohort, deployment means standing up that loop and its controls; committing capital stays your decision. The monitoring chapters cover what happens once it is running: drift detection on features and predictions, circuit breakers, safe model rollout, and a feature store so the live system reads the same features it was trained on. This is running code &#8212; the ETF, crypto-funding, and FX cases each have a working deployment loop.</p><h2>In the cohort</h2><p>You take one case study &#8212; or your own data, if it fits the scope &#8212; and run the arc end to end: a clean baseline, a hypothesis about its binding constraint, two or three targeted cycles, each change tested against an out-of-sample holdout under the same protocol. Some changes hold up; some do not, and the cohort is built around learning to tell them apart. What you produce is a research package and the verdict it earns &#8212; advance, revise, or retire &#8212; scored against a rubric you see on day one.</p><p>Coding agents work inside that same protocol. The third edition ships an <code>ml4t-skills</code> companion &#8212; 61 skills mapping specific failure modes (leakage, lookahead, purging, cost models, capacity, deployment) to checks an agent runs in your editor, browsable now with a free account at https://www.ml4trading.io/skills/. Agents speed up loaders, tests, and ablations; the skills keep that speed inside the research protocol so the code stays correct as it gets faster.</p><h2>Logistics</h2><p>The first cohort starts Monday, July 6, 2026, and the first live session is Thursday, July 9, at 4 PM UTC. The format is eight weekly 90-minute cohort sessions on Thursdays &#8212; twelve hours of live class &#8212; plus four biweekly 60-minute office-hours sessions, and a final 30-minute one-on-one discussion with me about your project. Every session is recorded and posted within a day, so nothing is lost if you miss a live hour. Between sessions, support runs through a dedicated Discord server, so questions on your case do not have to wait for the next session.</p><p>The book publishes in the coming weeks: chapters one through ten are already public, with the case-study code rolling out after, and cohort members get everything they need from day one. Several cases run on free, open data; the intraday microstructure work uses institutional AlgoSeek data, provided to every cohort member along with the rest of the course material.</p><p>The best fit is a reader who can already build a complete strategy and wants to get better at the research itself. By the end you have a complete case-study research package &#8212; the workflow, the diagnosis and experiments behind your result, your out-of-sample evidence, and the means to repeat all of it on your own data.</p><p>See <a href="https://maven.com/stefan-jansen/research-to-production">course page</a> and <a href="https://youtu.be/Ksxv9QVZSOo">overview video</a> for more details.</p>]]></content:encoded></item><item><title><![CDATA[New Release: From Data to Model-Ready Evidence]]></title><description><![CDATA[The ML4T code release for Chapters 6-10 covers the research framework, labels, feature engineering, model-based features, and text features.]]></description><link>https://insights.ml4trading.io/p/new-release-from-data-to-model-ready</link><guid isPermaLink="false">https://insights.ml4trading.io/p/new-release-from-data-to-model-ready</guid><dc:creator><![CDATA[Stefan Jansen]]></dc:creator><pubDate>Mon, 29 Jun 2026 12:18:05 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/6b6ff878-df7e-4726-a256-ee1187df726c_1200x630.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This <a href="https://github.com/stefan-jansen/machine-learning-for-trading/tree/main">ML4T code release</a> covers Chapters 6-10 of the third edition. These chapters sit between the data layer and the model chapters.</p><p>The first release covered the data side: market data, microstructure, alternative data, synthetic data, and the <code>data/</code> package. This release adds the next layer: the trading setup, labels, features, diagnostics, validation checks, and point-in-time inputs.</p><p>Here, model-ready evidence means something practical: the target, feature timing, validation split, and search history are explicit enough to inspect before model selection starts. A lot can go wrong before an estimator enters the workflow: the label can use the wrong horizon, the feature can belong to the wrong decision time, the cross-validation split can mismatch the trading cadence, or the result can come from too many uncounted trials.</p><p>Across the five chapters, the release adds 43 notebooks:</p><ul><li><p><a href="https://github.com/stefan-jansen/machine-learning-for-trading/tree/main/06_strategy_definition">Chapter 6: Strategy Research Framework</a> &#8212; 2 notebooks</p></li><li><p><a href="https://github.com/stefan-jansen/machine-learning-for-trading/tree/main/07_defining_the_learning_task">Chapter 7: Defining the Learning Task</a> &#8212; 9 notebooks</p></li><li><p><a href="https://github.com/stefan-jansen/machine-learning-for-trading/tree/main/08_financial_features">Chapter 8: Financial Feature Engineering</a> &#8212; 8 notebooks</p></li><li><p><a href="https://github.com/stefan-jansen/machine-learning-for-trading/tree/main/09_model_based_features">Chapter 9: Model-Based Feature Extraction</a> &#8212; 15 notebooks</p></li><li><p><a href="https://github.com/stefan-jansen/machine-learning-for-trading/tree/main/10_text_feature_engineering">Chapter 10: Text Feature Engineering</a> &#8212; 9 notebooks</p></li></ul><p>The release also updates the <a href="https://github.com/stefan-jansen/machine-learning-for-trading/tree/main/case_studies">case-study directory</a> with shared utilities and each case study&#8217;s <code>config/setup.yaml</code>: universe, costs, walk-forward CV, and labels.</p><p>We will work through the same research-to-production workflow as in the live Machine Learning for Trading: From Research to Production course, which starts Monday, July 6.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7ZS4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8f90e68-72ec-4aa8-abd4-a843e02afd1e_1409x752.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7ZS4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8f90e68-72ec-4aa8-abd4-a843e02afd1e_1409x752.png 424w, https://substackcdn.com/image/fetch/$s_!7ZS4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8f90e68-72ec-4aa8-abd4-a843e02afd1e_1409x752.png 848w, https://substackcdn.com/image/fetch/$s_!7ZS4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8f90e68-72ec-4aa8-abd4-a843e02afd1e_1409x752.png 1272w, https://substackcdn.com/image/fetch/$s_!7ZS4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8f90e68-72ec-4aa8-abd4-a843e02afd1e_1409x752.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7ZS4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8f90e68-72ec-4aa8-abd4-a843e02afd1e_1409x752.png" width="1409" height="752" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e8f90e68-72ec-4aa8-abd4-a843e02afd1e_1409x752.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:752,&quot;width&quot;:1409,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:202185,&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://insights.ml4trading.io/i/204103460?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f18ca1a-a721-4d52-b257-b67e87cf2f45_1600x900.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_!7ZS4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8f90e68-72ec-4aa8-abd4-a843e02afd1e_1409x752.png 424w, https://substackcdn.com/image/fetch/$s_!7ZS4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8f90e68-72ec-4aa8-abd4-a843e02afd1e_1409x752.png 848w, https://substackcdn.com/image/fetch/$s_!7ZS4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8f90e68-72ec-4aa8-abd4-a843e02afd1e_1409x752.png 1272w, https://substackcdn.com/image/fetch/$s_!7ZS4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8f90e68-72ec-4aa8-abd4-a843e02afd1e_1409x752.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><em>Part II connects the data chapters to the model chapters: research setup, labels, features, validation, and model-ready inputs.</em></p><h2>Where to start</h2><p>If you want the shortest path through the release:</p><ul><li><p>Start with <code>06_strategy_definition/01_cv_foundations</code> for walk-forward validation, purging, embargo, and nested CV.</p></li><li><p>Start with <code>07_defining_the_learning_task/03_label_methods</code> if the prediction target is still unclear.</p></li><li><p>Start with <code>08_financial_features/05_feature_selection</code> if the feature set is too broad.</p></li><li><p>Start with <code>09_model_based_features/11_hmm_regimes</code> if the regime state is part of the signal story.</p></li><li><p>Start with <code>10_text_feature_engineering/09_filing_text_signals</code> if you need point-in-time NLP alignment.</p></li></ul><h2><a href="https://github.com/stefan-jansen/machine-learning-for-trading/tree/main/06_strategy_definition">Chapter 6: Strategy Research Framework</a></h2><p>Chapter 6 defines a trading strategy as an executable decision process, not just a signal or model. It specifies the market, universe, decision schedule, tradability rules, score-to-position mapping, costs, constraints, evaluation metrics, and run logging.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Uwuk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9422c6be-17c4-4346-87ca-03354ced3b22_1600x853.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Uwuk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9422c6be-17c4-4346-87ca-03354ced3b22_1600x853.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Uwuk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9422c6be-17c4-4346-87ca-03354ced3b22_1600x853.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Uwuk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9422c6be-17c4-4346-87ca-03354ced3b22_1600x853.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Uwuk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9422c6be-17c4-4346-87ca-03354ced3b22_1600x853.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Uwuk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9422c6be-17c4-4346-87ca-03354ced3b22_1600x853.jpeg" width="1456" height="776" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9422c6be-17c4-4346-87ca-03354ced3b22_1600x853.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:776,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:242351,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://insights.ml4trading.io/i/204103460?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9422c6be-17c4-4346-87ca-03354ced3b22_1600x853.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_!Uwuk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9422c6be-17c4-4346-87ca-03354ced3b22_1600x853.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Uwuk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9422c6be-17c4-4346-87ca-03354ced3b22_1600x853.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Uwuk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9422c6be-17c4-4346-87ca-03354ced3b22_1600x853.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Uwuk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9422c6be-17c4-4346-87ca-03354ced3b22_1600x853.jpeg 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><em>Chapter 6 separates the live trading loop from the research loop: one runs the strategy on a fixed cadence, the other improves the pipeline under a fixed setup and evaluation protocol.</em></p><p>The chapter also introduces the nine case studies used throughout the book, enabling strategy research to be compared across asset classes, trading cadences, and market structures.</p><p>Notebook highlights:</p><ul><li><p><code>01_cv_foundations</code> builds walk-forward cross-validation from first principles, including decision-time admissibility, purging, embargo, calendar-aware splits, nested walk-forward validation, and combinatorial purged CV.</p></li><li><p><code>02_case_study_overview</code> summarizes the nine case studies, including datasets, asset classes, constraints, evaluation protocols, and prediction coverage across time.</p></li></ul><h2><a href="https://github.com/stefan-jansen/machine-learning-for-trading/tree/main/07_defining_the_learning_task">Chapter 7: Defining the Learning Task</a></h2><p>Chapter 7 turns raw but validated data into a learning problem. It builds split-aware preprocessing, label engineering, feature-label evaluation, multiple-testing checks, and lightweight causal falsification.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nUgu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff986a319-b75c-42e4-bc9a-c0110c3b4b8a_1600x896.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nUgu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff986a319-b75c-42e4-bc9a-c0110c3b4b8a_1600x896.jpeg 424w, https://substackcdn.com/image/fetch/$s_!nUgu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff986a319-b75c-42e4-bc9a-c0110c3b4b8a_1600x896.jpeg 848w, https://substackcdn.com/image/fetch/$s_!nUgu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff986a319-b75c-42e4-bc9a-c0110c3b4b8a_1600x896.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!nUgu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff986a319-b75c-42e4-bc9a-c0110c3b4b8a_1600x896.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nUgu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff986a319-b75c-42e4-bc9a-c0110c3b4b8a_1600x896.jpeg" width="1456" height="815" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f986a319-b75c-42e4-bc9a-c0110c3b4b8a_1600x896.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:815,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:353186,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://insights.ml4trading.io/i/204103460?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff986a319-b75c-42e4-bc9a-c0110c3b4b8a_1600x896.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_!nUgu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff986a319-b75c-42e4-bc9a-c0110c3b4b8a_1600x896.jpeg 424w, https://substackcdn.com/image/fetch/$s_!nUgu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff986a319-b75c-42e4-bc9a-c0110c3b4b8a_1600x896.jpeg 848w, https://substackcdn.com/image/fetch/$s_!nUgu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff986a319-b75c-42e4-bc9a-c0110c3b4b8a_1600x896.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!nUgu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff986a319-b75c-42e4-bc9a-c0110c3b4b8a_1600x896.jpeg 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><em>Chapter 7 uses the triple-barrier method to label an event by whichever barrier is hit first: the profit target, the stop-loss, or the maximum holding period.</em></p><p>The useful move is that labels are treated as trading decisions, not just target columns. Horizon, overlap, resolution time, and implied trading intensity all contribute to the target definition.</p><p>Notebook highlights:</p><ul><li><p><code>01_data_quality_diagnostics</code> checks the ML4T datasets for index integrity, missing values, duplicates, outliers, and temporal gaps.</p></li><li><p><code>02_preprocessing_pipeline</code> implements split-aware preprocessing, including a <code>SplitAwarePreprocessor</code> method that fits scalers and encoders on training data only.</p></li><li><p><code>03_label_methods</code> implements fixed-horizon, percentile, triple-barrier, ATR-based, trend-scanning, meta-label, and sequential-bootstrap labels on ETF data.</p></li><li><p><code>05_signal_evaluation</code> and <code>06_ic_inference</code> use Information Coefficients, quantile returns, signal decay, HAC standard errors, and block bootstrap to evaluate single-factor signals.</p></li><li><p><code>07_multiple_testing</code> covers factor-zoo selection bias, Benjamini-Hochberg FDR control, complexity-aware corrections, the Deflated Sharpe Ratio, and the Probability of Backtest Overfitting.</p></li><li><p><code>08_causal_sanity_checks</code> uses timing placebos, shared-driver checks, and VIX regime heterogeneity tests to ask whether a signal story survives basic falsification.</p></li><li><p><code>10_ml4t_library_ecosystem</code> shows the <code>ml4t-data</code>, <code>ml4t-engineer</code>, and <code>ml4t-diagnostic</code> libraries used across Chapters 7-12.</p></li></ul><h2><a href="https://github.com/stefan-jansen/machine-learning-for-trading/tree/main/08_financial_features">Chapter 8: Financial Feature Engineering</a></h2><p>Chapter 8 moves from a trading idea to a documented feature specification: what the feature is supposed to capture, which horizon it belongs to, which reference frame it uses, and how it should be lagged.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QrsF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F527f155d-7d28-4e64-9891-93d133aa8283_1600x888.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QrsF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F527f155d-7d28-4e64-9891-93d133aa8283_1600x888.jpeg 424w, https://substackcdn.com/image/fetch/$s_!QrsF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F527f155d-7d28-4e64-9891-93d133aa8283_1600x888.jpeg 848w, https://substackcdn.com/image/fetch/$s_!QrsF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F527f155d-7d28-4e64-9891-93d133aa8283_1600x888.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!QrsF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F527f155d-7d28-4e64-9891-93d133aa8283_1600x888.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QrsF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F527f155d-7d28-4e64-9891-93d133aa8283_1600x888.jpeg" width="1456" height="808" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/527f155d-7d28-4e64-9891-93d133aa8283_1600x888.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:808,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:443200,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://insights.ml4trading.io/i/204103460?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F527f155d-7d28-4e64-9891-93d133aa8283_1600x888.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_!QrsF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F527f155d-7d28-4e64-9891-93d133aa8283_1600x888.jpeg 424w, https://substackcdn.com/image/fetch/$s_!QrsF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F527f155d-7d28-4e64-9891-93d133aa8283_1600x888.jpeg 848w, https://substackcdn.com/image/fetch/$s_!QrsF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F527f155d-7d28-4e64-9891-93d133aa8283_1600x888.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!QrsF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F527f155d-7d28-4e64-9891-93d133aa8283_1600x888.jpeg 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><em>Chapter 8 organizes feature families by data requirement and role: direct signals, state variables, feasibility inputs, and context.</em></p><p>The chapter builds direct financial features from prices, volume, liquidity, microstructure, term structure, cross-asset relationships, options markets, fundamentals, macro data, calendars, and events. It also includes feature selection and sensitivity checks, so it is not just a catalog of indicators.</p><p>Notebook highlights:</p><ul><li><p><code>01_price_volume_features</code> builds multi-horizon returns, trend features, volatility estimators, volume-liquidity features, ranks, and z-scores from ETF data.</p></li><li><p><code>02_microstructure_features</code> computes Kyle lambda, Amihud illiquidity, Roll spread, and order-flow imbalance from NASDAQ ITCH data.</p></li><li><p><code>03_structural_cross_instrument_features</code> builds carry and roll-yield features from CME futures, rolling beta and lead-lag features from ETFs, and options-implied features from S&amp;P 500 options.</p></li><li><p><code>04_fundamentals_macro_calendar</code> builds value, quality, and growth features from point-in-time financial statements, plus yield-curve, credit-spread, VIX, and calendar features.</p></li><li><p><code>05_feature_selection</code> reduces a large ETF feature set using IC ranking, correlation deduplication, hierarchical clustering, BH-FDR filtering, bootstrap stability, and LightGBM importance.</p></li><li><p><code>06_robustness_sensitivity</code> sweeps momentum parameters, checks IC by VIX regime, and builds signal-times-state interaction features.</p></li><li><p><code>07_event_studies</code> implements event studies around ETF momentum breakouts, including normal-return estimation and CAAR confidence bands.</p></li><li><p><code>case_study_feature_summary</code> compares feature results across case studies, including IC distributions, FDR survival rates, and feature-family effectiveness by asset class.</p></li></ul><h2><a href="https://github.com/stefan-jansen/machine-learning-for-trading/tree/main/09_model_based_features">Chapter 9: Model-Based Feature Extraction</a></h2><p>Chapter 9 turns fitted models into features. These are not the final supervised models being compared later. They are inputs: filtered states, residuals, volatility estimates, uncertainty summaries, regime probabilities, and panel-level relationships.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Joly!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36698f2f-8839-4ed9-945e-199846da4d47_1600x828.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Joly!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36698f2f-8839-4ed9-945e-199846da4d47_1600x828.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Joly!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36698f2f-8839-4ed9-945e-199846da4d47_1600x828.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Joly!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36698f2f-8839-4ed9-945e-199846da4d47_1600x828.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Joly!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36698f2f-8839-4ed9-945e-199846da4d47_1600x828.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Joly!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36698f2f-8839-4ed9-945e-199846da4d47_1600x828.jpeg" width="1456" height="753" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/36698f2f-8839-4ed9-945e-199846da4d47_1600x828.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:753,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:172047,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://insights.ml4trading.io/i/204103460?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36698f2f-8839-4ed9-945e-199846da4d47_1600x828.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_!Joly!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36698f2f-8839-4ed9-945e-199846da4d47_1600x828.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Joly!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36698f2f-8839-4ed9-945e-199846da4d47_1600x828.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Joly!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36698f2f-8839-4ed9-945e-199846da4d47_1600x828.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Joly!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36698f2f-8839-4ed9-945e-199846da4d47_1600x828.jpeg 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><em>Chapter 9 turns fitted models into features, including filtered regime probabilities from Hidden Markov Models without using future observations.</em></p><p>A fitted model can compress structure that raw rolling features miss: latent state, changing volatility, structural breaks, uncertainty, cycles, and pairwise relationships. The point-in-time distinction matters here: filtered regime probabilities use only information available up to the decision time, whereas smoothed probabilities incorporate future observations and would leak.</p><p>Notebook highlights:</p><ul><li><p><code>01_visual_diagnostics</code>, <code>02_structural_breaks</code>, and <code>03_fractional_differencing</code> cover stationarity tests, ACF/PACF analysis, rolling diagnostics, break detection, and fixed-width fractional differencing.</p></li><li><p><code>04_kalman_filter</code> extracts level, slope, innovation, and uncertainty features, and estimates time-varying hedge ratios for pairs trading.</p></li><li><p><code>05_spectral_features</code> uses wavelets, rolling FFT features, Welch power spectral density, and spectral heatmaps.</p></li><li><p><code>07_arima_features</code>, <code>08_garch_volatility</code>, and <code>09_har_rough_volatility</code> turn time-series models into residual, forecast, uncertainty, conditional volatility, persistence, leverage, and rough volatility features.</p></li><li><p><code>10_uncertainty_features</code> uses PyMC stochastic-volatility models and ARIMA forecast uncertainty to build uncertainty inputs.</p></li><li><p><code>11_hmm_regimes</code>, <code>12_wasserstein_regimes</code>, and <code>13_regime_as_feature</code> compare parametric and distribution-based regime features, including the difference between filtered and smoothed probabilities.</p></li><li><p><code>14_panel_features</code> builds cointegration, Kalman hedge ratio, Ornstein-Uhlenbeck half-life, ranking, sector-relative, and universe aggregation features.</p></li><li><p><code>case_study_temporal_summary</code> compares model-based feature inventories and incremental IC contributions across case studies.</p></li></ul><h2><a href="https://github.com/stefan-jansen/machine-learning-for-trading/tree/main/10_text_feature_engineering">Chapter 10: Text Feature Engineering</a></h2><p>Chapter 10 treats financial NLP as feature engineering. It starts with lexicons, bag-of-words, TF-IDF, and static embeddings, then moves through sequential models, Transformers, domain adaptation, fine-tuning, and text-derived trading signals.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GG2P!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F025f8e04-4351-473e-a09f-0e2bda9a6850_1600x730.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GG2P!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F025f8e04-4351-473e-a09f-0e2bda9a6850_1600x730.jpeg 424w, https://substackcdn.com/image/fetch/$s_!GG2P!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F025f8e04-4351-473e-a09f-0e2bda9a6850_1600x730.jpeg 848w, https://substackcdn.com/image/fetch/$s_!GG2P!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F025f8e04-4351-473e-a09f-0e2bda9a6850_1600x730.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!GG2P!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F025f8e04-4351-473e-a09f-0e2bda9a6850_1600x730.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GG2P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F025f8e04-4351-473e-a09f-0e2bda9a6850_1600x730.jpeg" width="1456" height="664" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/025f8e04-4351-473e-a09f-0e2bda9a6850_1600x730.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:664,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:134589,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://insights.ml4trading.io/i/204103460?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F025f8e04-4351-473e-a09f-0e2bda9a6850_1600x730.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_!GG2P!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F025f8e04-4351-473e-a09f-0e2bda9a6850_1600x730.jpeg 424w, https://substackcdn.com/image/fetch/$s_!GG2P!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F025f8e04-4351-473e-a09f-0e2bda9a6850_1600x730.jpeg 848w, https://substackcdn.com/image/fetch/$s_!GG2P!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F025f8e04-4351-473e-a09f-0e2bda9a6850_1600x730.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!GG2P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F025f8e04-4351-473e-a09f-0e2bda9a6850_1600x730.jpeg 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><em>Chapter 10 moves from dictionaries and bag-of-words to contextual Transformer representations such as BERT and FinBERT.</em></p><p>The practical focus is timestamp-safe text features: when the text was available, which entity or asset it maps to, how the signal is aggregated, and how it is evaluated against future returns.</p><p>Notebook highlights:</p><ul><li><p><code>01_word2vec_training</code> trains Word2Vec on Financial PhraseBank text and evaluates embeddings with similarity, analogies, and t-SNE.</p></li><li><p><code>02_asset_embeddings</code> applies Word2Vec to SEC 13F holdings, treating portfolios as sentences and stocks as words.</p></li><li><p><code>03_sentiment_evolution</code> compares TF-IDF, GloVe, and FinBERT on Financial PhraseBank and shows why distribution shift matters.</p></li><li><p><code>04_bert_finetuning</code> fine-tunes FinBERT, DeBERTa-v3, and ModernBERT for financial sentiment classification.</p></li><li><p><code>05_financial_ner_finetuning</code> fine-tunes a FinBERT-based named-entity recognizer for companies, amounts, and dates.</p></li><li><p><code>07_news_return_signals</code> builds news surprise and sentiment factors from FNSPID news and evaluates them against S&amp;P 500 forward returns.</p></li><li><p><code>08_text_feature_evaluation</code> evaluates text-derived alpha signals with IC, ICIR, t-statistics, and quintile spreads across 1-day, 5-day, and 20-day horizons.</p></li><li><p><code>09_filing_text_signals</code> builds 10-Q MD&amp;A sentiment and narrative-change signals and joins them to S&amp;P 500 returns with point-in-time alignment.</p></li></ul><p>These notebooks prepare research inputs and diagnostics. They do not claim that a feature survives full strategy simulation, transaction costs, portfolio construction, risk controls, or live deployment; those checks come in later releases.</p><h2>Learn the workflow live</h2><p>The full live-course and workshop schedule is on the <a href="https://ml4trading.io/courses/">ML4T courses page</a>.</p><p>The <a href="https://maven.com/stefan-jansen/research-to-production">Machine Learning for Trading: From Research to Production</a> course starts Monday, July 6. The course uses the same workflow in live work: start with a strategy idea, build a baseline, diagnose what failed, and decide what to try next without quietly reusing the holdout.</p><p>The repository gives you the code. The course adds review and pace.</p><p>You can <a href="https://github.com/stefan-jansen/machine-learning-for-trading">watch or star the ML4T repository</a> to follow the staged release. The next releases move into model comparison, simulation, portfolio construction, transaction costs, risk, and live deployment.</p>]]></content:encoded></item><item><title><![CDATA[How to build a Multi-Agent Forecasting System]]></title><description><![CDATA[They can turn current unstructured evidence into scorable probabilities, but the output has to compete with a model, market, or human baseline.]]></description><link>https://insights.ml4trading.io/p/how-to-build-a-multi-agent-forecasting</link><guid isPermaLink="false">https://insights.ml4trading.io/p/how-to-build-a-multi-agent-forecasting</guid><dc:creator><![CDATA[Stefan Jansen]]></dc:creator><pubDate>Thu, 25 Jun 2026 16:09:43 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/4309c9b7-1128-4ae4-b0ba-045857424117_1200x630.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Most forecasting work in ML4T starts with structured data.</p><p>A panel of returns. A table of fundamentals. A calendar of releases. A cross-section of firm characteristics. A feature matrix that tries to preserve what the model could have known at the decision time.</p><p>That remains the center of gravity. The third edition still treats data design, labels, baselines, backtests, costs, and monitoring as the hard parts of the workflow. Forecasting agents add an evidence-processing layer to that workflow.</p><p>The layer is specific: it can process current unstructured evidence on the fly and turn the result into a structured forecast artifact.</p><p>For finance, that evidence might be a central bank statement, company guidance, a filing, a research note, macro commentary, or market chatter that has not yet become a stable feature history. For sports, it might be squad news, injuries, lineup changes, travel, form, or match reports. The domains differ. The pattern is the same: some relevant information arrives as text, search results, or messy context before it arrives as a clean panel.</p><p>This Saturday, June 27, we are building this pattern in a live Maven workshop: <a href="https://maven.com/stefan-jansen/forecasting-agents">Building Multi-Agent Forecasting Systems</a>. The  workshop uses an AIA-style multi-agent forecaster inspired by Bridgewater AIA Labs: research agents gather evidence; an aggregation layer combines their probabilities; a supervisor checks the result; calibration adjusts the final number; and every run is stored so it can be scored later.</p><p>The system should read evidence that a conventional model may miss, produce a probability, and then have that probability compete with a baseline.</p><h2>The missing input is often not another price series</h2><p>In a clean modeling setup, the training panel defines the world. If the feature is not in the panel, the model cannot use it. That discipline is important because it prevents hindsight from leaking into the experiment.</p><p>But real decisions often happen before the relevant information has been converted into a feature. A company may update guidance, a regulator may change tone, a central bank may revise its language, or a prediction market may move before the event has resolved. Some of that evidence would be hard to reconstruct across twenty years of history.</p><p>The same issue appears outside finance. In the World Cup forecaster, a statistical model can estimate the probabilities of a win, draw, or loss from historical match data. Match-specific information is a different kind of input: squad updates, recent form narratives, injury reports, expected lineups, conditions, and tournament context.</p><p>An agent can put that evidence into the workflow without pretending it has already become a clean historical feature.</p><p>The agent can search, read, summarize, compare sources, reason over contradictions, and emit a probability with a trace of what it used. That output is not automatically correct. It is a candidate input.</p><p>The test is whether the candidate input improves the forecast record, the diagnosis, or the decision process when compared with a baseline.</p><h2>Web search is the easy version</h2><p>The simplest forecasting agent uses a web search.</p><p>Give the agent a binary question, a cutoff date, a search tool, and a prompt that asks for evidence, uncertainty, and a probability. Let several agents search independently. Aggregate their probabilities. Ask a supervisor to check the disagreement. Store the trace. Score the result when the event resolves.</p><p>That already teaches most of the system design: resolvable questions, cutoff-aware retrieval, source metadata, schema-bound outputs, aggregation policy, calibration, and baseline scoring.</p><p>The current search is convenient but not replayable. Search rankings change. Pages move. Articles update. Snippets may reflect information unavailable as of the forecast date. Date filters help, but they do not create a clean historical archive. If you want to tune the system rather than merely demo it, a point-in-time evidence archive becomes much more attractive.</p><p>For finance, that might mean timestamped news, filings, transcripts, macro releases, prediction-market snapshots, and internal research notes. For sports, it might mean dated match previews, squad announcements, injury updates, odds, and official lineups. The important feature is not that all of this is text. It is that the system can know what was available at the time.</p><p>Once the evidence is archived point-in-time, the agent becomes easier to improve:</p><ul><li><p>You can backtest retrieval policies without letting the agent read the future;</p></li><li><p>You can compare prompts, tools, and agent counts on the same historical evidence;</p></li><li><p>You can run prompt or program optimization against resolved outcomes;</p></li><li><p>You can measure whether a supervisor helps or merely adds cost;</p></li><li><p>You can decide whether debate improves calibration or only produces longer traces.</p></li></ul><p>A live demo can run on the current search. A system that improves over time needs evidence that it can replay.</p><h2>Two practical ways to use the forecast</h2><p>Two deployment patterns cover most practical use cases.</p><p>The first is to build the agent in isolation as an additional forecast. It reads evidence, produces a probability, and gets compared with a market price, a statistical baseline, or a human forecast. If it provides incremental information, the output can be ensembled with the baseline or used as a feature in a downstream model.</p><p>That is the restrained interpretation of the <a href="https://arxiv.org/abs/2511.07678">AIA Forecaster</a> result. On ForecastBench, the report finds that performance is statistically indistinguishable from that of human superforecasters. On MarketLiquid, the paper evaluates 322 liquid prediction-market questions at five forecast dates each, producing 1,610 forecast instances from April 2 to May 23, 2025. The agent alone trails the market consensus there. The practical result is that combining the agent forecast with market consensus beats either source alone on that benchmark.</p><p>That is a realistic role: independent, inspectable evidence processing that can add information when combined with a strong baseline.</p><p>The second pattern is to enrich the agent with structured inputs from the start. It receives a model prior, market odds, recent structured data, and the current evidence it should inspect.</p><p>That is what we are doing in the World Cup agent: model the prior first, current evidence second, and a separate forecast surface throughout.</p><p>The World Cup app illustrates this second pattern. A Poisson-style team-strength model provides the prior; the agent reads the current football context and publishes its own win/draw/loss forecast alongside the model. In one pre-match validation run, changing the prompt increased the agent&#8217;s mean maximum swing from the model by 3.5 percentage points across eight group-opener fixtures. The goal was to keep the model prior visible while allowing the agent to move when supplied evidence justified it.</p><p>If the agent simply rubber-stamps the model, it adds little. If it makes large moves without evidence, it adds noise. Evidence-driven deviations are the cases to track and evaluate.</p><h2>The AIA-style architecture</h2><p>Chapter 24 of <a href="https://www.ml4trading.io/third-edition/chapters/24_autonomous_agents/">Machine Learning for Trading</a> uses forecasting because the output can be scored. A forecast has a timestamp, a probability, a resolution rule, and an eventual outcome.</p><p>For prediction-market questions, the target is usually a binary event. For match forecasts, the outcomes are mutually exclusive. The architecture is similar, but the scoring layer changes.</p><p>The architecture we use in the workshop follows the same practical sequence:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cDxE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfc7b296-aaf1-471a-954f-56246b0e14ba_3168x1344.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cDxE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfc7b296-aaf1-471a-954f-56246b0e14ba_3168x1344.png 424w, https://substackcdn.com/image/fetch/$s_!cDxE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfc7b296-aaf1-471a-954f-56246b0e14ba_3168x1344.png 848w, https://substackcdn.com/image/fetch/$s_!cDxE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfc7b296-aaf1-471a-954f-56246b0e14ba_3168x1344.png 1272w, https://substackcdn.com/image/fetch/$s_!cDxE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfc7b296-aaf1-471a-954f-56246b0e14ba_3168x1344.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cDxE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfc7b296-aaf1-471a-954f-56246b0e14ba_3168x1344.png" width="1456" height="618" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dfc7b296-aaf1-471a-954f-56246b0e14ba_3168x1344.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:618,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:4662865,&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://insights.ml4trading.io/i/203574336?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfc7b296-aaf1-471a-954f-56246b0e14ba_3168x1344.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_!cDxE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfc7b296-aaf1-471a-954f-56246b0e14ba_3168x1344.png 424w, https://substackcdn.com/image/fetch/$s_!cDxE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfc7b296-aaf1-471a-954f-56246b0e14ba_3168x1344.png 848w, https://substackcdn.com/image/fetch/$s_!cDxE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfc7b296-aaf1-471a-954f-56246b0e14ba_3168x1344.png 1272w, https://substackcdn.com/image/fetch/$s_!cDxE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfc7b296-aaf1-471a-954f-56246b0e14ba_3168x1344.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><em>An AIA-style forecasting system turns a question into research-agent traces, an aggregate forecast, supervisor review, calibration, and a persisted probability that can be scored later.</em></p><ol><li><p>Define the forecast target and cutoff policy.</p></li><li><p>Run several research agents that search and reason independently under the same cutoff policy.</p></li><li><p>Aggregate their probabilities under an explicit rule.</p></li><li><p>Optionally run a debate or specialist review stage when the question set warrants the cost.</p></li><li><p>Let a supervisor inspect disagreements and perform clarifying searches when needed.</p></li><li><p>Calibrate the final probability.</p></li><li><p>Persist the run: question, inputs, traces, configuration, token usage, probabilities, and later scores.</p></li></ol><p>This is a read-only forecasting system. It can pull questions, prices, search results, and evidence. It does not place trades or bets.</p><p>That boundary makes the system easier to evaluate. A read-only agent can be wrong without also creating an execution problem. The first product of the system is a probability and a record. Action comes later, if the probability survives comparison with the rest of the workflow.</p><h2>What has to be measured</h2><p>Forecasting agents invite a familiar mistake: treating a good explanation as evidence of a good forecast.</p><p>The explanation may be useful. It may help diagnose what the system saw. It may reveal a stale source, a missing counterargument, or a brittle prompt. But the forecast has to be judged by scoring rules and baselines.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!N4ED!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d31e83e-f5ef-4fc1-898e-738e6f6b7ef8_1600x992.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!N4ED!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d31e83e-f5ef-4fc1-898e-738e6f6b7ef8_1600x992.png 424w, https://substackcdn.com/image/fetch/$s_!N4ED!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d31e83e-f5ef-4fc1-898e-738e6f6b7ef8_1600x992.png 848w, https://substackcdn.com/image/fetch/$s_!N4ED!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d31e83e-f5ef-4fc1-898e-738e6f6b7ef8_1600x992.png 1272w, https://substackcdn.com/image/fetch/$s_!N4ED!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d31e83e-f5ef-4fc1-898e-738e6f6b7ef8_1600x992.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!N4ED!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d31e83e-f5ef-4fc1-898e-738e6f6b7ef8_1600x992.png" width="1456" height="903" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9d31e83e-f5ef-4fc1-898e-738e6f6b7ef8_1600x992.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:903,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:152298,&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://insights.ml4trading.io/i/203574336?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d31e83e-f5ef-4fc1-898e-738e6f6b7ef8_1600x992.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_!N4ED!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d31e83e-f5ef-4fc1-898e-738e6f6b7ef8_1600x992.png 424w, https://substackcdn.com/image/fetch/$s_!N4ED!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d31e83e-f5ef-4fc1-898e-738e6f6b7ef8_1600x992.png 848w, https://substackcdn.com/image/fetch/$s_!N4ED!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d31e83e-f5ef-4fc1-898e-738e6f6b7ef8_1600x992.png 1272w, https://substackcdn.com/image/fetch/$s_!N4ED!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d31e83e-f5ef-4fc1-898e-738e6f6b7ef8_1600x992.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><em>Calibration remaps probabilities based on past forecast errors. It cannot add evidence the agent missed, and it should be evaluated on a disjoint set of resolved forecasts.</em></p><p>At a minimum, the evaluation should ask:</p><ul><li><p>Does the agent improve Brier score, log score, calibration, or sharpness relative to the baseline?</p></li><li><p>Does the improvement survive time-disjoint evaluation?</p></li><li><p>Does the agent add information when combined with market consensus or a statistical model?</p></li><li><p>Which component actually helps: search, more agents, debate, supervisor, calibration, or a better evidence archive?</p></li><li><p>Does the benefit justify the cost and latency?</p></li></ul><p>A negative result still tells you which component not to keep. An agent may fail to beat a baseline on its own and still improve an ensemble or help diagnose model blind spots. If it only produces plausible prose, it should not survive the ablation.</p><p>This is also why point-in-time evidence matters. Without it, a backtest can become a story about leakage. With it, the same architecture can become a repeatable experiment: the same question, the same cutoff, the same archive, different prompt or tool policy, scored after resolution.</p><h2>What we will build on Saturday</h2><p>The workshop is built around a working AIA-style forecaster.</p><p>Students run a CLI and dashboard, inspect individual agent traces, change profiles, compare single-agent and multi-agent runs, look at aggregation and calibration, and see how forecast runs are stored for later scoring. The deterministic replay path works without API keys. Live model and search providers are optional upgrades.</p><p>The day is deliberately practical:</p><ul><li><p>start from a resolvable question;</p></li><li><p>run one research agent and inspect its evidence trail;</p></li><li><p>move from one agent to several;</p></li><li><p>aggregate and calibrate the probabilities;</p></li><li><p>store the run so it can be evaluated later;</p></li><li><p>discuss how the same pattern generalizes from prediction markets to finance, sports, and other decision workflows.</p></li></ul><p>The ML4T link is the evaluation habit: preserve the timestamp, compare with a baseline, and remove components that do not improve the record. Forecasting agents make a new class of inputs available to that workflow.</p><p>The live workshop is this Saturday: <a href="https://maven.com/stefan-jansen/forecasting-agents">Building Multi-Agent Forecasting Systems</a>.</p><p>The free Lightning Lesson page is here: <a href="https://maven.com/p/6c2609/build-multi-agent-systems-you-can-audit">Build Multi-Agent Systems You Can Audit</a>.</p><p>In the workshop, a component earns its place only if the stored runs show that it improves the forecast record, the diagnosis, or the evaluation against the baseline.</p>]]></content:encoded></item><item><title><![CDATA[New Release: The ML4T Data Layer Is Now Public]]></title><description><![CDATA[This release makes the Chapters 1-5 code public and focuses on the data foundation: data loaders, market microstructure, as well as alternative and synthetic data.]]></description><link>https://insights.ml4trading.io/p/new-release-the-ml4t-data-layer-is</link><guid isPermaLink="false">https://insights.ml4trading.io/p/new-release-the-ml4t-data-layer-is</guid><dc:creator><![CDATA[Stefan Jansen]]></dc:creator><pubDate>Mon, 22 Jun 2026 12:30:49 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/856566a8-3b99-4554-baf6-c7b138ebd08c_1200x630.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Today, we are releasing the code for the first five chapters of the third edition of <a href="https://github.com/stefan-jansen/machine-learning-for-trading">Machine Learning for Trading</a>.</p><p>Chapter 1, <a href="https://github.com/stefan-jansen/machine-learning-for-trading/tree/main/01_process_is_edge">The Process Is Your Edge</a>, sets up the workflow: define the research problem, keep exploration separate from confirmation, and treat live degradation as something the process has to handle. Chapters 2-5 then make the data foundation inspectable.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!LL4E!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd52279d-f630-4e38-a84c-79f86842919f_3168x1344.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!LL4E!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd52279d-f630-4e38-a84c-79f86842919f_3168x1344.jpeg 424w, https://substackcdn.com/image/fetch/$s_!LL4E!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd52279d-f630-4e38-a84c-79f86842919f_3168x1344.jpeg 848w, https://substackcdn.com/image/fetch/$s_!LL4E!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd52279d-f630-4e38-a84c-79f86842919f_3168x1344.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!LL4E!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd52279d-f630-4e38-a84c-79f86842919f_3168x1344.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!LL4E!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd52279d-f630-4e38-a84c-79f86842919f_3168x1344.jpeg" width="1456" height="618" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cd52279d-f630-4e38-a84c-79f86842919f_3168x1344.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:618,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2012163,&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://insights.ml4trading.io/i/203079892?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd52279d-f630-4e38-a84c-79f86842919f_3168x1344.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_!LL4E!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd52279d-f630-4e38-a84c-79f86842919f_3168x1344.jpeg 424w, https://substackcdn.com/image/fetch/$s_!LL4E!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd52279d-f630-4e38-a84c-79f86842919f_3168x1344.jpeg 848w, https://substackcdn.com/image/fetch/$s_!LL4E!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd52279d-f630-4e38-a84c-79f86842919f_3168x1344.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!LL4E!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd52279d-f630-4e38-a84c-79f86842919f_3168x1344.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><p><em>Data infrastructure supports strategy research and live deployment. This release provides access to the book's coverage of the infrastructure layer: the data and chapter notebooks that later case studies build on.</em></p><p>This release also arrives as we start teaching the ML4T workflow live. The free <a href="https://maven.com/p/7a8c60/from-trading-idea-to-validated-strategy">From trading idea to validated strategy</a> Lightning Lesson runs Wednesday, June 24, at 16:00 UTC / noon ET; the full <a href="https://maven.com/stefan-jansen/research-to-production">Machine Learning for Trading: From Research to Production</a> course starts July 6. The course is organized around this loop: start with a research question, build the data contract, cross the evidence boundary only when the experiment deserves it, and carefully track the live feedback loop.</p><p>In trading research, few things are more important than the information contained in data, and how to handle it properly: clocks, sessions, adjustments, revisions, identifiers, contract rolls, venue rules, licensing limits, and the question of what a strategy could have known at the time of the decision. A later model result only means something once those choices are visible.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gMH_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11b8905-e8c2-4a4d-97af-6f5486211fa5_2729x1174.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gMH_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11b8905-e8c2-4a4d-97af-6f5486211fa5_2729x1174.jpeg 424w, https://substackcdn.com/image/fetch/$s_!gMH_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11b8905-e8c2-4a4d-97af-6f5486211fa5_2729x1174.jpeg 848w, https://substackcdn.com/image/fetch/$s_!gMH_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11b8905-e8c2-4a4d-97af-6f5486211fa5_2729x1174.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!gMH_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11b8905-e8c2-4a4d-97af-6f5486211fa5_2729x1174.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gMH_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11b8905-e8c2-4a4d-97af-6f5486211fa5_2729x1174.jpeg" width="1456" height="626" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e11b8905-e8c2-4a4d-97af-6f5486211fa5_2729x1174.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:626,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:425171,&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;:false,&quot;internalRedirect&quot;:&quot;https://insights.ml4trading.io/i/203079892?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11b8905-e8c2-4a4d-97af-6f5486211fa5_2729x1174.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_!gMH_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11b8905-e8c2-4a4d-97af-6f5486211fa5_2729x1174.jpeg 424w, https://substackcdn.com/image/fetch/$s_!gMH_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11b8905-e8c2-4a4d-97af-6f5486211fa5_2729x1174.jpeg 848w, https://substackcdn.com/image/fetch/$s_!gMH_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11b8905-e8c2-4a4d-97af-6f5486211fa5_2729x1174.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!gMH_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11b8905-e8c2-4a4d-97af-6f5486211fa5_2729x1174.jpeg 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>A point-in-time accounting example from Chapter 4. The final database view shows the same $100M revenue value across the year; the lower track shows what was actually available after the original filing and later restatements.</em></p><p>This release adds the first five chapter directories and the central <code>data/</code> package that later case-study work builds on:</p><ul><li><p><a href="https://github.com/stefan-jansen/machine-learning-for-trading/tree/main/01_process_is_edge">Chapter 1: The Process Is Your Edge</a></p></li><li><p><a href="https://github.com/stefan-jansen/machine-learning-for-trading/tree/main/02_financial_data_universe">Chapter 2: The Financial Data Universe</a></p></li><li><p><a href="https://github.com/stefan-jansen/machine-learning-for-trading/tree/main/03_market_microstructure">Chapter 3: Market Microstructure</a></p></li><li><p><a href="https://github.com/stefan-jansen/machine-learning-for-trading/tree/main/04_fundamental_alternative_data">Chapter 4: Fundamental and Alternative Data</a></p></li><li><p><a href="https://github.com/stefan-jansen/machine-learning-for-trading/tree/main/05_synthetic_data">Chapter 5: Synthetic Financial Data</a></p></li><li><p><a href="https://github.com/stefan-jansen/machine-learning-for-trading/tree/main/data">The data download package</a></p></li></ul><p>Chapter 1 adds the workflow frame. The four data chapters contain 62 notebooks. The <code>data/</code> directory adds the catalog, download scripts, loaders, configs, and access notes that turn the chapter examples into something a reader can inspect and run. The implementation detail worth checking first: loaders return Polars DataFrames through a consistent API, and missing data raises setup instructions with explicit download guidance.</p><h2>What the data layer contains</h2><p>The top-level data catalog currently lists 31 dataset entries. Financial data does not fit cleanly into one giant downloadable bundle. Some sources can be fetched without an API key. Some need a free key. Some are paid. Some require a manual provider download. Some reduced licensed packages are still being prepared for hosting.</p><p>The catalog groups entries around the constraints a research workflow inherits: daily market data, microstructure feeds, options data, fundamentals, positioning, macro series, prediction markets, on-chain metrics, news, and text. That structure makes setup expectations and redistribution limits visible before a reader spends time trying to reproduce a notebook.</p><p>The synthetic-data chapter takes a different angle. It asks how to create alternative histories for robustness analysis when one realized market path is not enough. The notebooks start with classical simulation and move through TimeGAN, Tail-GAN, Sig-CWGAN, GT-GAN, Diffusion-TS, LLM-based tabular generation, and differentially private GAN training. The diagnostics focus on stylized facts, dependence structure, downstream task utility, and privacy constraints.</p><h2>Chapters 2-5 in one pass</h2><p>Chapter 2 gives the map. It covers the financial data universe by asset class and source type, then moves into due diligence and storage. The practical thread is that provider data already contains research choices: corporate actions, survivorship, contract construction, point-in-time availability, storage format, and update policy.</p><p>Chapter 3 gets closer to the tape. Market data is the output of market design: sessions, order types, venue rules, visible liquidity, and timestamp conventions. The notebooks parse NASDAQ TotalView-ITCH, reconstruct limit order books, validate trade-direction classification, compare bar-sampling rules, and show why the sampling clock changes the return distribution a model sees.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MuI9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a12324-d9e6-4732-9971-128a0241f5c2_3000x1950.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MuI9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a12324-d9e6-4732-9971-128a0241f5c2_3000x1950.png 424w, https://substackcdn.com/image/fetch/$s_!MuI9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a12324-d9e6-4732-9971-128a0241f5c2_3000x1950.png 848w, https://substackcdn.com/image/fetch/$s_!MuI9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a12324-d9e6-4732-9971-128a0241f5c2_3000x1950.png 1272w, https://substackcdn.com/image/fetch/$s_!MuI9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a12324-d9e6-4732-9971-128a0241f5c2_3000x1950.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MuI9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a12324-d9e6-4732-9971-128a0241f5c2_3000x1950.png" width="1456" height="946" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/11a12324-d9e6-4732-9971-128a0241f5c2_3000x1950.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:946,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:201240,&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://insights.ml4trading.io/i/203079892?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a12324-d9e6-4732-9971-128a0241f5c2_3000x1950.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_!MuI9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a12324-d9e6-4732-9971-128a0241f5c2_3000x1950.png 424w, https://substackcdn.com/image/fetch/$s_!MuI9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a12324-d9e6-4732-9971-128a0241f5c2_3000x1950.png 848w, https://substackcdn.com/image/fetch/$s_!MuI9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a12324-d9e6-4732-9971-128a0241f5c2_3000x1950.png 1272w, https://substackcdn.com/image/fetch/$s_!MuI9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a12324-d9e6-4732-9971-128a0241f5c2_3000x1950.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><em>A Chapter 3 notebook turns the same AAPL trading day into one-minute bars, 10,000-share volume bars, and tick imbalance bars. The choice of sampling clock changes the observations a model receives before feature engineering begins.</em></p><p>Chapter 4 turns point-in-time correctness into implementation work. It covers SEC EDGAR and XBRL data, Form 4 insider transactions, 13F holdings, entity resolution, macro release alignment, CFTC futures positioning, on-chain fundamentals, prediction markets, and the extraction of filing text for later NLP work. Financial information must be aligned with the time it became available, as well as the fiscal period or event it describes.</p><p>Chapter 5 handles synthetic data with a practical standard: fidelity, utility, and privacy. Generated histories are useful when they stress robustness claims and privacy constraints; extra sample count alone cannot make a backtest more convincing.</p><h2>From dataset to case study</h2><p>The third-edition case studies begin with a market, a universe, a decision schedule, and a data definition. The case-study table in the main README is already public; the detailed case-study notebooks will be included in later release batches.</p><p>The futures path shows the point. A CME futures example starts with contracts, sessions, UTC timestamps, roll rules, continuous-series construction, and positioning data that arrives on its own schedule. A term-structure signal built on that data depends on each of those choices before any model sees a feature matrix.</p><p>The firm-characteristics case has a different failure mode. A monthly cross-sectional result only means something if the accounting data is lagged and aligned to a point-in-time before labels and features are built. The README lists the remaining nine case studies, including the distinct S&amp;P 500 equity-plus-options and options-only tracks.</p><p>That is why the data release comes before the model chapters. Later chapters can ask whether a model improves a score. This release sets up the prior check: whether the score was computed on a dataset whose timing, universe, costs, and availability rules would have held up against the actual research problem.</p><h2>How to inspect the release</h2><p>A narrow first pass works better than browsing every notebook.</p><p>Start with <code>data/README.md</code>. It explains the dataset catalog, access categories, loader names, storage tiers, and the quick-start commands. The repo expects the data path in a root <code>.env</code> file:</p><pre><code><code># In the repository root .env file
ML4T_DATA_PATH=/path/to/your/data

# Then download free datasets
uv run python data/download_all.py --free-only</code></code></pre><p>Then pick one path.</p><p>If you want the lightest local setup, start with ETFs, factors, and crypto. The minimum tier is about 70 MB. Adding macro and FX data still leaves the standard tier around 75 MB, assuming the free API keys are configured. Adding the broad US-equities dataset takes the footprint to roughly 740 MB. Adding CME futures brings it to roughly 825 MB. The full setup, including the larger microstructure and reduced licensed packages, is closer to 7 GB.</p><p>That separation matters because a reproducible notebook is only reproducible within the data rights and access assumptions it declares.</p><p>A practical first pass is:</p><ul><li><p>open the <code>data/</code> README;</p></li><li><p>run one free dataset download;</p></li><li><p>open the matching chapter notebook;</p></li><li><p>inspect the loader output and canonical timestamp/entity columns;</p></li><li><p>trace that dataset into the case-study table in the main README;</p></li><li><p>then move to the Chapter 6 feasibility notebook when that batch lands.</p></li></ul><p>The next ML4T Insights issues will follow the same sequence: data first, then strategy definition, labels, features, model comparison, backtesting, costs, risk, and deployment.</p><h2>For the walkthrough</h2><p>The <a href="https://maven.com/p/7a8c60/from-trading-idea-to-validated-strategy?utm_medium=ll_share_link&amp;utm_source=instructor">June 24 Lightning Lesson</a> starts from this data contract: choose a market, define the decision problem, build a first baseline, diagnose what failed, and make the next iteration measurable without quietly reusing the holdout.</p><p>The <a href="https://maven.com/stefan-jansen/research-to-production">July 6 cohort</a> uses the same case-study structure as the book and repo, with sequencing, feedback, and live review.</p><p>The repo gives readers the artifacts. The course adds the working cadence: turn the artifacts into a baseline, read what the baseline says, and decide what deserves the next experiment.</p><p>You can <a href="https://github.com/stefan-jansen/machine-learning-for-trading">watch or star the repo</a> to follow the staged release. The lesson is a short live walkthrough of why the release starts with the data contract before moving to models.</p>]]></content:encoded></item><item><title><![CDATA[The ML4T Third-Edition Code Rollout Starts Today]]></title><description><![CDATA[Between now and launch, the public repo will fill in stages: workflow, case studies, libraries, and the checks that turn model forecasts into trading decisions.]]></description><link>https://insights.ml4trading.io/p/the-ml4t-third-edition-code-rollout</link><guid isPermaLink="false">https://insights.ml4trading.io/p/the-ml4t-third-edition-code-rollout</guid><dc:creator><![CDATA[Stefan Jansen]]></dc:creator><pubDate>Fri, 19 Jun 2026 15:12:24 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/564273b3-5244-4968-af80-dd0dc717d80b_1200x630.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The <a href="https://github.com/stefan-jansen/machine-learning-for-trading">Machine Learning for Trading repository</a> has carried much of the practical load for ML4T. Some readers used it to run notebooks alongside the chapters. Others found the book through the code first. With more than 19,000 stars and 5,300 forks, it has become the public memory of the first two editions. It also showed up again recently on GitHub Trending for Jupyter Notebook repositories, which is a useful reminder that the old repo is still being discovered while the new edition is being prepared.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!c9Xj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c589a29-0b53-4be6-a1da-7d970df41bd0_1832x1404.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!c9Xj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c589a29-0b53-4be6-a1da-7d970df41bd0_1832x1404.png 424w, https://substackcdn.com/image/fetch/$s_!c9Xj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c589a29-0b53-4be6-a1da-7d970df41bd0_1832x1404.png 848w, https://substackcdn.com/image/fetch/$s_!c9Xj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c589a29-0b53-4be6-a1da-7d970df41bd0_1832x1404.png 1272w, https://substackcdn.com/image/fetch/$s_!c9Xj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c589a29-0b53-4be6-a1da-7d970df41bd0_1832x1404.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!c9Xj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c589a29-0b53-4be6-a1da-7d970df41bd0_1832x1404.png" width="1456" height="1116" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3c589a29-0b53-4be6-a1da-7d970df41bd0_1832x1404.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1116,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:159320,&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://insights.ml4trading.io/i/202731499?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c589a29-0b53-4be6-a1da-7d970df41bd0_1832x1404.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_!c9Xj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c589a29-0b53-4be6-a1da-7d970df41bd0_1832x1404.png 424w, https://substackcdn.com/image/fetch/$s_!c9Xj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c589a29-0b53-4be6-a1da-7d970df41bd0_1832x1404.png 848w, https://substackcdn.com/image/fetch/$s_!c9Xj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c589a29-0b53-4be6-a1da-7d970df41bd0_1832x1404.png 1272w, https://substackcdn.com/image/fetch/$s_!c9Xj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c589a29-0b53-4be6-a1da-7d970df41bd0_1832x1404.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><em>Star history for the public ML4T repository, showing steady growth from 2019 through 2026. The third-edition rebuild starts from an existing reader base that has accumulated over several years.</em></p><p>The third-edition README is now live on the main branch. The older material is preserved on the <code>first-edition</code> and <code>second-edition</code> branches. The new code will be rolled out in stages over the next few weeks leading up to the July launch.</p><p>That staged release has a practical reason. A large trading-ML repo can easily turn into a larger notebook archive: more models, more datasets, more examples, more ways to get lost. The third-edition rebuild is organized around a different question:</p><p>When a forecast looks promising, what has to be checked before it becomes a trading decision?</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4G3X!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F812a6c55-0e02-4a4c-b546-4e4fe7c98663_1024x459.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4G3X!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F812a6c55-0e02-4a4c-b546-4e4fe7c98663_1024x459.png 424w, https://substackcdn.com/image/fetch/$s_!4G3X!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F812a6c55-0e02-4a4c-b546-4e4fe7c98663_1024x459.png 848w, https://substackcdn.com/image/fetch/$s_!4G3X!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F812a6c55-0e02-4a4c-b546-4e4fe7c98663_1024x459.png 1272w, https://substackcdn.com/image/fetch/$s_!4G3X!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F812a6c55-0e02-4a4c-b546-4e4fe7c98663_1024x459.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4G3X!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F812a6c55-0e02-4a4c-b546-4e4fe7c98663_1024x459.png" width="1024" height="459" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/812a6c55-0e02-4a4c-b546-4e4fe7c98663_1024x459.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:459,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:341882,&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;:&quot;https://insights.ml4trading.io/i/202731499?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F812a6c55-0e02-4a4c-b546-4e4fe7c98663_1024x459.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_!4G3X!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F812a6c55-0e02-4a4c-b546-4e4fe7c98663_1024x459.png 424w, https://substackcdn.com/image/fetch/$s_!4G3X!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F812a6c55-0e02-4a4c-b546-4e4fe7c98663_1024x459.png 848w, https://substackcdn.com/image/fetch/$s_!4G3X!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F812a6c55-0e02-4a4c-b546-4e4fe7c98663_1024x459.png 1272w, https://substackcdn.com/image/fetch/$s_!4G3X!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F812a6c55-0e02-4a4c-b546-4e4fe7c98663_1024x459.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>The third-edition workflow separates strategy research from evaluation with an evidence boundary, then closes the loop through deployment, monitoring, and the decision to retrain, pause, or retire a strategy.</em></p><p>That is also the question behind next Wednesday&#8217;s free Lightning Lesson &#8220;<a href="https://maven.com/p/7a8c60/from-trading-idea-to-validated-strategy">From trading idea to validated strategy</a>&#8221;. The repo is the public resource; the lesson is the short guided walkthrough.</p><h2>The work after the forecast</h2><p>A familiar research sequence goes like this. A model produces a plausible return forecast. The validation IC improves. A backtest looks better than the baseline. Then the harder checks begin.</p><p>Was the asset universe fixed before the test? Did the label line up with what was knowable at the time of the decision? Were overlapping labels handled correctly? How many variants were tried before this one survived? Did the result clear the cost model? Did turnover make the signal unusable? Does the portfolio rule amplify a weak forecast or diversify it? What happens after position limits, drawdown rules, and execution assumptions are applied?</p><p>The book calls one part of this the evidence boundary: the line between exploration and confirmation. On one side, you search, tune, compare labels, test feature families, and improve the baseline. On the other side, you spend a holdout on a result that was already specified well enough to deserve the test.</p><p>That boundary changes the decision a result can support. A strategy can meet a naive Sharpe threshold and still fail once the number of variants tested is taken into account. A feature can look predictive until its timestamp is checked. A model can improve rank correlation and still lose once costs and turnover are factored in.</p><p>At that point, the right response is to return to exploration, narrow the claim, or stop. The holdout has already answered the question it was allowed to answer.</p><p>That is the practical center of the third-edition workflow.</p><h2>Three ways into the repo</h2><p>The new README is the route map for the staged code release. It shows three useful ways to enter the material as the directories fill in.</p><p>First, enter by workflow stage. If the problem is data reliability, start with the financial data layer. If the problem is label design, feature triage, or leakage, start with research design and feature engineering. If the problem is model comparison, start with the model chapters. If the backtest looks too clean to believe, start with portfolio construction, costs, risk, and strategy synthesis. If you are working with RAG, knowledge graphs, or agents, start with the advanced-AI chapters. If the issue is live operation, start with deployment, monitoring, and the retrain-pause-retire loop.</p><p>Second, enter by case study. The <a href="https://www.ml4trading.io/case-studies/">case-study page</a> lists nine studies across seven asset classes, 168 notebooks, and six pipeline stages. Each one puts pressure on a different part of the process:</p><ul><li><p>ETFs are a cleaner daily cross-asset setting for following the full loop.</p></li><li><p>Crypto perpetuals introduce funding rates, shorter decision intervals, and a market structure that differs sharply from equities.</p></li><li><p>NASDAQ-100 microstructure makes bar construction, order flow, and intraday costs part of the modeling problem.</p></li><li><p>S&amp;P 500 equity plus options uses implied-volatility information to improve equity selection.</p></li><li><p>US firm characteristics revisit the canonical monthly cross-sectional factor problem, where point-in-time data discipline does much of the work.</p></li><li><p>FX pairs expose the limits of a small cross-section when shared macro and dollar factors are present.</p></li><li><p>CME futures force rolls, term structure, and sector structure into the foreground.</p></li><li><p>S&amp;P 500 options test whether an options-only strategy can survive labels, hedging, and instrument-specific costs.</p></li><li><p>The broad US equities panel asks whether weak individual signals become useful when scaled across thousands of names.</p></li></ul><p>Third, enter by library layer. The current <a href="https://www.ml4trading.io/libraries/">library page</a> lists six workflow-aligned packages: <code>ml4t-data</code>, <code>ml4t-engineer</code>, <code>ml4t-models</code>, <code>ml4t-diagnostic</code>, <code>ml4t-backtest</code>, and <code>ml4t-live</code>. A reader can use a single layer without adopting the entire stack. A data team may only need acquisition and storage. A researcher may only need labels, features, and diagnostics. A course participant may start with a baseline and then decide whether the next change belongs in data, labels, validation, costs, allocation, or execution.</p><h2>What to inspect first</h2><p>The first release wave is the data and research foundation. That is less fashionable than agents or deep learning, but it is where many strategy problems start.</p><p>The data chapter spans market, fundamental, and alternative data; corporate actions; futures and continuous contracts; options; crypto; FX; point-in-time validation; survivorship; provider comparison; incremental updates; and storage benchmarks.</p><p>The microstructure chapter moves from raw exchange messages to feature-ready bars: NASDAQ ITCH parsing, limit-order-book reconstruction, order lifecycle analysis, TAQ-style examples, Lee-Ready validation, alternative bar sampling, and intraday jump detection.</p><p>The synthetic-data chapter is another natural deep dive. Since the second edition, the topic has moved well past &#8220;can a GAN produce realistic-looking prices?&#8221; The current problem is more practical: whether a generator preserves the structure a downstream research task needs, without leaking the original data or creating a world that is easier than the real one. The chapter covers classical simulation, TimeGAN, Tail-GAN, Sig-CWGAN, diffusion-based generators, LLM-based tabular generation, and privacy-aware variants.</p><p>If you open the repo as the release unfolds, a reasonable first inspection path is:</p><ul><li><p>pick one case study instead of browsing every notebook;</p></li><li><p>read the data construction before the model notebook;</p></li><li><p>locate the label definition, horizon, and decision timestamp;</p></li><li><p>check the validation split, purge, embargo, and holdout rule;</p></li><li><p>inspect cost assumptions before performance statistics;</p></li><li><p>treat the first backtest as a diagnostic, not evidence;</p></li><li><p>look for the handoff from forecast output to portfolio rule, risk limit, and deployment decision.</p></li></ul><p>That is also the editorial path for the next set of ML4T Insights issues. The useful issues will turn the release into resources readers can keep: a financial-data failure-mode map, a guide to when tick data changes the research problem, an update on synthetic financial data after GANs and diffusion, a case-study access map, and a checklist for when a backtest should count as evidence.</p><h2>For the first time: live course and workshop</h2><p>The repo is the public resource. The course and workshop are the guided version of the same workflow. They aim to help you improve your ML4T research and trading practice, not just repeat what&#8217;s in the book.</p><p>On Wednesday, June 24, there are two free Maven Lightning Lessons:</p><ul><li><p><a href="https://maven.com/p/7a8c60/from-trading-idea-to-validated-strategy">From trading idea to validated strategy</a> at 16:00 UTC</p></li><li><p><a href="https://maven.com/p/6c2609/build-multi-agent-systems-you-can-audit">Build Multi-Agent Systems You Can Audit</a> at 15:00 UTC</p></li></ul><p>The first lesson is the closest companion to this release. It walks through the same transition from idea to baseline, from baseline to diagnosis, and from diagnosis to a cleaner second version without quietly reusing the holdout.</p><p>The second lesson connects to the agent material in the later chapters and to the forecasting-agent workshop. It uses the same discipline in a narrower setting: define the task, preserve the trace, compare against a baseline, and score the output.</p><p>The full <a href="https://maven.com/stefan-jansen/research-to-production">Machine Learning for Trading: From Research to Production</a> course runs July 6 to August 29. It is the live cohort version of the workflow: choose a case-study path, build a baseline, diagnose failure modes, iterate honestly, and defend the result against a published rubric.</p><p>The <a href="https://maven.com/stefan-jansen/forecasting-agents">Building Multi-Agent Forecasting Systems</a> workshop runs June 27. It is the hands-on route through the agent side: multi-agent forecasting, trace capture, ablations, and scoring.</p><p>Neither course is required to use the public repo. The reason to take one is sequencing, feedback, and time spent applying the workflow with other people.</p><h2>Start with the map</h2><p>The practical next step is to <a href="https://github.com/stefan-jansen/machine-learning-for-trading">watch or star the repo</a> if you want to follow the code release as it unfolds.</p><p>The useful test for this release is simple: can a reader open the repo, pick a market, and understand what has to be checked before a model result becomes strategy evidence?</p><p><a href="https://github.com/stefan-jansen/machine-learning-for-trading">Machine Learning for Trading, 3rd Edition on GitHub</a></p>]]></content:encoded></item><item><title><![CDATA[Watching the World Cup With a Forecasting Agent]]></title><description><![CDATA[A live World Cup lab for model priors, noisy match news, market comparisons, and scoreable agent calls.]]></description><link>https://insights.ml4trading.io/p/watching-the-world-cup-with-a-forecasting</link><guid isPermaLink="false">https://insights.ml4trading.io/p/watching-the-world-cup-with-a-forecasting</guid><dc:creator><![CDATA[Stefan Jansen]]></dc:creator><pubDate>Tue, 16 Jun 2026 14:36:30 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/7debfe99-d602-4579-8746-34f7b73acc9b_1200x630.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The World Cup is one of the few forecasting problems people argue about for pleasure, and it rarely lets a confident prior off the hook.</p><p>Morocco reached the semifinal in 2022. Costa Rica topped a 2014 group that included Uruguay, Italy, and England. Germany won the tournament in 2014, then went out in the group stage in 2018 and again in 2022. The tournament has a long record of embarrassing anyone too sure about it.</p><p>That is exactly what makes it a fun public forecasting lab. The questions are the ones everyone already has an opinion on, the answers come back within hours, and once the match is over, a forecast has very little room to talk its way out of a bad call.</p><p>By the morning of June 16, the <a href="https://applied-ai.com/agent-lab/world-cup-2026/live/">World Cup Forecast Agent</a> had already built a record worth picking apart. Spain was a 75.6% favorite in the model and an 80.0% favorite in the agent&#8217;s call; Cape Verde held Spain to 0-0. Saudi Arabia-Uruguay and Iran-New Zealand ran the same way: the agent nudged the favorite higher, and both matches finished level.</p><p>That is the reason for publishing the lab while the tournament is still underway. Every pre-match number is locked, the trace behind the agent&#8217;s adjustment is stored, and the call is scored once the result is in.</p><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/PZxso/2/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/849ffdda-a9b4-4da5-bdc0-9414456b094b_1220x764.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/87c18ff4-3da0-4332-8aa6-765449c1c4bf_1220x914.png&quot;,&quot;height&quot;:468,&quot;title&quot;:&quot;World Cup Forecast Agent: June 16 live record&quot;,&quot;description&quot;:&quot;Selected model and agent calls from the June 16 morning snapshot, shown with the match result or pending status.&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/PZxso/2/" width="730" height="468" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><p>Before kickoff, the traces can read sensibly. A few hours later, the scoreboard may have a different opinion.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!msRU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d71b33f-6bc8-4ac2-8b50-b8dc1bb259cd_1226x497.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!msRU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d71b33f-6bc8-4ac2-8b50-b8dc1bb259cd_1226x497.png 424w, https://substackcdn.com/image/fetch/$s_!msRU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d71b33f-6bc8-4ac2-8b50-b8dc1bb259cd_1226x497.png 848w, https://substackcdn.com/image/fetch/$s_!msRU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d71b33f-6bc8-4ac2-8b50-b8dc1bb259cd_1226x497.png 1272w, https://substackcdn.com/image/fetch/$s_!msRU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d71b33f-6bc8-4ac2-8b50-b8dc1bb259cd_1226x497.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!msRU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d71b33f-6bc8-4ac2-8b50-b8dc1bb259cd_1226x497.png" width="1226" height="497" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7d71b33f-6bc8-4ac2-8b50-b8dc1bb259cd_1226x497.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:497,&quot;width&quot;:1226,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:48434,&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://insights.ml4trading.io/i/202289999?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d71b33f-6bc8-4ac2-8b50-b8dc1bb259cd_1226x497.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_!msRU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d71b33f-6bc8-4ac2-8b50-b8dc1bb259cd_1226x497.png 424w, https://substackcdn.com/image/fetch/$s_!msRU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d71b33f-6bc8-4ac2-8b50-b8dc1bb259cd_1226x497.png 848w, https://substackcdn.com/image/fetch/$s_!msRU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d71b33f-6bc8-4ac2-8b50-b8dc1bb259cd_1226x497.png 1272w, https://substackcdn.com/image/fetch/$s_!msRU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d71b33f-6bc8-4ac2-8b50-b8dc1bb259cd_1226x497.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><em>A June 16 fixture strip from the live app. Each row shows the model call and the agent call before kickoff, so readers can see the adjustment before the result arrives.</em></p><p>See below for a free <a href="https://maven.com/stefan-jansen/forecasting-agents">lightning lesson about building multi-agent forecasting systems</a>.</p><h2>The model gives the prior</h2><p>The baseline starts with a familiar statistical idea: estimate each team&#8217;s attacking and defensive strength from international results, weight those results by competition and recency, then simulate the tournament bracket.</p><p>As of the current public run, the model&#8217;s leading champion probabilities are:</p><ul><li><p>Spain: 14.2%</p></li><li><p>Brazil: 12.9%</p></li><li><p>Argentina: 11.8%</p></li><li><p>England: 9.3%</p></li><li><p>France: 6.5%</p></li><li><p>Portugal: 6.5%</p></li><li><p>Germany: 5.0%</p></li><li><p>Colombia: 4.6%</p></li></ul><p>Treat those as a dated snapshot. They are where the forecast starts, not where it ends.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MNEa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97a43203-f660-400a-b82b-79d5fb1ad831_1241x537.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MNEa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97a43203-f660-400a-b82b-79d5fb1ad831_1241x537.png 424w, https://substackcdn.com/image/fetch/$s_!MNEa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97a43203-f660-400a-b82b-79d5fb1ad831_1241x537.png 848w, https://substackcdn.com/image/fetch/$s_!MNEa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97a43203-f660-400a-b82b-79d5fb1ad831_1241x537.png 1272w, https://substackcdn.com/image/fetch/$s_!MNEa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97a43203-f660-400a-b82b-79d5fb1ad831_1241x537.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MNEa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97a43203-f660-400a-b82b-79d5fb1ad831_1241x537.png" width="1241" height="537" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/97a43203-f660-400a-b82b-79d5fb1ad831_1241x537.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:537,&quot;width&quot;:1241,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:117320,&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://insights.ml4trading.io/i/202289999?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97a43203-f660-400a-b82b-79d5fb1ad831_1241x537.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_!MNEa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97a43203-f660-400a-b82b-79d5fb1ad831_1241x537.png 424w, https://substackcdn.com/image/fetch/$s_!MNEa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97a43203-f660-400a-b82b-79d5fb1ad831_1241x537.png 848w, https://substackcdn.com/image/fetch/$s_!MNEa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97a43203-f660-400a-b82b-79d5fb1ad831_1241x537.png 1272w, https://substackcdn.com/image/fetch/$s_!MNEa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97a43203-f660-400a-b82b-79d5fb1ad831_1241x537.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><em>The live forecast table keeps model champion probabilities alongside Polymarket and Kalshi prices, rather than blending them into a single consensus number.</em></p><p>The baseline is useful because it is systematic. It is fit on more than 47,000 international results, checked in walk-forward tests, and straightforward to score after the fact. The forecast table sets the model&#8217;s champion odds next to Polymarket and Kalshi prices without averaging the three, which keeps the disagreement on the page rather than dissolving it into a single tidy consensus figure.</p><p>The baseline is also restricted to variables we can reconstruct over time. Injuries, lineup news, weather, travel, squad value, current form: a model could use all of it if each input were a clean, point-in-time history. Most of it does not. Some arrives as prose; some is patchy; and for many variables, there is no decades-long archive of comparable snapshots from the past. Pour today&#8217;s headline into a model that was never trained on yesterday&#8217;s headlines, and you have introduced a new bias, not improved the prior.</p><p>That gap is the agent&#8217;s job. It can work with current, partly structured information without demanding a 50-year feature history. In production, the next step would be to rebuild richer point-in-time datasets and tune prompts, tools, and aggregation rules against historical cases. This app runs the lighter version: hold the quantitative prior steady, let the agent make a separate context adjustment, and score that adjustment on its own.</p><h2>The agent calls the matchup</h2><p>Before each match, the agent receives the model&#8217;s win/draw/loss probabilities, expected goals, recent form, head-to-head history, availability signals, key players, match conditions, a relative squad-value signal, and, when available, recent search results.</p><p>The part closest to Bridgewater AIA Labs&#8217; AIA Forecaster is the research step. The agent first decides what is actually worth checking for a fixture: a late fitness scare, a suspension, a venue condition, a question about one specific player. It then runs a brief Tavily search, retains the sources relevant to the question, and files the query trace alongside the forecast.</p><p>The squad-value signal is kept relative by design: rank within the 48-team field, percentile, value ratio, and marquee names rather than raw euro totals. That gives the agent a current-talent check against a prior built from results, without pretending a transfer-market price tag is a starting eleven. It is a serviceable proxy that still carries the usual biases around age, league, club brand, and the transfer market itself.</p><p>The trace is what turns &#8220;the agent looked into the match&#8221; into something a reader can examine. For the June 16 France-Senegal call, the agent ran three searches, kept nine sources, and moved France from 50.3% to 61.7%. The source list included a piece flagging William Saliba as doubtful and a later one that walked some of that worry back. The agent is reading a noisy evidence stream, not the truth; the trace lets a reader see what it leaned on and judge whether the move was earned.</p><p>The forecast itself comes from a small ensemble of language model calls. Each one returns win/draw/loss probabilities, a scoreline distribution, and a factor-by-factor account of its reasoning. The system aggregates those passes into a single forecast and publishes it as the agent&#8217;s call, set beside the statistical model rather than folded into it.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GbCG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4c42600-2eb9-4347-9a31-2aa12a504840_538x298.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GbCG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4c42600-2eb9-4347-9a31-2aa12a504840_538x298.png 424w, https://substackcdn.com/image/fetch/$s_!GbCG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4c42600-2eb9-4347-9a31-2aa12a504840_538x298.png 848w, https://substackcdn.com/image/fetch/$s_!GbCG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4c42600-2eb9-4347-9a31-2aa12a504840_538x298.png 1272w, https://substackcdn.com/image/fetch/$s_!GbCG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4c42600-2eb9-4347-9a31-2aa12a504840_538x298.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GbCG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4c42600-2eb9-4347-9a31-2aa12a504840_538x298.png" width="538" height="298" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c4c42600-2eb9-4347-9a31-2aa12a504840_538x298.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:298,&quot;width&quot;:538,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:36735,&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://insights.ml4trading.io/i/202289999?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4c42600-2eb9-4347-9a31-2aa12a504840_538x298.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_!GbCG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4c42600-2eb9-4347-9a31-2aa12a504840_538x298.png 424w, https://substackcdn.com/image/fetch/$s_!GbCG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4c42600-2eb9-4347-9a31-2aa12a504840_538x298.png 848w, https://substackcdn.com/image/fetch/$s_!GbCG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4c42600-2eb9-4347-9a31-2aa12a504840_538x298.png 1272w, https://substackcdn.com/image/fetch/$s_!GbCG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4c42600-2eb9-4347-9a31-2aa12a504840_538x298.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><em>A single agent call card from the live app. The card exposes the model-to-agent shift, likely score, short rationale, source count, and grading status.</em></p><h2>What the live record adds</h2><p>A tournament forecast table is easy to publish and easy to forget by the weekend. The World Cup Forecast Agent pulls apart the pieces such tables usually blend:</p><ul><li><p>the model prior</p></li><li><p>the market&#8217;s outside view</p></li><li><p>the match&#8217;s current context</p></li><li><p>the agent&#8217;s reading of it</p></li><li><p>the eventual score</p></li></ul><p>A market disagreement is not an injury note. A model probability, a research summary, and a language model&#8217;s explanation are three different objects. Holding them apart makes the forecast inspectable and scoreable.</p><p>That turns the World Cup into a gentle version of a harder ML4T problem. Many forecasting workflows begin with a quantitative prior and then have to wrap it in messy, recent, and largely unstructured information. The question that matters is whether the agent contributes a distinct, reviewable adjustment around the model or just restates it in livelier language.</p><p>Football makes that concrete. The match is played. The call can be checked. The scoreboard does the rest.</p><p>The live app is already showing its shape. As of the June 16 morning snapshot, 16 calls had been graded, with agent and model tied at 37.5% top-pick accuracy. The model&#8217;s live Brier score was 0.7271 against 0.704 for the naive-prior floor. Lower is better, so the model had not yet pulled clear of the floor, which itself was hitting 43.8% on the same 16 matches. Sixteen games is far too few to render a verdict, but the machinery is already doing its work: publish the call, score the result, let the record stack up.</p><p>The scorecard uses multiclass Brier for match outcomes, with signed per-call deltas showing whether each agent adjustment helped or hurt the model&#8217;s score. By the end of the tournament, the bar should be higher than &#8220;the agent sounded informed.&#8221; The adjustment has to improve the scoring record, sharpen the diagnosis, or both.</p><h2>Why this belongs with the forecasting-agent workshop</h2><p>The World Cup build is intentionally lightweight. It is the playful cousin of Bridgewater AIA Labs&#8217; <a href="https://arxiv.org/abs/2511.07678">AIA Forecaster</a>: start from a prior, pull current evidence, run independent forecast passes, aggregate them, store the trace, and score the call once it resolves.</p><p>The differences are worth being explicit about. The AIA technical report includes supervisor reconciliation and statistical calibration that this app does not claim to reproduce. AIA&#8217;s result is also more interesting than the usual &#8220;agent beats the market&#8221; story: on a liquid-markets benchmark, the agent underperformed market consensus on its own, while an ensemble of AIA forecasts and that same consensus beat the consensus alone. That is why this app keeps model, market, and agent in view at the same time.</p><p>Inside ML4T, this is the second live forecasting-agent surface. The <a href="https://www.ml4trading.io/agent-lab/">ML4T Agent Lab</a> tracks AIA-style questions across Polymarket and Kalshi; the World Cup app brings the same discipline, logged priors, sourced adjustments, and scored outcomes, to a tournament anyone can follow.</p><p>The workshop pushes these choices in a less-forgiving setting: independent research, reconciliation, calibration, ablations, and replayable traces. The World Cup app is the easy way in. You can pull up a match, disagree with the number, and look at exactly what the agent checked before kickoff.</p><h2>How to read the live app</h2><p>There are a few good places to start. The model view carries champion odds, match probabilities, team ratings, and market comparisons. The agent view holds the upcoming and resolved calls: the model-to-agent shift, the factor trace, the searches and sources, the date each was generated. The scorecard is where the misses surface. Once a result lands, every pre-match call is graded against both the outcome and the model.</p><p>It will be wrong, and often. Football is low-scoring, noisy, and decided by small events that can swamp reasonable priors. That is most of the reason to publish the record at all.</p><p>Watch the matches, argue with the numbers, and check back as the scoreboard fills in.</p><p><a href="https://applied-ai.com/agent-lab/world-cup-2026/live/">World Cup Forecast Agent live app</a></p><h2>Learn how to build multi-agent forecasting systems</h2><p>If you want to see how the architecture travels beyond football, next week&#8217;s free Maven Lightning Lesson walks through the design of auditable multi-agent systems: <a href="https://maven.com/p/6c2609/build-multi-agent-systems-you-can-audit">Build Multi-Agent Systems You Can Audit</a>.</p><p>The full hands-on workshop is here: <a href="https://maven.com/stefan-jansen/forecasting-agents">Building Multi-Agent Forecasting Systems</a>.</p>]]></content:encoded></item><item><title><![CDATA[When multi-agent systems are worth the overhead]]></title><description><![CDATA[A multi-agent panel only helps when the agents disagree for real reasons. Forecasting is where you can check.]]></description><link>https://insights.ml4trading.io/p/when-multi-agent-systems-are-worth</link><guid isPermaLink="false">https://insights.ml4trading.io/p/when-multi-agent-systems-are-worth</guid><dc:creator><![CDATA[Stefan Jansen]]></dc:creator><pubDate>Wed, 10 Jun 2026 16:19:25 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/14e60be2-2979-492d-b1cd-7b043afd9169_1200x630.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a href="https://www.ml4trading.io/third-edition/chapters/24_autonomous_agents/">Chapter 24</a> of <em>Machine Learning for Trading</em> treats agents as engineering systems rather than chat interfaces. One of its capstones is a multi-agent forecasting system: several research agents gather evidence, an aggregation rule combines their probabilities, a supervisor reconciles disagreement, and the final forecast can later be scored.</p><p>The accompanying notebooks test where this architecture helps, where it adds cost, and where a simpler baseline would have been enough.</p><p>One example is the adversarial-debate notebook. A bull-bear debate ran for three rounds on a Fed-rate question. The bull ended at 0.78, the bear at 0.35, and the gap stayed fixed at 0.43 across all three rounds. The debate added more than 6,000 tokens and moved the blended forecast by one percentage point.</p><p>The result provides a practical lesson for multi-agent systems: the extra-agent stage has to justify its cost.</p><p>Multi-agent systems are easy to make look sophisticated. Add several model calls, assign roles to them, ask them to debate, and place a supervisor at the end. The harder question is whether the added structure produces independent evidence, actionable disagreement, better reconciliation, or a better-scored output than a simpler baseline.</p><p>Forecasting is a good lab for that question because the output is hard to hide. A probability can be timestamped, compared with a market price or base rate, calibrated, ablated, and scored after the event resolves.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OLCV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffd13a79-6a58-450a-8512-01186279bcbb_2752x1171.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OLCV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffd13a79-6a58-450a-8512-01186279bcbb_2752x1171.jpeg 424w, https://substackcdn.com/image/fetch/$s_!OLCV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffd13a79-6a58-450a-8512-01186279bcbb_2752x1171.jpeg 848w, https://substackcdn.com/image/fetch/$s_!OLCV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffd13a79-6a58-450a-8512-01186279bcbb_2752x1171.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!OLCV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffd13a79-6a58-450a-8512-01186279bcbb_2752x1171.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OLCV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffd13a79-6a58-450a-8512-01186279bcbb_2752x1171.jpeg" width="1456" height="620" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ffd13a79-6a58-450a-8512-01186279bcbb_2752x1171.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:620,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:422740,&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://insights.ml4trading.io/i/201475442?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffd13a79-6a58-450a-8512-01186279bcbb_2752x1171.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_!OLCV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffd13a79-6a58-450a-8512-01186279bcbb_2752x1171.jpeg 424w, https://substackcdn.com/image/fetch/$s_!OLCV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffd13a79-6a58-450a-8512-01186279bcbb_2752x1171.jpeg 848w, https://substackcdn.com/image/fetch/$s_!OLCV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffd13a79-6a58-450a-8512-01186279bcbb_2752x1171.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!OLCV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffd13a79-6a58-450a-8512-01186279bcbb_2752x1171.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><p><em>Chapter 24&#8217;s full multi-agent forecasting pipeline: specialist research agents feed aggregation, optional debate, supervisor reconciliation, a forecast artifact, and audit artifacts. The question for this issue is which stages earn their cost.</em></p><h2>The realistic standard</h2><p>Bridgewater AIA Labs&#8217; <a href="https://doi.org/10.48550/arXiv.2511.07678">AIA Forecaster technical report</a> is one of the clearest public blueprints for this pattern.</p><p>The report describes a multi-agent forecasting system with agentic search, supervisor reconciliation, and statistical calibration. It reports performance that is statistically indistinguishable from human superforecasters on ForecastBench, but it also reports a more sobering result on liquid prediction-market questions: AIA Forecaster underperforms the market consensus on its own. The interesting result is the ensemble. On that harder benchmark, combining market prices with AIA forecasts performs better than either source alone.</p><p>The standard for agent systems in this setting is narrower than market replacement. The agent has to add information that survives comparison with a strong baseline.</p><p>The Chapter 24 implementation starts with a single ReAct research loop, then adds tool contracts, explicit state, multi-agent forecasting, evaluation, governance, and a separate ML4T research operator. This issue focuses on the forecasting system because it most clearly exposes the multi-agent design.</p><h2>The pipeline</h2><p>The forecasting agent example starts with a question that can be resolved - on a prediction market, at a later stage.</p><p>&#8220;Will inflation be high?&#8221; is not enough. A resolved example from the Lightning Lesson is precise enough to score: &#8220;Will US core PCE for April 2026 exceed 0.3% month over month in the BEA Personal Income and Outlays release scheduled for May 28, 2026?&#8221; The <a href="https://www.bea.gov/news/2026/personal-income-and-outlays-april-2026">BEA release</a> reported core PCE at 0.2% month over month, so the event resolved &#8220;no.&#8221;</p><p>After the question is fixed, several research agents work independently. Each agent searches for evidence, records what it finds, reasons about the result, and returns a probability with supporting evidence. In the AIA design, these agents are parallel evidence-gathering runs rather than role-playing characters.</p><p>The system then combines the probabilities. The simple mean is the reference point. The median and trimmed mean reduce the influence of outliers. Extremization pushes an aggregate away from 0.5 when forecasters are treated as sufficiently independent.</p><p>One diversity adjustment used in the Chapter 24 notebooks is:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;D(n,\\rho)=\\sqrt{\\frac{n}{1+(n-1)\\rho}}&quot;,&quot;id&quot;:&quot;MYNPEDFGMQ&quot;}" data-component-name="LatexBlockToDOM"></div><p>Here, <em>D</em> quantifies how far the aggregate can deviate from 0.5 after accounting for dependence among forecasters. With three independent forecasters, <em>D</em>&#8196;=&#8196;1.73. At pairwise correlation 0.7, it falls to 1.12. Three correlated agents are only marginally more informative than a single agent.</p><p>A supervisor can inspect disagreement after aggregation. The supervisor policy is narrow: identify the source of disagreement, run clarifying searches when evidence is missing, and override the aggregate only when the new evidence clears a stated confidence threshold. Otherwise the aggregate remains the forecast.</p><p>Calibration comes last. It can correct systematic probability bias only when estimated on resolved forecasts outside the run being scored. It cannot repair a contaminated question, a weak evidence process, or three agents that all missed the same fact.</p><p>The stored forecast record should contain the question, resolution source, cutoff, evidence references, agent forecasts, aggregate, supervisor action, calibration setting, model configuration, market or base-rate baseline, final probability, outcome, and score.</p><h2>What the notebooks show</h2><p>The Chapter 24 notebooks include weak results rather than only clean demonstrations to show the reality of agent system development (notebooks will be released closer to publication, late June/early July).</p><p>In the notebook <code>research_agent</code>, two identical research agents working on the same Fed-rate question returned 0.75 and 0.72. In the notebook <code>multi_agent_research</code>, three agents on a pinned Fed-hike question all returned 0.25, even though their search paths differed slightly. Temperature alone did not create an informative panel.</p><p>In the notebook <code>aggregation_math</code>, the diversity factor makes the cost of correlation explicit. Adding agents helps only if they bring different information. If they share the same model, tools, retrieval sources, and priors, the panel can appear broad while behaving like a single repeated forecast.</p><p>In <code>adversarial_debate</code>, debate lengthened the trace without narrowing the gap. The notebook shows why debate needs an ablation rather than just a transcript. If the debate does not move beliefs, reveal missing evidence, or improve resolved-outcome scores, it is theater with a token bill.</p><p>In <code>evaluation_and_governance</code>, the evaluation panel compares the pipeline with simpler variants using Brier score, log score, expected calibration error, sharpness, ablations, and a market baseline. The panel is small and carries contamination caveats, so it illustrates the scoring workflow rather than a performance claim.</p><p>The design rule is simple: keep a component only when it improves the forecast record, the diagnosis, or the evaluation.</p><h2>What adjacent work adds</h2><p>The relevant papers add design lessons rather than slogans.</p><p>Bridgewater&#8217;s AIA Forecaster supplies the forecasting blueprint: agentic search, multiple independent forecasts, supervisor reconciliation, calibration, and comparison with market consensus.</p><p><a href="https://doi.org/10.48550/arXiv.2508.11152">AlphaAgents</a> matters here less for its reported portfolio results than for its role-structured design: fundamental, sentiment, and valuation agents with debate as the reconciliation mechanism.</p><p><a href="https://doi.org/10.48550/arXiv.2512.08296">Recent work on scaling agent systems</a> makes the general point explicit: more agents can help on decomposable tasks and hurt on sequential ones. Coordination overhead, redundancy, and error amplification are design variables.</p><h2>Where the pattern fits</h2><p>The workshop uses forecasting because the work is measurable. That does not make forecasting a universal test case for agents.</p><p>Sequential execution tasks usually need a workflow, not a panel of agents. A deterministic data-cleaning step, for example, should not become a debate among models. Evidence-gathering tasks may require one strong research agent at first, but several later. Multi-agent design becomes more plausible when the task has competing interpretations, missing evidence, and a decision artifact that can be compared with a baseline.</p><p>Forecasting gives that problem a disciplined form. The artifact is a probability. The baseline may be a market price, base rate, consensus forecast, or simpler model. The outcome eventually resolves. The system can be wrong in a measurable way.</p><p>That is why this topic belongs in <a href="https://www.ml4trading.io/">ML4T</a>. It is close enough to trading and research to matter, but constrained enough to evaluate.</p><h2>What we are building</h2><p>The companion forecasting-agent codebase turns the AIA pattern into a runnable system, including a CLI, configuration profiles, read-only prediction-market connectors, SQLite persistence, a Streamlit dashboard, deterministic replay mode, local and hosted model profiles, and ablation settings.</p><p>The free <a href="https://maven.com/p/6c2609/build-multi-agent-systems-you-can-audit">Lightning Lesson</a> on <strong>Thursday, June 18, 2026,</strong> walks through this architecture: independent research agents, aggregation, supervisor reconciliation, calibration, and scoring. The practical goal is to inspect, test, ablate, and score the system rather than trust the final paragraph.</p><p>The full <a href="https://maven.com/stefan-jansen/forecasting-agents">hands-on workshop</a>, Building Multi-Agent Forecasting Systems, runs Saturday, June 27, 2026, 10am-5pm ET. Participants work with config profiles, replay traces, aggregation settings, supervisor policy, calibration diagnostics, and resolved-outcome scores. The guaranteed path uses deterministic replay, so the exercises do not depend on API keys or live network access. The connectors are read-only.</p><p>Use five questions to judge the result:</p><ul><li><p>Did independent agents produce independent evidence?</p></li><li><p>Did aggregation improve on the simple mean?</p></li><li><p>Did the supervisor find missing evidence or merely override?</p></li><li><p>Did calibration improve reliability without hiding a weak evidence process?</p></li><li><p>Did the system improve on a market price, base rate, or simpler model?</p></li></ul><p>Tomorrow&#8217;s issue uses the World Cup Forecast Lab as a public forecasting surface. Later issues go deeper into AIA Forecaster, multi-agent diversity, and the ML4T research operator.</p><p><a href="https://maven.com/p/6c2609/build-multi-agent-systems-you-can-audit">Register for the free Lightning Lesson: Build Multi-Agent Systems You Can Audit</a></p><p><a href="https://maven.com/stefan-jansen/forecasting-agents">Register for the workshop: Building Multi-Agent Forecasting Systems</a></p>]]></content:encoded></item><item><title><![CDATA[Deep Learning for End-to-End Portfolio Construction]]></title><description><![CDATA[Neural allocators can train directly on portfolio objectives such as Sharpe, costs, and drawdowns. That makes the model more aligned with trading performance, and much harder to audit.]]></description><link>https://insights.ml4trading.io/p/deep-learning-for-end-to-end-portfolio</link><guid isPermaLink="false">https://insights.ml4trading.io/p/deep-learning-for-end-to-end-portfolio</guid><dc:creator><![CDATA[Stefan Jansen]]></dc:creator><pubDate>Tue, 26 May 2026 15:42:27 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!MGze!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffaba2fbc-1cb9-4256-a52c-29d47b0fa37d_2752x1351.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Most machine learning workflows for trading stop before the trade.</p><p>A model estimates returns, ranks assets, or emits a signal. A risk model estimates covariance or volatility. An allocator turns those objects into weights. A backtest then decides whether the chain produced a portfolio worth trading.</p><p>That separation is valuable because it makes errors easier to diagnose. If the signal has no information coefficient, the allocator is not the first suspect. If the signal has a positive IC but the strategy loses money, the next checks are sizing, turnover, costs, concentration, exposure, and timing.</p><p>End-to-end portfolio learning changes the object being learned. The network maps market features directly to positions and trains on a portfolio-level objective, usually a differentiable Sharpe-style loss computed after volatility scaling and turnover costs. The appeal is alignment: the gradient flows through a portfolio return stream closer to the object used in evaluation, rather than stopping at one-step forecast error. The risk is that forecasting, sizing, turnover, and exposure control become entangled in one loss surface.</p><p>The practical rule is narrow: use end-to-end allocators when the objective cannot be cleanly decomposed into forecasts plus an optimizer, and evaluate them as full trading systems rather than allocator modules. Objective alignment is not evidence. It is a reason to run stricter evidence checks.</p><p><a href="https://ml4trading.io/third-edition/chapters/17_portfolio_construction/">Chapter 17 of </a><em><a href="https://ml4trading.io/third-edition/chapters/17_portfolio_construction/">Machine Learning for Trading</a></em> uses this tension to place learned allocators inside a broader portfolio-construction workflow. The chapter does not argue that neural allocators replace classical allocation. It asks a narrower question: when is it useful to train the allocation decision itself?</p><p>Three recent lines of work make the progression visible. The first shows that portfolio weights can be trained directly through a Sharpe-style objective. The second asks which sequence architectures survive under a common volatility-targeted portfolio loss. The third adds structure: cost-aware training, cross-market filtration discipline, graph-constrained attention, and a robust regime objective.</p><p>Chapter 17&#8217;s ETF examples use those papers to ask a practical question: what has to be checked when the model owns the path from features to weights?</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MGze!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffaba2fbc-1cb9-4256-a52c-29d47b0fa37d_2752x1351.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MGze!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffaba2fbc-1cb9-4256-a52c-29d47b0fa37d_2752x1351.jpeg 424w, https://substackcdn.com/image/fetch/$s_!MGze!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffaba2fbc-1cb9-4256-a52c-29d47b0fa37d_2752x1351.jpeg 848w, https://substackcdn.com/image/fetch/$s_!MGze!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffaba2fbc-1cb9-4256-a52c-29d47b0fa37d_2752x1351.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!MGze!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffaba2fbc-1cb9-4256-a52c-29d47b0fa37d_2752x1351.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MGze!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffaba2fbc-1cb9-4256-a52c-29d47b0fa37d_2752x1351.jpeg" width="1456" height="715" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/faba2fbc-1cb9-4256-a52c-29d47b0fa37d_2752x1351.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:715,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:441771,&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://insights.ml4trading.io/i/199282494?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffaba2fbc-1cb9-4256-a52c-29d47b0fa37d_2752x1351.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_!MGze!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffaba2fbc-1cb9-4256-a52c-29d47b0fa37d_2752x1351.jpeg 424w, https://substackcdn.com/image/fetch/$s_!MGze!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffaba2fbc-1cb9-4256-a52c-29d47b0fa37d_2752x1351.jpeg 848w, https://substackcdn.com/image/fetch/$s_!MGze!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffaba2fbc-1cb9-4256-a52c-29d47b0fa37d_2752x1351.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!MGze!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffaba2fbc-1cb9-4256-a52c-29d47b0fa37d_2752x1351.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><p><em>Figure 1. The end-to-end portfolio-learning pipeline in Chapter 17. Per-asset features pass through a shared sequence encoder, a bounded signal head, a volatility-targeted position layer, and a portfolio-return aggregation step. The loss is a risk-adjusted statistic of realized portfolio returns, so gradients flow through the allocation decision rather than stopping at a forecast.</em></p><h2>What changes when the model learns weights</h2><p>Chapter 17 starts with a portfolio-construction term sheet: objective, inputs, constraints, rebalancing protocol, cost treatment, and evaluation plan. That framing matters because allocation is otherwise easy to turn into an unlogged search layer once model selection is complete.</p><p>The early sections cover the standard allocator workflow. Expected returns may come from a model. Covariance may come from a shrinkage estimator, a factor model, or a realized window. Constraints and turnover penalties shape the final weight vector. Evaluation then asks whether the allocation improved the portfolio relative to a benchmark allocator, using the same signal and backtesting protocol.</p><p>The learned allocators in Section 17.8 are different. They do not consume the same forecast stream as the allocator comparisons earlier in the chapter. They learn from raw or engineered price features and output positions directly. A head-to-head table is still useful, but it compares systems rather than allocators fed identical predictions.</p><p>That makes learned allocators a separate evidence track. They are not allocator modules fed identical forecasts; they are full trading systems. They must still pass simple heuristics, but the comparison must include leakage checks, costs, turnover, drawdown, regime slices, seed variation, and component ablations. A single test Sharpe is not enough evidence when the model owns the entire path from features to weights.</p><p>The tables below should be read as experiment-specific evidence, not as a single consolidated leaderboard across different data masks, model protocols, and portfolio-return calculations.</p><h2>The common computation graph</h2><p>The three implementations share a recognizable core graph, although their constraints, cost treatment, and details of the robust objective differ.</p><p>For each asset and decision time, the model receives a fixed-length lookback window. A sequence encoder processes the window and produces a hidden state. A small head projects the hidden state into a signal. A position layer converts the signal into a tradeable weight, usually after volatility scaling. The portfolio-return layer combines those positions with next-period realized returns and subtracts turnover costs. The training loss is computed on the resulting portfolio-return stream.</p><p>The base loss is usually a negative annualized Sharpe-style objective computed over the portfolio return stream. It rewards average portfolio return relative to portfolio volatility rather than one-step forecast accuracy. Later versions add cost terms and robust subperiod penalties. The notation is schematic: the papers and examples differ in output constraints, volatility scaling, transaction-cost treatment, and robust-window construction. Figure 2 puts the objective where it belongs in the workflow: weights, returns, masks, costs, and previous positions first form a net return stream; the loss then rewards pooled Sharpe while adding pressure on weak subperiods.</p><p>The pooled Sharpe term asks whether net portfolio returns compensate for realized volatility after sizing and costs. The SoftMin term is a smoothed worst-window Sharpe ratio; maximizing it rewards policies whose weak windows improve rather than those that rely on a few favorable windows.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!w0iz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f5d2c13-25d1-4e75-a24f-73f117288269_2499x1402.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!w0iz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f5d2c13-25d1-4e75-a24f-73f117288269_2499x1402.png 424w, https://substackcdn.com/image/fetch/$s_!w0iz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f5d2c13-25d1-4e75-a24f-73f117288269_2499x1402.png 848w, https://substackcdn.com/image/fetch/$s_!w0iz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f5d2c13-25d1-4e75-a24f-73f117288269_2499x1402.png 1272w, https://substackcdn.com/image/fetch/$s_!w0iz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f5d2c13-25d1-4e75-a24f-73f117288269_2499x1402.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!w0iz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f5d2c13-25d1-4e75-a24f-73f117288269_2499x1402.png" width="1456" height="817" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7f5d2c13-25d1-4e75-a24f-73f117288269_2499x1402.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:817,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:227546,&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://insights.ml4trading.io/i/199282494?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f5d2c13-25d1-4e75-a24f-73f117288269_2499x1402.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_!w0iz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f5d2c13-25d1-4e75-a24f-73f117288269_2499x1402.png 424w, https://substackcdn.com/image/fetch/$s_!w0iz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f5d2c13-25d1-4e75-a24f-73f117288269_2499x1402.png 848w, https://substackcdn.com/image/fetch/$s_!w0iz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f5d2c13-25d1-4e75-a24f-73f117288269_2499x1402.png 1272w, https://substackcdn.com/image/fetch/$s_!w0iz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f5d2c13-25d1-4e75-a24f-73f117288269_2499x1402.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><em>Figure 2. The portfolio objective is built from current weights, next-period returns, availability masks, previous positions, and cost inputs. The formula is shown as a schematic rather than an implementation identity; the symbol key defines the notation used in the image.</em></p><p>Two details are easy to understate.</p><p>First, the pooled Sharpe is not a separable loss. Its gradient depends on the mean and variance of the return stream. If a training loop computes Sharpe in small mini-batches and averages the resulting gradients, it optimizes the average mini-batch Sharpe, not the pooled Sharpe across the full panel. Those objectives can prefer different policies because the denominator is computed on different return distributions.</p><p>DeePM treats this as an implementation issue, not a footnote. The paper introduces an exact two-pass microbatching procedure for large effective batches: </p><ul><li><p>First, accumulate sufficient statistics for the full logical batch, then replay the forward pass with the corrected normalization so the gradient matches the pooled objective.</p></li><li><p>Second, cost-aware training differs from post hoc cost reporting. If turnover costs are charged only after training, the model can learn a policy that works on gross returns and fails when traded. When costs are within the return stream being optimized, the model encounters implementation friction during training.</p></li></ul><h2>Direct Sharpe training is only the start</h2><p><a href="https://arxiv.org/abs/2005.13665">Zhang, Zohren, and Roberts (2020)</a> provide the clean starting point. The paper bypasses the expected-return forecast and trains a neural network to output long-only portfolio weights directly. A softmax layer keeps weights positive and ensures they sum to 1. The objective is portfolio Sharpe computed from realized portfolio returns, and gradient ascent updates the model parameters.</p><p>The paper deliberately keeps the architecture simple: a single-layer LSTM with 64 units, a 50-day lookback, close prices and daily returns as inputs, Adam optimization, and a validation split for hyperparameter control. The empirical setup uses four ETFs or index proxies: VTI, AGG, DBC, and a VIX-tracking proxy. Reported test results include volatility scaling and transaction costs. In that four-asset setting, the deep learning strategy performs well relative to the paper&#8217;s baselines and moves substantially toward bonds during the COVID-19 crash, which falls inside the paper&#8217;s test period.</p><p>The novelty lies in the objective, not in architectural complexity. The model demonstrates that portfolio weights can be learned via a differentiable, risk-adjusted objective without first estimating expected returns.</p><p>The Chapter 17 ETF example is useful precisely because it does not flatter the method. It puts the same idea into a broader 29-ETF setting, using daily prices from 2006-01-03 to 2025-12-31, a chronological 60/20/20 train/validation/test split, 63-day sequences, and a long-only softmax LSTM trained against a differentiable Sharpe objective.</p><p>The result is a useful negative control:</p><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/rsTRB/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dcbe20d4-943a-42bc-903d-540fa8f43683_1220x680.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6329048a-b528-4592-92b7-950bd8df505b_1220x838.png&quot;,&quot;height&quot;:400,&quot;title&quot;:&quot;Implementation contract&quot;,&quot;description&quot;:&quot;Design choices an end-to-end allocator has to preserve so portfolio-learning evidence remains auditable.&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/rsTRB/1/" width="730" height="400" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><p>The learned LSTM reduces volatility and drawdown, but the return side does not compensate. Equal weight and inverse volatility are not straw-man baselines here; they are low-turnover controls that expose whether the learned policy earns its extra complexity. The best validation Sharpe is 1.609; the test Sharpe is 0.48. Directly optimizing a portfolio loss does not remove overfitting. It moves the overfitting target from prediction error to the portfolio object itself.</p><p>This is why the baseline belongs in the issue. It prevents the argument from becoming &#8220;train the Sharpe and win.&#8221; The paper establishes the training principle. The Chapter 17 replication shows why the principle needs stronger architecture, costs, and validation discipline before it becomes competitive.</p><h2>Better sequence models still have to pay costs</h2><p><a href="https://arxiv.org/abs/2603.01820">Saly-Kaufmann et al. (2026)</a> ask the next question: if every model is evaluated under the same portfolio objective, which temporal architecture earns its complexity?</p><p>Their benchmark uses roughly 15 years of futures and currency data across bonds, commodities, energy, foreign exchange, and equity indices. Each model maps a lookback window to a bounded signal in <code>[-1, 1]</code>. A volatility-targeted position layer converts the signal to risk-scaled exposure. The paper uses pooled Sharpe as the optimization objective and reports a broad set of evaluation metrics: annualized return, Sharpe ratio, HAC statistics, hit rate, turnover, passive-relative information ratio, downside risk, seed robustness, and breakeven transaction costs.</p><p>The paper evidence is best read as an architecture ranking under a shared protocol, not as a claim that those absolute Sharpe ratios transfer to the Chapter 17 ETF examples. The benchmark uses a different universe, futures-style instruments, a 10% volatility target, seed averaging, and a different implementation stack.</p><p>Within that benchmark, the main lesson is not that one architecture universally wins, but that inductive bias matters more than raw capacity. VLSTM, a variable-selection network in front of an LSTM encoder, reports the strongest aggregate Sharpe in the main table: 2.39, with a 23.9% annualized return. The hybrid LPatchTST and TFT are close behind, at 2.32 and 2.20, respectively. xLSTM has a lower average Sharpe ratio of 1.80 but a more favorable turnover profile than the classical LSTM, which matters for implementation. iTransformer has very low turnover but weak economic performance, with a Sharpe of 0.35 in the reported benchmark.</p><p>The discussion is more important than the ranking. Recurrent or recurrent-hybrid models do well because the architecture builds in a temporal axis rather than forcing the model to infer it from noisier token structure. Variable selection helps because most financial features are weak, unstable, or regime-dependent. But the &#8220;best&#8221; architecture depends on the metric. VLSTM leads on average Sharpe; LPatchTST and VxLSTM, the variable-selection plus xLSTM hybrid, look attractive on some downside and tail-risk measures; xLSTM has a stronger cost buffer in the paper&#8217;s breakeven analysis.</p><p>The paper also checks seed sensitivity. Under a smaller experimental budget, VLSTM still reports a Sharpe near the full-budget estimate: 2.40 in the reduced-seed table versus 2.39 in the main table. That does not make the result universal, but it reduces the risk that the ordering is only a lucky initialization artifact within this benchmark.</p><p>The Chapter 17 VLSTM example applies that idea to the same ETF universe. It keeps the same 29 ETFs, the 2006-2025 price panel, the 63-day sequence length, and the chronological split as in the first ETF example. The model changes the allocator in two ways:</p><ul><li><p>It adds a TFT-style gated residual network and variable-selection network before the LSTM;</p></li><li><p>It replaces the softmax long-only output with a volatility-targeted long-short position layer trained with a 5 bps cost-aware pooled-Sharpe loss.</p></li></ul><p>The cost table below is an out-of-sample stress test on one trained model. The model is trained with a 5 bps one-way cost inside the loss; the table then revalues the same held-out weights at 0, 5, 10, 20, and 50 bps one-way cost per dollar of turnover. It is not retrained at each cost level.</p><p>At zero cost, VLSTM is effectively tied with equal weight. The cost profile is the result that matters:</p><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/j9Dkl/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/000b8696-25f3-4b5a-9278-c04081f3c1a0_1220x542.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6e06ffcb-567e-4f40-87cb-d61f8c18b5f9_1220x700.png&quot;,&quot;height&quot;:400,&quot;title&quot;:&quot;VLSTM cost stress&quot;,&quot;description&quot;:&quot;Held-out Sharpe for one trained Chapter 17 ETF VLSTM model, revalued at different one-way turnover costs.&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/j9Dkl/1/" width="730" height="400" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><p>The VLSTM variant recovers most of the gap between the softmax LSTM and the heuristic allocators at zero cost. It does not survive the 5 bps cost assumption used during training. That is a substantive result, not a caveat. Architecture can look competitive and gross, yet still fail the deployability test.</p><h2>Robust portfolio learning needs structure</h2><p><a href="https://arxiv.org/abs/2601.05975">Wood, Roberts, and Zohren (2026)</a> advance the same line of work. DeePM is built for systematic macro portfolios, where the model must learn from noisy non-stationary data, trade across asynchronous global markets, and survive transaction costs.</p><p>The paper identifies three design problems.</p><ul><li><p>The first is the ragged filtration problem. Global markets do not close at the same time. A naive cross-sectional attention layer can inadvertently allow an earlier-closing market to see information from a later-closing one. In the paper&#8217;s implementation, Directed Delay lags cross-sectional conditioning so that cross-market representations are measured with respect to a common information set, preferring filtration discipline over maximum same-day freshness.</p></li><li><p>The second is low signal-to-noise cross-asset learning. Free attention can form economically implausible links and overfit unstable correlations. DeePM uses a macro graph prior: an ex ante economic topology that constrains or biases cross-asset attention toward admissible relationships. The paper gives examples such as intra-group cliques, risk-on links across equities and cyclical assets, and inflation-sensitive links among energy, rates, and precious metals. The graph is a structural regularizer, not a claim that the specified edges are ground-truth causality.</p></li><li><p>The third is regime fragility. A pooled Sharpe objective can be lifted by favorable windows while hiding weak periods. DeePM augments pooled Sharpe with a SoftMin penalty over subperiod Sharpe ratios. As the temperature approaches zero, the penalty approaches the worst window. At intermediate temperature, it emphasizes weak windows without collapsing onto a single episode. The paper connects this to a KL-penalized distributionally robust objective and to Entropic Value-at-Risk.</p></li></ul><p>The architecture maps those problems into explicit modeling choices:</p><ul><li><p>a vectorized variable-selection network with FiLM-style static conditioning, where static asset context modulates features through feature-wise affine transforms;</p></li><li><p>an LSTM temporal backbone plus temporal attention;</p></li><li><p>lagged cross-sectional attention for filtration discipline;</p></li><li><p>macro-graph attention for economic structure;</p></li><li><p>a cost-aware net-return objective;</p></li><li><p>a SoftMin-augmented robust Sharpe loss.</p></li></ul><p>In the DeePM paper&#8217;s 2010-2025 macro futures test, with out-of-sample returns rescaled to a 10% annualized volatility, the full model reports a gross Sharpe ratio of 1.29 and a net Sharpe ratio of 0.93 after transaction costs. Passive equal risk reports a 0.50 net Sharpe ratio, TSMOM 0.45, and the Momentum Transformer baseline, trained with the same transaction-cost regularization, reports 0.66. The paper-level ablations matter:</p><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/4vKe8/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dcaecb66-e65b-4d21-a0fc-efae40e97549_1220x616.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/92f9950d-2c45-41d0-91b6-98b653236056_1220x774.png&quot;,&quot;height&quot;:400,&quot;title&quot;:&quot;DeePM paper ablations&quot;,&quot;description&quot;:&quot;Net Sharpe results reported in Wood, Roberts, and Zohren (2026) for the macro futures and FX universe.&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/4vKe8/1/" width="730" height="400" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><p>Those are paper results on a 50-contract futures and FX universe, not results from the Chapter 17 ETF examples. The distinction matters.</p><p>The local ETF example then asks a narrower practical question: what happens when a DeePM-style structure is adapted to the same setting? The example uses 29 ETFs, five asset-class groups, daily prices from 2006 to 2025, an 84-day sequence length, and a chronological 60/20/20 split. It includes FiLM conditioning, variable selection, an LSTM backbone, cross-sectional attention, a small ETF macro graph prior, transaction costs, and the SoftMin objective. The key contrast is full DeePM versus a no-SoftMin ablation.</p><p>One protocol detail prevents a bad cross-table comparison. The heuristic baselines are local controls within each example, not a single shared benchmark series. The LSTM and VLSTM examples evaluate final-step returns from sliding windows; the DeePM-style example evaluates the full post-validation test-date mask and normalizes model risk weights before computing returns. The equal-weight rule is not changing; the sampling and return-alignment protocol is. Read each table within its local comparison, not as a claim that the same equal-weight series has two different Sharpe ratios.</p><p>On the test window:</p><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/gKFau/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/38393a1d-fa53-4f57-be11-436d3054a2c5_1220x532.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/04e61ffe-1e24-4be5-9af5-a860c476f9ab_1220x690.png&quot;,&quot;height&quot;:400,&quot;title&quot;:&quot;DeePM-style ETF test window&quot;,&quot;description&quot;:&quot;Chapter 17 ETF example comparing the full DeePM-style model with local controls on the test window.&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/gKFau/1/" width="730" height="400" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><p>The regime slice explains the source of the improvement. The split is mechanical: test days above the median 21-day annualized realized volatility of SPY are labeled &#8220;crisis,&#8221; and the remaining days are labeled &#8220;calm.&#8221; In this run, the threshold is set to 14.0%, resulting in 504 calm days and 503 crisis days.</p><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/YnbHz/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d7b10498-f594-4946-92c3-5859aa9be84a_1220x468.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/df8c7ab5-5f40-47e9-9ccc-a7666686c8f2_1220x592.png&quot;,&quot;height&quot;:400,&quot;title&quot;:&quot;DeePM ETF regime slice&quot;,&quot;description&quot;:&quot;Sharpe by median SPY 21-day realized-volatility split: 504 calm days and 503 crisis days.&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/YnbHz/1/" width="730" height="400" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><p>SoftMin does not help by making calm periods better. Calm Sharpe falls slightly from 1.26 to 1.21. The improvement comes from the crisis side, where Sharpe rises from 0.57 to 1.00. In this ETF window, the robust objective improves the shape of losses and the average statistic simultaneously.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tYsa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ce16b24-9105-49a5-b690-c694ea5101d8_1754x1504.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tYsa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ce16b24-9105-49a5-b690-c694ea5101d8_1754x1504.png 424w, https://substackcdn.com/image/fetch/$s_!tYsa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ce16b24-9105-49a5-b690-c694ea5101d8_1754x1504.png 848w, https://substackcdn.com/image/fetch/$s_!tYsa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ce16b24-9105-49a5-b690-c694ea5101d8_1754x1504.png 1272w, https://substackcdn.com/image/fetch/$s_!tYsa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ce16b24-9105-49a5-b690-c694ea5101d8_1754x1504.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tYsa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ce16b24-9105-49a5-b690-c694ea5101d8_1754x1504.png" width="1456" height="1248" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6ce16b24-9105-49a5-b690-c694ea5101d8_1754x1504.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1248,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:319903,&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://insights.ml4trading.io/i/199282494?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ce16b24-9105-49a5-b690-c694ea5101d8_1754x1504.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_!tYsa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ce16b24-9105-49a5-b690-c694ea5101d8_1754x1504.png 424w, https://substackcdn.com/image/fetch/$s_!tYsa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ce16b24-9105-49a5-b690-c694ea5101d8_1754x1504.png 848w, https://substackcdn.com/image/fetch/$s_!tYsa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ce16b24-9105-49a5-b690-c694ea5101d8_1754x1504.png 1272w, https://substackcdn.com/image/fetch/$s_!tYsa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ce16b24-9105-49a5-b690-c694ea5101d8_1754x1504.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><em>Figure 3. DeePM drawdown comparison from Chapter 17. The full SoftMin version keeps drawdowns shallower during high-volatility periods than the equal-weight and no-SoftMin ablations. The point of the figure is the path of losses, not only the full-window Sharpe ratio.</em></p><p>The ETF example does not isolate every DeePM component. It does not separately quantify FiLM, V-VSN, Directed Delay, macro graph, and temporal attention as the paper&#8217;s broader ablation table does. Its measured local contrast is full DeePM versus no SoftMin, with the architecture held otherwise fixed. The example also does not run a DeePM cost-stress grid, unlike the VLSTM table, so the result should not be taken as proof that the ETF DeePM policy survives arbitrary cost assumptions. The ETF Sharpe ratio should also not be read as evidence that the reduced example system is better than the paper system; the asset universe, volatility target, training protocol, ensemble design, and cost model differ.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FTlc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d1d3397-f17f-4dee-ae43-fe37263096f6_2203x1253.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FTlc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d1d3397-f17f-4dee-ae43-fe37263096f6_2203x1253.png 424w, https://substackcdn.com/image/fetch/$s_!FTlc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d1d3397-f17f-4dee-ae43-fe37263096f6_2203x1253.png 848w, https://substackcdn.com/image/fetch/$s_!FTlc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d1d3397-f17f-4dee-ae43-fe37263096f6_2203x1253.png 1272w, https://substackcdn.com/image/fetch/$s_!FTlc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d1d3397-f17f-4dee-ae43-fe37263096f6_2203x1253.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FTlc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d1d3397-f17f-4dee-ae43-fe37263096f6_2203x1253.png" width="1456" height="828" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1d1d3397-f17f-4dee-ae43-fe37263096f6_2203x1253.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:828,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:184491,&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://insights.ml4trading.io/i/199282494?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d1d3397-f17f-4dee-ae43-fe37263096f6_2203x1253.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_!FTlc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d1d3397-f17f-4dee-ae43-fe37263096f6_2203x1253.png 424w, https://substackcdn.com/image/fetch/$s_!FTlc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d1d3397-f17f-4dee-ae43-fe37263096f6_2203x1253.png 848w, https://substackcdn.com/image/fetch/$s_!FTlc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d1d3397-f17f-4dee-ae43-fe37263096f6_2203x1253.png 1272w, https://substackcdn.com/image/fetch/$s_!FTlc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d1d3397-f17f-4dee-ae43-fe37263096f6_2203x1253.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><em>Figure 4. Papers, Chapter 17 examples, and implementation patterns answer different questions. Paper benchmarks support research claims; local ETF examples illustrate evaluation logic; implementation patterns preserve the contract, not evidence of alpha.</em></p><h2>The implementation contract</h2><p>The evidence boundary is now the main point: papers, Chapter 17 examples, and implementation patterns answer different questions.</p><p>The reusable lesson is not a list of class names. It is the contract an end-to-end allocator has to preserve: what the model needs to see, what it produces, and where downstream constraints belong.</p><p>For a learned allocator, the input contract must carry more than just features. It needs feature windows, forward returns, availability masks, volatility-scaling terms, cost inputs, previous weights, and, when used, economic graph structure. The output is not a forecast to be handed to a separate optimizer; it is a target weight vector that must still pass through exposure, leverage, turnover, and backtest checks.</p><p>Each part of that contract corresponds to a failure mode from the papers and examples:</p><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/rsTRB/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/622b3453-b137-4ec6-a2d2-0ca196997f39_1220x680.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ab90035e-ae60-49b2-b544-bd785ce890b9_1220x838.png&quot;,&quot;height&quot;:400,&quot;title&quot;:&quot;Implementation contract&quot;,&quot;description&quot;:&quot;Design choices an end-to-end allocator has to preserve so portfolio-learning evidence remains auditable.&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/rsTRB/1/" width="730" height="400" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><p>This is the implementation boundary that matters. A DeePM-style allocator is not just a generic sequence model with a Sharpe loss. It needs a net-return layer, cost-aware turnover, pooled-objective semantics, optional graph constraints, and hooks for portfolio constraints after the model emits weights.</p><p>At the same time, packaging those mechanisms in software is not evidence of alpha. The evidence still comes from matched protocols, out-of-sample tests, cost stress, regime slices, seed checks, and ablations.</p><h2>Alignment raises the burden of proof</h2><p>The evidence across the Chapter 17 examples is mixed.</p><p>The softmax LSTM shows that direct Sharpe training can underperform simple heuristics. VLSTM shows that a better architecture can improve gross performance and still lose after costs. The reduced DeePM-style ETF example shows that, in this test window, a structured allocator with the SoftMin objective improves Sharpe, drawdown, and crisis-window performance relative to its local controls.</p><p>End-to-end training is not a shortcut around portfolio-construction discipline. It is a way to move more of the trading problem into the learning objective. Once that happens, the validation burden grows. The 0.98 versus 0.69 DeePM comparison is evidence from one ETF test window; it still needs seed, cost, period, and ablation checks before it can support a deployment claim.</p><p>A learned allocator should be judged by a protocol tied to the failure modes above:</p><ul><li><p>Start with heuristic baselines. The softmax LSTM does not assign equal weight or inverse volatility to the ETF window.</p></li><li><p>Report gross and net performance. VLSTM&#8217;s zero-cost tie disappears at 5 bps one-way cost.</p></li><li><p>Show turnover and cost-stress curves. A cost-aware loss can still learn weights that are too expensive out-of-sample.</p></li><li><p>Slice regimes with a rule defined before looking at results. The DeePM example uses median SPY realized volatility.</p></li><li><p>Report seed sensitivity where the model class makes it material. Saly-Kaufmann&#8217;s reduced-seed check is part of the evidence, not a footnote.</p></li><li><p>Use ablations when the claim is architectural. DeePM&#8217;s paper-level result is more credible because the no-SoftMin, no-graph, and graph-only variants are visible.</p></li></ul><p>This is where Chapter 17&#8217;s workflow matters. Classical allocators remain the right default when signals, risk estimates, and constraints can be diagnosed cleanly. End-to-end allocators become more compelling when the objective is hard to factor into a forecast plus an optimizer: cost-aware sizing, regime robustness, or structured cross-asset interaction.</p><p>The practical takeaway from this line of work is not that deep learning beats portfolio heuristics. It is that portfolio-objective training can align the model with the economic target, but only if the architecture, cost model, and evaluation protocol are strong enough to carry that alignment out-of-sample.</p><p>The Chapter 17 examples show the experimental progression, not trading instructions. The implementation lesson is the same throughout: sequence information in, target weights out, with costs, volatility scaling, graph structure, and robust Sharpe treated as first-class parts of the model rather than afterthoughts. Direct portfolio learning is not a replacement for portfolio construction. It is portfolio construction moved into the model, which makes the modeling problem more aligned and harder to audit.</p>]]></content:encoded></item><item><title><![CDATA[AI Agents in Finance: A Reading List]]></title><description><![CDATA[What to read before building read-only financial agents that retrieve evidence, use tools, make forecasts, and leave audit trails.]]></description><link>https://insights.ml4trading.io/p/ai-agents-in-finance-a-reading-list</link><guid isPermaLink="false">https://insights.ml4trading.io/p/ai-agents-in-finance-a-reading-list</guid><dc:creator><![CDATA[Stefan Jansen]]></dc:creator><pubDate>Fri, 22 May 2026 13:11:05 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/18d3d935-4c80-43e3-a7d6-95b249af5011_1200x630.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The well-known <a href="https://github.com/dzyim/ilya-sutskever-recommended-reading">Sutskever/Carmack reading list</a> worked because it did not try to be an encyclopedia. It gave readers a path: learn these ideas, and a large part of modern deep learning becomes easier to understand.</p><p>This issue uses the same format for a narrower question: what should you read before building AI agents for financial research and forecasting?</p><p>The answer is not a list of agent frameworks or orchestration libraries. It starts earlier. Core agent design still involves search under limited computation, action under partial observation, tool validity, state, delegation, evaluation, and human supervision. Language models changed the substrate, but not the underlying control problem.</p><p><a href="https://ml4trading.io/third-edition/chapters/24_autonomous_agents/">Chapter 24 of </a><em><a href="https://ml4trading.io/third-edition/chapters/24_autonomous_agents/">Machine Learning for Trading</a></em> implements that view. It builds read-only research and forecasting agents that gather evidence, call tools, maintain state, produce probabilities, and leave artifacts that can be replayed, scored, and audited. More specifically, the chapter shows how to build the <a href="https://arxiv.org/abs/2511.07678">Bridgewater AIA Forecasting Agent</a> through to <a href="https://ml4trading.io/agent-lab/">live deployment</a>. </p><p>You can also learn how to build this in our <strong>new workshop</strong> on<a href="https://maven.com/stefan-jansen/forecasting-agents"> Building Multi-Agent Forecasting Systems</a>, which teaches how to engineer this particular agent harness and loop in one day.</p><p>In the chapter, an agent does not place trades. It calls market data APIs, searches for filings and news, retrieves documents, runs calculations, writes structured forecasts, and records what happened. The question is not whether a chatbot can sound like an analyst. The question is whether a workflow can produce useful decision-support artifacts that can be replayed, scored, and governed.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!czP7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8b0faa0-6536-408d-814a-a4a78a325541_2752x1536.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!czP7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8b0faa0-6536-408d-814a-a4a78a325541_2752x1536.jpeg 424w, https://substackcdn.com/image/fetch/$s_!czP7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8b0faa0-6536-408d-814a-a4a78a325541_2752x1536.jpeg 848w, https://substackcdn.com/image/fetch/$s_!czP7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8b0faa0-6536-408d-814a-a4a78a325541_2752x1536.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!czP7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8b0faa0-6536-408d-814a-a4a78a325541_2752x1536.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!czP7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8b0faa0-6536-408d-814a-a4a78a325541_2752x1536.jpeg" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a8b0faa0-6536-408d-814a-a4a78a325541_2752x1536.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:813,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:740968,&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://insights.ml4trading.io/i/198839659?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8b0faa0-6536-408d-814a-a4a78a325541_2752x1536.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_!czP7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8b0faa0-6536-408d-814a-a4a78a325541_2752x1536.jpeg 424w, https://substackcdn.com/image/fetch/$s_!czP7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8b0faa0-6536-408d-814a-a4a78a325541_2752x1536.jpeg 848w, https://substackcdn.com/image/fetch/$s_!czP7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8b0faa0-6536-408d-814a-a4a78a325541_2752x1536.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!czP7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8b0faa0-6536-408d-814a-a4a78a325541_2752x1536.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><p><em>Figure 1. Chapter 24 treats financial agents as read-only workflows over evidence, tools, memory, and audit artifacts. Order generation and execution require a separate layer of permissions, risk, and controls.</em></p><h2>What finance changes</h2><p>Finance turns a generic agent problem into a time-sensitive evidence problem. The system has to know what was knowable when, where a number came from, which tool produced it, and whether the evidence was available before the forecast or backtest decision.</p><p>Five constraints shape the reading path:</p><ul><li><p><strong>Time</strong>. Filings, prices, macro releases, transcripts, and news have timestamps. An agent must preserve cutoffs rather than mix past and future evidence.</p></li><li><p><strong>Provenance</strong>. Financial evidence is not interchangeable text. A model summary, an SEC filing, an exchange quote, and a scraped article carry different reliability and permission properties.</p></li><li><p><strong>Leakage</strong>. Evaluation can be contaminated by training data, revised data, benchmark overfitting, or hidden access to answers. Finance makes this more dangerous because small information leaks can appear to be forecasting skill.</p></li><li><p><strong>Calibration</strong>. Many outputs are probabilities, not prose. The evaluation question is not only whether the explanation sounds plausible, but whether the forecast is calibrated after resolution.</p></li><li><p><strong>Capital-at-risk boundaries</strong>. Research support, portfolio recommendation, order generation, and execution are different system classes. Chapter 24 stays on the research-support side of that boundary.</p></li></ul><h2>A core path for the long weekend</h2><p>Start with these core entries:</p><ol><li><p><a href="https://people.csail.mit.edu/lpk/papers/aij98-pomdp.pdf">Kaelbling, Littman, and Cassandra on POMDPs</a>: financial agents act from belief states, not complete market state.</p></li><li><p><a href="https://cdn.aaai.org/ICMAS/1995/ICMAS95-042.pdf">Rao and Georgeff on BDI agents</a>: beliefs, goals, intentions, and resource-bounded deliberation predate LLM wrappers.</p></li><li><p><a href="https://erichorvitz.com/chi99horvitz.pdf">Horvitz on mixed-initiative interfaces</a>: agents need rules for proceeding, asking, abstaining, and escalating.</p></li><li><p><a href="https://proceedings.neurips.cc/paper/2020/hash/6b493230205f780e1bc26945df7481e5-Abstract.html">Lewis et al. on retrieval-augmented generation</a>: finance needs external, updateable, provenance-bearing knowledge.</p></li><li><p><a href="https://arxiv.org/abs/2112.09332">WebGPT</a>: an early template for search, evidence collection, citation, and answer generation in one loop.</p></li><li><p><a href="https://arxiv.org/abs/2205.00445">MRKL Systems</a>: language models can route to tools, calculators, retrieval systems, and symbolic modules instead of internalizing every operation.</p></li><li><p><a href="https://arxiv.org/abs/2210.03629">ReAct</a>: reason-act-observe is a canonical starting pattern for evidence-grounded agents.</p></li><li><p><a href="https://arxiv.org/abs/2402.01030">CodeAct</a>: executable actions fit technical research workflows better than unconstrained prose.</p></li><li><p><a href="https://arxiv.org/abs/2407.01502">AI Agents That Matter</a>: agent evaluation has to include cost, reproducibility, holdouts, and benchmark overfitting.</p></li><li><p><a href="https://arxiv.org/abs/2406.13352">AgentDojo</a> and the <a href="https://genai.owasp.org/resource/owasp-top-10-for-llm-applications-2025/">OWASP Top 10 for LLM Applications 2025</a>: retrieved content and tool access create security problems that ordinary model benchmarks miss.</p></li><li><p><a href="https://arxiv.org/abs/2409.19839">ForecastBench</a> and <a href="https://arxiv.org/abs/2402.18563">Halawi et al. on language-model forecasting</a>: financial agents need leakage-aware forecasting evaluation, not just impressive rationales.</p></li><li><p><a href="https://arxiv.org/abs/2511.07678">AIA Forecaster</a>, <a href="https://arxiv.org/abs/2508.00828">Finance Agent Benchmark</a>, and <a href="https://arxiv.org/abs/2603.08262">FinToolBench</a>: together they show where agentic financial research works now and where the evidence remains thin.</p></li></ol><p>The rest of the issue gives the broader route. It is organized by design problem rather than by publication date.</p><p>The list deliberately excludes most framework documentation, product announcements, and &#8220;autonomous trading bot&#8221; papers. Frameworks matter in implementation, but they age quickly. The reading path below focuses on more durable design problems: state, tools, retrieval, partial observation, supervision, evaluation, security, forecasting, and governance. Execution agents and order-routing systems are also out of scope, as Chapter 24 remains on the research-support side of the capital-at-risk boundary.</p><h2>The old problems are still the hard problems</h2><p><strong><a href="https://archive.org/details/humanproblemsolv0000newe">Newell and Simon, </a></strong><em><strong><a href="https://archive.org/details/humanproblemsolv0000newe">Human Problem Solving</a></strong></em>. Newell and Simon frame intelligence as search through a structured problem space under bounded computation. That framing keeps the central object in view: not a fluent answer, but a process that moves through possible states, operators, and goals.</p><p><strong><a href="https://doi.org/10.1109/TSSC.1968.300136">Hart, Nilsson, and Raphael, &#8220;A Formal Basis for the Heuristic Determination of Minimum Cost Paths&#8221;</a></strong>. The A-star paper makes a point that still holds: search quality depends on how the system allocates its limited computational budget. LLM agents do not escape that constraint. They move it into prompt length, tool calls, branching, reranking, and supervisor passes.</p><p><strong><a href="https://cdn.aaai.org/ICMAS/1995/ICMAS95-042.pdf">Rao and Georgeff, &#8220;BDI Agents: From Theory to Practice&#8221;</a></strong>. BDI gives the literal pre-LLM agent vocabulary: beliefs, desires, and intentions. The vocabulary is older; the design problem remains current. A financial research agent needs a representation of what it believes, what it is trying to answer, which plan it is executing, when to reconsider, and what state must survive between steps.</p><p><strong><a href="https://people.csail.mit.edu/lpk/papers/aij98-pomdp.pdf">Kaelbling, Littman, and Cassandra, &#8220;Planning and Acting in Partially Observable Stochastic Domains&#8221;</a></strong>. Partial observability is central in finance. The agent never sees the full state of the market, the company, or the policy process. It sees filings, quotes, transcripts, news, and partial indicators. The paper makes explicit that agents act from belief states, not from truth.</p><p><strong><a href="https://www-anw.cs.umass.edu/~barto/courses/cs687/Sutton-Precup-Singh-AIJ99.pdf">Sutton, Precup, and Singh, &#8220;Between MDPs and Semi-MDPs: A Framework for Temporal Abstraction in Reinforcement Learning&#8221;</a></strong>. The options framework gives a theory of temporally extended actions. Modern systems call them tools, skills, routines, subagents, or workflows. The abstraction problem is the same: when should a multi-step behavior be treated as a single action, and which state must be preserved before and after it runs?</p><p><strong><a href="https://websites.nku.edu/~foxr/CSC425/hearsay2.pdf">Erman, Hayes-Roth, Lesser, and Reddy, &#8220;The Hearsay-II Speech-Understanding System&#8221;</a></strong>. Hearsay-II is the classic blackboard architecture: specialized components coordinate through a shared workspace. That pattern keeps returning in planner-executor-reviewer loops, multi-agent debate, research-agent ensembles, and supervisor reconciliation. The same architecture helps explain Chapter 24&#8217;s forecasting pipeline.</p><p><strong><a href="https://mitpress.mit.edu/9780262193160/telerobotics-automation-and-supervisory-control/">Sheridan, </a></strong><em><strong><a href="https://mitpress.mit.edu/9780262193160/telerobotics-automation-and-supervisory-control/">Telerobotics, Automation, and Supervisory Control</a></strong></em>. Sheridan treats autonomy as a control relationship rather than a marketing label. The practical questions are who monitors execution, when control is handed back, and what the human is expected to approve. Those questions apply directly when an agent&#8217;s output can influence capital allocation, research priorities, or a published forecast.</p><p><strong><a href="https://erichorvitz.com/chi99horvitz.pdf">Horvitz, &#8220;Principles of Mixed-Initiative User Interfaces&#8221;</a></strong>. Mixed initiative gives a concrete frame for human-agent work. A financial agent needs rules for when to proceed, when to ask for clarification, when to abstain, and when to escalate. This is not only a user-interface problem. It is part of the risk-control surface.</p><h2>The LLM-era primitives</h2><p><strong><a href="https://arxiv.org/abs/2201.11903">Wei et al., &#8220;Chain-of-Thought Prompting Elicits Reasoning in Large Language Models&#8221;</a></strong>. Chain-of-thought showed that eliciting intermediate reasoning can improve multi-step performance. Chapter 24 treats this as a control surface rather than an audit record. In financial agents, the auditable objects are tool calls, observations, state transitions, evidence records, prompts, model versions, policies, and scored outputs. Free-form reasoning text is not enough.</p><p><strong><a href="https://proceedings.neurips.cc/paper/2020/hash/6b493230205f780e1bc26945df7481e5-Abstract.html">Lewis et al., &#8220;Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks&#8221;</a></strong>. RAG is not an agent paper, but finance agents are retrieval-bound. The distinction between parametric memory and external, updateable, provenance-bearing knowledge matters for filings, transcripts, news, research notes, macro releases, and market data.</p><p><strong><a href="https://arxiv.org/abs/2112.09332">Nakano et al., &#8220;WebGPT: Browser-Assisted Question-Answering with Human Feedback&#8221;</a></strong>. WebGPT is an early modern template for a language model that searches, collects evidence, cites sources, and answers with the browser in the loop. For finance, this is the move from static model output to evidence acquisition. The model is no longer only producing text. It is choosing what evidence to retrieve before it answers.</p><p><strong><a href="https://arxiv.org/abs/2205.00445">Karpas et al., &#8220;MRKL Systems&#8221;</a></strong>. MRKL made modularity explicit. The language model routes among tools, symbolic modules, knowledge sources, and external calculators. Chapter 24 uses the same principle in a finance setting: deterministic calculations should be tools, retrieval should carry provenance, and the LLM should not pretend to internalize every operation.</p><p><strong><a href="https://arxiv.org/abs/2210.03629">Yao et al., &#8220;ReAct: Synergizing Reasoning and Acting in Language Models&#8221;</a></strong>. ReAct is a canonical starting pattern for evidence-grounded agents: reason, act, observe, repeat. In Chapter 24, the first notebook builds this loop with structured JSON decisions and trace capture. The trace ties stated reasoning to tool calls and observations. The hard audit evidence still consists of the tool invocation, observation, state transition, and stored source.</p><p><strong><a href="https://arxiv.org/abs/2305.10601">Yao et al., &#8220;Tree of Thoughts: Deliberate Problem Solving with Large Language Models&#8221;</a></strong> and <strong><a href="https://arxiv.org/abs/2303.11366">Shinn et al., &#8220;Reflexion: Language Agents with Verbal Reinforcement Learning&#8221;</a></strong>. Tree of Thoughts adds branching and scoring at decision points where premature commitment is costly. Reflexion records post-run lessons that can persist without updating model weights. In finance, both mechanisms need controls. A branch can help compare market hypotheses, and a lesson can improve future behavior. But both need validity horizons, provenance, and pruning rules. Otherwise, a temporary market condition becomes a persistent bias.</p><p><strong><a href="https://arxiv.org/abs/2305.16291">Wang et al., &#8220;Voyager: An Open-Ended Embodied Agent with Large Language Models&#8221;</a></strong>. Voyager is not a finance paper, but its skill-library idea maps well to research agents. A financial operator should not have to rediscover the same data-loading, feature-inspection, or backtest-diagnostic procedures every time. It needs a bounded skill corpus whose behavior can be inspected.</p><p><strong><a href="https://arxiv.org/abs/2402.01030">Wang et al., &#8220;Executable Code Actions Elicit Better LLM Agents&#8221;</a></strong>. CodeAct reframes action as executable code rather than fixed text or JSON. Technical research workflows involve many computational actions: querying a registry, reading a parquet file, computing an IC, running a backtest, or inspecting a result table. Chapter 24&#8217;s research operator follows this direction by providing the model with general tools and a skill corpus.</p><p><strong><a href="https://arxiv.org/abs/2405.15793">Yang et al., &#8220;SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering&#8221;</a></strong>. SWE-agent made the agent-computer interface a first-class variable. That lesson generalizes beyond software engineering. If the environment is hard to inspect, the state is hidden, the tools are poorly named, or errors are hard to recover from, the agent will fail due to interface issues even when the base model is strong.</p><h2>Evaluation and security are part of the system</h2><p><strong><a href="https://arxiv.org/abs/2407.01502">Kapoor et al., &#8220;AI Agents That Matter&#8221;</a></strong>. This paper anchors the evaluation section. It argues that accuracy alone is the wrong target because cost, reproducibility, holdout design, benchmark overfitting, and the needs of downstream developers decide whether an agent works in practice. Finance needs that discipline.</p><p><strong><a href="https://arxiv.org/abs/2308.03688">AgentBench</a>, <a href="https://arxiv.org/abs/2307.13854">WebArena</a>, <a href="https://arxiv.org/abs/2404.07972">OSWorld</a>, and <a href="https://arxiv.org/abs/2310.06770">SWE-bench</a></strong>. These benchmarks shifted evaluation from &#8220;does the model produce the right text?&#8221; to &#8220;can the system change an environment into the target state?&#8221; That shift fits agent evaluation, but it also creates new validity problems. An agent can satisfy a checker without doing the intended work, reading the hidden state, or exploiting the evaluation harness itself.</p><p><strong><a href="https://arxiv.org/abs/2406.13352">AgentDojo</a></strong>. AgentDojo turns indirect prompt injection into an environment problem. The agent must complete assigned work while treating retrieved content as untrusted. That model fits finance, where retrieved documents can contain adversarial instructions, speculative narratives, stale facts, or conflicting claims.</p><p><strong><a href="https://genai.owasp.org/resource/owasp-top-10-for-llm-applications-2025/">OWASP Top 10 for LLM Applications 2025</a></strong>. OWASP is not an agent paper, but tool-connected LLM systems create security failures that ordinary model evaluation misses. Chapter 24 turns this into engineering controls: least privilege, source allowlists, prompt-injection filters, policy proxies, and logged allow/deny decisions.</p><p>Two papers from May 2026 are recent stress tests, not settled references. <strong><a href="https://arxiv.org/abs/2605.17554">Evaluating Deep Research Agents on Expert Consulting Work</a></strong> assesses deep-research agents on structured analytical deliverables, using verifiers, rubrics, and cognitive traps. Reported acceptance rates are low across frontier systems. <strong><a href="https://arxiv.org/abs/2605.17526">SaaSBench</a></strong> tests long-horizon work in multi-component enterprise software and finds that many failures occur during setup, configuration, and integration before deep business logic is reached. The finance lesson is direct: agent failures are often system failures, not only reasoning failures.</p><h2>The finance branch</h2><p>The finance literature below falls into four groups: broad LLM-in-finance maps, financial-agent benchmarks, forecasting-agent systems, and portfolio or trading-agent architectures. Those are not the same system class. A research benchmark, a forecasting assistant, a portfolio-construction committee, and an execution agent require different evidence and controls.</p><p><strong><a href="https://doi.org/10.3905/jpm.2024.1.646">Kong et al., &#8220;Large Language Models for Financial and Investment Management&#8221;</a></strong>. Kong et al. provide a broad investment-management map: retrieval, domain-specific data, task decomposition, evaluation, and deployment constraints. The paper does not reduce finance to sentiment analysis or trading signals. It treats LLMs as part of a workflow that has to respect evidence, timing, and institutional constraints.</p><p><strong><a href="https://arxiv.org/abs/2508.00828">Finance Agent Benchmark</a></strong>. This benchmark adds a concrete constraint. It uses expert-authored financial research tasks that require recent SEC filings and an agentic harness with search and EDGAR access. The dataset has 537 questions across nine task categories. The best-reported model achieved 46.8 percent accuracy at an average cost of $3.79 per query. The evidence is concrete, costly, tool-based, and still limited.</p><p><strong><a href="https://arxiv.org/abs/2603.08262">Lu et al., &#8220;FinToolBench: Evaluating LLM Agents for Real-World Financial Tool Use&#8221;</a></strong>. Finance Agent Benchmark tests financial research tasks over filings and search. FinToolBench tests tool-using financial agents under runnable execution conditions. It pairs 760 executable financial tools with 295 tool-required queries and evaluates not only success, but also timeliness, intent restraint, and regulatory-domain alignment. That maps directly to Chapter 24&#8217;s view of agents as auditable workflows over tools, traces, and policy constraints.</p><p><strong><a href="https://arxiv.org/abs/2402.12659">Xie et al., &#8220;FinBen: A Holistic Financial Benchmark for Large Language Models&#8221;</a></strong>. FinBen is a checkpoint before discussing agents because it separates financial language tasks from numerical reasoning, forecasting, risk, and decision-making. Static benchmarks do not evaluate full agent behavior, but they reveal where base-model capabilities are thin before an agent loop adds tools, retrieval, and state.</p><p><strong><a href="https://arxiv.org/abs/2402.07862">Schoenegger et al., &#8220;AI-Augmented Predictions&#8221;</a></strong>. This paper serves as a bridge between general agents and forecasting. LLM assistants can improve human forecasting accuracy, but the improvement comes through a decision-support relationship, not full replacement. That is close to Chapter 24&#8217;s stance: agents gather and organize evidence, but the output still needs scoring, calibration, and supervision.</p><p><strong><a href="https://arxiv.org/abs/2409.19839">Karger et al., &#8220;ForecastBench&#8221;</a></strong>. ForecastBench evaluates future events whose answers are not known at submission time. That design directly targets leakage. It also keeps the evaluation unit clear: a probability on a resolvable question, not a compelling narrative about what may happen.</p><p><strong><a href="https://arxiv.org/abs/2402.18563">Halawi et al., &#8220;Approaching Human-Level Forecasting with Language Models&#8221;</a></strong>. Halawi et al. provide the methodological bridge to AIA Forecaster. The system searches for relevant information, generates forecasts, and aggregates predictions against human forecaster baselines. It treats forecasting agents as workflows for retrieval, aggregation, and evaluation.</p><p><strong><a href="https://arxiv.org/abs/2511.07678">Alur et al., &#8220;AIA Forecaster: Technical Report&#8221;</a></strong>. AIA Forecaster is the chapter&#8217;s central reference for the forecasting-agent implementation. It combines agentic search, independent forecasts, supervisor reconciliation, and statistical calibration. Its reported results cut both ways: expert-level performance on ForecastBench, weaker performance than market consensus on a harder prediction-market benchmark, and better results when combined with market consensus. That supports decision assistance, not a claim that an LLM forecasts on its own.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AGw2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf35986b-b9dd-455f-9e35-0af7299dd0db_2752x1536.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AGw2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf35986b-b9dd-455f-9e35-0af7299dd0db_2752x1536.jpeg 424w, https://substackcdn.com/image/fetch/$s_!AGw2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf35986b-b9dd-455f-9e35-0af7299dd0db_2752x1536.jpeg 848w, https://substackcdn.com/image/fetch/$s_!AGw2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf35986b-b9dd-455f-9e35-0af7299dd0db_2752x1536.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!AGw2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf35986b-b9dd-455f-9e35-0af7299dd0db_2752x1536.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AGw2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf35986b-b9dd-455f-9e35-0af7299dd0db_2752x1536.jpeg" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/af35986b-b9dd-455f-9e35-0af7299dd0db_2752x1536.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:813,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1784554,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://insights.ml4trading.io/i/198839659?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf35986b-b9dd-455f-9e35-0af7299dd0db_2752x1536.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_!AGw2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf35986b-b9dd-455f-9e35-0af7299dd0db_2752x1536.jpeg 424w, https://substackcdn.com/image/fetch/$s_!AGw2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf35986b-b9dd-455f-9e35-0af7299dd0db_2752x1536.jpeg 848w, https://substackcdn.com/image/fetch/$s_!AGw2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf35986b-b9dd-455f-9e35-0af7299dd0db_2752x1536.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!AGw2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf35986b-b9dd-455f-9e35-0af7299dd0db_2752x1536.jpeg 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><em>Figure 2. Chapter 24 implements forecasting as a supervised evidence workflow: specialists produce independent views, aggregation combines probabilities, debate surfaces contradictions, and the final artifact preserves probability, confidence, caveats, and audit evidence.</em></p><p><strong><a href="https://arxiv.org/abs/2311.13743">Yu et al., &#8220;FinMem: A Performance-Enhanced LLM Trading Agent with Layered Memory and Character Design&#8221;</a></strong> and <strong><a href="https://arxiv.org/abs/2407.06567">Yu et al., &#8220;FinCon: A Synthesized LLM Multi-Agent System with Conceptual Verbal Reinforcement&#8221;</a></strong>. These papers belong on the list as design references for memory and multi-agent financial decision systems. Treat them as architecture references, not as proof of deployable trading edge. They expose a design problem: when an agent stores lessons from prior decisions, which lessons are valid enough to persist, and which should be pruned before they become bias?</p><p><strong><a href="https://arxiv.org/abs/2508.11152">Zhao et al., &#8220;AlphaAgents: Large Language Model based Multi-Agents for Equity Portfolio Constructions&#8221;</a></strong> and <strong><a href="https://arxiv.org/abs/2604.02279">Ang, Azimbayev, and Kim, &#8220;The Self Driving Portfolio&#8221;</a></strong>. These papers move from research assistance toward portfolio construction. Chapter 24 reads them cautiously. Role-based analysts, peer critique, investment policy constraints, and supervisor combinations are useful architectural patterns. They do not remove the need for statistical evaluation, transaction-cost modeling, permissions, and operational controls.</p><p><strong><a href="https://arxiv.org/abs/2605.19337">Xia et al., &#8220;Agentic Trading: When LLM Agents Meet Financial Markets&#8221;</a></strong>. This May 2026 survey is best read as a methodological audit, not as a settled taxonomy. It maps 77 LLM-based trading-agent studies and finds that comparable evaluation remains weak: time-consistent splits, transaction-cost assumptions, universe construction, execution semantics, and reproducible artifacts are often missing. That supports Chapter 24&#8217;s conservative boundary: before financial agents influence capital, their evidence, timing, costs, and execution assumptions must be inspectable.</p><p><strong><a href="https://doi.org/10.3905/jpm.2025.1.778">Fabozzi and Lopez de Prado, &#8220;Implementing AI Foundation Models in Asset Management&#8221;</a></strong>. This paper anchors the governance thread. Prompts, retrieval corpora, model versions, and outputs become controlled artifacts once they affect asset management decisions. That is why Chapter 24 treats traces and replay as model-risk infrastructure, not just an engineering convenience.</p><p><strong><a href="https://papers.ssrn.com/abstract=5217505">Lopez-Lira, Tang, and Zhu, &#8220;The Memorization Problem&#8221;</a></strong>. Economic forecasting with LLMs has a contamination problem: a model may appear to forecast the past because it has absorbed realized outcomes during training. That makes pre-cutoff evaluation hard to interpret. Chapter 24&#8217;s answer is not to trust narrative claims of forecasting skill. It uses cutoff dates, time-shift tests, event windows, baselines, and post-resolution scoring.</p><p><strong><a href="https://arxiv.org/abs/2507.20957">Lee et al., &#8220;Your AI, Not Your View&#8221;</a></strong>. Lee et al. show that LLMs can carry systematic investment preferences and confirmation bias. Retrieval and tool use do not automatically remove latent model preferences. A financial agent needs stress tests that present the same evidence under different framings and check whether the conclusion changes for the wrong reason.</p>]]></content:encoded></item><item><title><![CDATA[How ML4T uses case studies to test strategies across markets]]></title><description><![CDATA[Nine case studies across seven asset classes, run under one research protocol.]]></description><link>https://insights.ml4trading.io/p/how-ml4t-uses-case-studies-to-test</link><guid isPermaLink="false">https://insights.ml4trading.io/p/how-ml4t-uses-case-studies-to-test</guid><dc:creator><![CDATA[Stefan Jansen]]></dc:creator><pubDate>Tue, 19 May 2026 13:18:16 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/8f062fe3-94bd-4727-b2c5-7854d3fc6185_1200x630.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The third edition of <em>Machine Learning for Trading</em> carries <a href="https://www.ml4trading.io/case-studies/">nine case studies:</a> ETFs, crypto perpetuals, NASDAQ-100 microstructure, S&amp;P 500 equity and option analytics, US firm characteristics, FX pairs, CME futures, direct S&amp;P 500 options, and a broad US equities panel.</p><p>That list matters because the studies are not decorative applications at the end of the book. They show how the same research process performs across different datasets and in very different markets and trading environments, and each includes around 20 notebooks from data sourcing to detailed performance analysis.</p><p>They cover different asset classes, frequencies, breadths, cost regimes, and execution problems. Some are monthly. Some are daily. One is intraday. Some are long-only ranking problems. Some are long-short cross-sectional problems. One is a delta-hedged options strategy.</p><p>Model choice rarely decides whether a strategy survives. Label design, cost regime, data construction, breadth, position sizing, and search discipline usually decide it.</p><p>That is what the case studies are built to show.</p><p>That comparison space is intentionally wide. A monthly ETF rotation process, an 8-hour crypto funding trade, a 15-minute NASDAQ-100 signal, a weekly futures ranking problem, and a delta-hedged options strategy do not put pressure on the same parts of the workflow. That is why the set is useful: each market makes a different failure mode visible.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Xk3Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F979f8369-04c9-4a48-8294-991f5ac9aaa5_2912x1440.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Xk3Z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F979f8369-04c9-4a48-8294-991f5ac9aaa5_2912x1440.png 424w, https://substackcdn.com/image/fetch/$s_!Xk3Z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F979f8369-04c9-4a48-8294-991f5ac9aaa5_2912x1440.png 848w, https://substackcdn.com/image/fetch/$s_!Xk3Z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F979f8369-04c9-4a48-8294-991f5ac9aaa5_2912x1440.png 1272w, https://substackcdn.com/image/fetch/$s_!Xk3Z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F979f8369-04c9-4a48-8294-991f5ac9aaa5_2912x1440.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Xk3Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F979f8369-04c9-4a48-8294-991f5ac9aaa5_2912x1440.png" width="1456" height="720" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/979f8369-04c9-4a48-8294-991f5ac9aaa5_2912x1440.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:720,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:218125,&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://insights.ml4trading.io/i/198401480?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F979f8369-04c9-4a48-8294-991f5ac9aaa5_2912x1440.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_!Xk3Z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F979f8369-04c9-4a48-8294-991f5ac9aaa5_2912x1440.png 424w, https://substackcdn.com/image/fetch/$s_!Xk3Z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F979f8369-04c9-4a48-8294-991f5ac9aaa5_2912x1440.png 848w, https://substackcdn.com/image/fetch/$s_!Xk3Z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F979f8369-04c9-4a48-8294-991f5ac9aaa5_2912x1440.png 1272w, https://substackcdn.com/image/fetch/$s_!Xk3Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F979f8369-04c9-4a48-8294-991f5ac9aaa5_2912x1440.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><em>Figure 1. The point of the set is not just breadth. It is that the same research process is exposed to very different markets, cadences, and execution constraints.</em></p><h2>What becomes comparable across nine very different markets</h2><p>Because the case studies are built on the same discipline, they make more than headline Sharpe ratios comparable. A 21-day ETF label, an 8-hour crypto label, a 5-day futures label, a 15-minute intraday equity label, and a return-to-expiry options label are not interchangeable prediction problems. They encode different holding periods, execution assumptions, and cost burdens.</p><p>The same goes for features and models. Some studies rely on traditional financial features such as momentum, carry, volatility, and the term structure. Others add model-based features such as HMM regimes, GARCH volatility, or forecast model outputs. The model set is also deliberately broad: linear baselines, gradient boosting, tabular deep learning, sequence models, latent-factor models, and, where the setup supports it, causal estimators.</p><p>Just as important, the book forces the post-prediction steps into view. Signals are converted into positions, run through explicit backtests, stress-tested under costs, modified by allocators and risk overlays, and then evaluated on a holdout set. Feature ICs are measured with heteroscedasticity- and autocorrelation-corrected standard errors. Screening uses false-discovery control. Backtests are read with probabilistic and deflated Sharpe analysis, bootstrap intervals, and search-accounting adjustments. The point is not just to report a number, but to say what that number does and does not justify.</p><p>That stack is why the case studies read as research rather than as examples.</p><h2>What changes once the workflow meets real markets</h2><p>In the firm-characteristics study, label treatment materially changes the result. The raw 1-month return label leaves the linear baseline at an IC of about -0.005, with a HAC interval that straddles zero. On the winsorized label, the same linear family moves to about +0.023 and clears zero on a thin margin. GBM is strong in both cases, around +0.080, which is the point: the large change came from label treatment, not from swapping ridge for a more expressive architecture.</p><p>In crypto perpetuals, the problem is different. On the primary 8-hr forward return regression label, only one family leader is clearly credible: NLinear at +0.0293 daily IC with a HAC 95% interval of [+0.0168, +0.0419]. GBM, linear, and TabM all straddle zero on that same primary label. But directional reframings recover the signal for other families. That is not a &#8220;deep learning wins&#8221; story. It is a label-and-market-structure story in a small sample with only 19 instruments and two folds.</p><p>In ETFs, the comparison is broad enough to separate prediction quality from strategy quality. The study compares all major model families across a large, liquid cross-asset panel. The editorial point here is not to crown a universal winner. It is to show that the family leader on validation IC need not be the leader once the signal is turned into a strategy. The prediction problem and the portfolio problem are related but not the same.</p><p>In the NASDAQ-100 microstructure, the signal can be statistically real yet economically fragile. The current rank-1 prediction has a daily IC of around +0.0054, with a HAC interval of [+0.0022, +0.0086], indicating positive directional alignment. But the holdout strategy Sharpe still flips negative, around -1.69, and the strategy trails the equal-weight holdout benchmark. That is a clean example of why &#8220;detected signal&#8221; and &#8220;deployable strategy&#8221; are not synonyms at intraday cadence.</p><p>S&amp;P 500 equity-plus-options analytics make a different point: options can be a useful source of information for stock prediction, but credible validation results still do not settle the execution and holdout questions.</p><p>And in direct S&amp;P 500 options, the cost problem becomes the case study. The workflow uses a dedicated hold-to-maturity cost cascade because standard basis point grids are the wrong abstraction for the instrument. Even there, the strategy analysis says no statistically resolved edge has been earned yet. That is a useful result. It shows what it looks like when the instrument pushes back hard enough that careful modeling is still not enough.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aUYT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecca1e4a-2540-4bf0-936d-e5e3a8d461e3_2752x1536.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aUYT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecca1e4a-2540-4bf0-936d-e5e3a8d461e3_2752x1536.png 424w, https://substackcdn.com/image/fetch/$s_!aUYT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecca1e4a-2540-4bf0-936d-e5e3a8d461e3_2752x1536.png 848w, https://substackcdn.com/image/fetch/$s_!aUYT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecca1e4a-2540-4bf0-936d-e5e3a8d461e3_2752x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!aUYT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecca1e4a-2540-4bf0-936d-e5e3a8d461e3_2752x1536.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aUYT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecca1e4a-2540-4bf0-936d-e5e3a8d461e3_2752x1536.png" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ecca1e4a-2540-4bf0-936d-e5e3a8d461e3_2752x1536.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:813,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:3319827,&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://insights.ml4trading.io/i/198401480?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecca1e4a-2540-4bf0-936d-e5e3a8d461e3_2752x1536.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_!aUYT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecca1e4a-2540-4bf0-936d-e5e3a8d461e3_2752x1536.png 424w, https://substackcdn.com/image/fetch/$s_!aUYT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecca1e4a-2540-4bf0-936d-e5e3a8d461e3_2752x1536.png 848w, https://substackcdn.com/image/fetch/$s_!aUYT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecca1e4a-2540-4bf0-936d-e5e3a8d461e3_2752x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!aUYT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecca1e4a-2540-4bf0-936d-e5e3a8d461e3_2752x1536.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><em>Figure 2. The same research stack repeats across all nine studies. That is what makes the differences interpretable rather than anecdotal.</em></p><h2>Why the case studies matter</h2><p>This is the real reason to read that part of the book closely.</p><p>The case studies do not just show that ML can be applied to many markets. They show how differently the same research stack behaves when the market changes.</p><p>Sometimes label engineering matters more than architecture. Sometimes costs decide the result. Sometimes breadth rescues a weak signal. Sometimes the prediction is credible, but the strategy is not. Sometimes the right conclusion is not to deploy, but to narrow the claim, change the horizon, or stop.</p><p>Because the trade definition, label design, model comparison, backtest, cost accounting, and holdout discipline are kept explicit, you can ask better questions when a strategy fails. Was the label wrong? Was the cross-section too narrow? Was the cost regime too severe? Did the signal survive validation but die in holdout? Did the apparent edge disappear once uncertainty and search adjustments were counted?</p><p>And those questions are not asked loosely. The workflow forces them through HAC IC, false-discovery control, probabilistic and deflated Sharpe, bootstrap uncertainty, and search-accounting discipline before a result is allowed to sound stronger than it is.</p><p>That is serious empirical work. And it is much closer to how real quant research feels than a neat parade of winning backtests.</p><p>Read that way, the nine case studies are not a tour of examples. They are part of the book where the whole argument is exposed to the market and forced to earn its claims.</p><h2>The ML4T library ecosystem, built to support the workflow</h2><p>The software stack behind that process is <a href="https://www.ml4trading.io/libraries/">documented</a>  on our website and is live on <a href="https://pypi.org/user/ml4t/">PyPI</a>:</p><ul><li><p><a href="https://github.com/ml4t/data">ML4T Data</a> handles multi-provider acquisition and point-in-time storage.</p></li><li><p><a href="https://github.com/ml4t/engineer">ML4T Engineer</a> builds features, labels, and alternative bars; </p></li><li><p><a href="https://github.com/ml4t/models">ML4T Models</a> adds finance-native latent-factor, SDF, direct-prediction, and portfolio-learning models; </p></li><li><p><a href="https://github.com/ml4t/diagnostic">ML4T Diagnostic</a> covers IC analysis, false-discovery control, Deflated Sharpe, Rademacher, PBO, CPCV, and tearsheets; and </p></li><li><p><a href="https://github.com/ml4t/backtest">ML4T Backtest</a> turns signals into event-driven strategy results with explicit execution, risk, and account rules. </p></li></ul><p>Together, they make the case studies reproducible rather than descriptive.</p>]]></content:encoded></item><item><title><![CDATA[Six libraries, one workflow]]></title><description><![CDATA[Six public libraries now cover the reusable parts of the ML4T workflow: data, features, domain-specific models, diagnostics, backtesting, and live trading.]]></description><link>https://insights.ml4trading.io/p/six-libraries-one-workflow</link><guid isPermaLink="false">https://insights.ml4trading.io/p/six-libraries-one-workflow</guid><dc:creator><![CDATA[Stefan Jansen]]></dc:creator><pubDate>Tue, 12 May 2026 16:03:59 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!izNK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fb7b029-0b9f-4509-aae6-b687f2a4f956_3200x1840.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A notebook can demonstrate a workflow. It rarely makes the workflow reusable. The harder problem is preserving the assumptions that make a result interpretable: data provenance, label construction, validation design, execution semantics, and deployment controls.</p><p>That is the change this spring. The ML4T workflow now has a <a href="http://ml4trading.io/libraries">public software layer </a>that readers can inspect and pressure-test, rather than reconstructing everything from scattered notebooks and chapter code.</p><p>Six libraries now carry the main parts of that loop:</p><ul><li><p><code>ml4t-data</code></p></li><li><p><code>ml4t-engineer</code></p></li><li><p><code>ml4t-models</code></p></li><li><p><code>ml4t-diagnostic</code></p></li><li><p><code>ml4t-backtest</code></p></li><li><p><code>ml4t-live</code></p></li></ul><p>The stack is not equally mature; most are in public beta, <code>ml4t-live</code> is still alpha, and <code>ml4t-models</code> is the most recent addition. Even so, the reusable layer is now concrete enough for readers to run, inspect, and break.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!izNK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fb7b029-0b9f-4509-aae6-b687f2a4f956_3200x1840.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!izNK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fb7b029-0b9f-4509-aae6-b687f2a4f956_3200x1840.png 424w, https://substackcdn.com/image/fetch/$s_!izNK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fb7b029-0b9f-4509-aae6-b687f2a4f956_3200x1840.png 848w, https://substackcdn.com/image/fetch/$s_!izNK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fb7b029-0b9f-4509-aae6-b687f2a4f956_3200x1840.png 1272w, https://substackcdn.com/image/fetch/$s_!izNK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fb7b029-0b9f-4509-aae6-b687f2a4f956_3200x1840.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!izNK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fb7b029-0b9f-4509-aae6-b687f2a4f956_3200x1840.png" width="1456" height="837" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4fb7b029-0b9f-4509-aae6-b687f2a4f956_3200x1840.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:837,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:182710,&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://insights.ml4trading.io/i/197367763?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fb7b029-0b9f-4509-aae6-b687f2a4f956_3200x1840.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_!izNK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fb7b029-0b9f-4509-aae6-b687f2a4f956_3200x1840.png 424w, https://substackcdn.com/image/fetch/$s_!izNK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fb7b029-0b9f-4509-aae6-b687f2a4f956_3200x1840.png 848w, https://substackcdn.com/image/fetch/$s_!izNK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fb7b029-0b9f-4509-aae6-b687f2a4f956_3200x1840.png 1272w, https://substackcdn.com/image/fetch/$s_!izNK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fb7b029-0b9f-4509-aae6-b687f2a4f956_3200x1840.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><em>The ML4T library ecosystem is a six-step research-to-production workflow: ml4t-data to ml4t-engineer to ml4t-models on the build path, then ml4t-diagnostic to ml4t-backtest to ml4t-live on the prove-and-deploy path, with an iterate-and-redeploy loop back to data.</em></p><h2>From teaching material to professional workflow</h2><p>The six libraries line up with the actual research and deployment sequence:</p><ul><li><p><code>ml4t-data</code> acquires, stores, and refreshes data</p></li><li><p><code>ml4t-engineer</code> builds features, labels, and leakage-safe training inputs</p></li><li><p><code>ml4t-models</code> packages finance-native model families and hands predictions downstream</p></li><li><p><code>ml4t-diagnostic</code> asks whether the signal survives statistical scrutiny</p></li><li><p><code>ml4t-backtest</code> simulates execution under explicit behavioral assumptions</p></li><li><p><code>ml4t-live</code> carries the same strategy surface into shadow, paper, and live operation</p></li></ul><p>That means a reader can now do something much more concrete than &#8220;learn the workflow.&#8221; They can pull a futures or equities panel with <code>ml4t-data</code>, construct features and targets with <code>ml4t-engineer</code>, train or score them with <code>ml4t-models</code>, test IC stability and multiple-testing risk with <code>ml4t-diagnostic</code>, simulate next-bar or quote-aware execution in <code>ml4t-backtest</code>, and then carry the same strategy surface into <code>ml4t-live</code> shadow mode. That is a more concrete workflow than another abstract essay about process.</p><h2>Build</h2><h3><code>ml4t-data</code></h3><p>Every quant workflow begins with data, and data engineering failures often stay invisible until they become expensive. <code>ml4t-data</code> is the acquisition, storage, and refresh layer for the rest of the workflow.</p><p>Its core abstraction is a <code>DataManager</code> that provides a single interface for fetching, storing, updating, and loading data across providers. Breadth matters: about 20 provider adapters spanning equities, crypto, futures, FX, macro series, prediction markets, and factor data.</p><p>The more important part is that the package treats data as an ongoing research asset rather than a one-off notebook download, with local Parquet storage, metadata-backed refresh workflows, gap detection, backfills, and validation in the same layer. That is why the futures and the commitment-of-traders (COT) modules matter. They solve recurring workflow problems that simple wrappers usually ignore: bulk futures ingestion, continuous contract construction, and a point-in-time combination of weekly positioning data with market series.</p><h3><code>ml4t-engineer</code></h3><p><code>ml4t-engineer</code> is where raw market data starts becoming something a model can learn from.</p><p>It includes <strong>120 features across 11 categories</strong>, as well as triple-barrier labeling, alternative bars, feature discovery, fractional differencing, preprocessing, and leakage-safe dataset-building utilities. The important design choice is that feature construction, label construction, and ML-ready dataset preparation are all in one package rather than scattered across custom scripts.</p><p>These steps are not independent. Triple-barrier labels, ATR-scaled barriers, volume and dollar bars, tick-imbalance bars, fractional differencing, registry-driven discovery, and train-only preprocessing all change the shape of the learning problem. Treating them as one layer is a workflow choice, not just an API choice.</p><p>The validation posture is also concrete. The library shows explicit validation against TA-Lib-compatible features and AFML-style labeling methods, which is the right kind of proof for software that sits directly between market data and model training.</p><h3><code>ml4t-models</code></h3><p><code>ml4t-models</code> is the newest and narrowest of the six, but it has a clear modeling point of view.</p><p>It starts from finance-native contracts: persistent panels, ragged cross-sections, portfolio sequences, structural factor extraction, stochastic discount factor learning, direct asset prediction, and end-to-end portfolio allocation.</p><p>The public surface is correspondingly specific. The library includes latent factor estimators such as PCA, <a href="https://www.sciencedirect.com/science/article/abs/pii/S1062940822001978">Risk-Premium PCA</a> (RPPCA), <a href="https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2983919">Instrumented PCA</a> (IPCA), and <a href="https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3335536">Conditional Autoencoder</a> (CAE) variants; a <a href="https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3350138">stochastic discount factor model</a>; a supervised autoencoder for direct asset prediction; and portfolio-learning models for linear, LSTM, and deeper allocation settings. It also includes helpers that pass predictions and weight frames to the backtest and diagnostic layers, rather than treating modeling as an isolated exercise.</p><h2>Prove and deploy</h2><h3><code>ml4t-diagnostic</code></h3><p><code>ml4t-diagnostic</code> is the part of the ML4T stack that asks the hardest question, last-mile research too often postpones: is there a real signal here, or just activity that looked convincing in the sample?</p><p>Its public surface leans into HAC-adjusted information coefficients, purged and combinatorial cross-validation, deflated Sharpe, false-discovery control, PBO, feature selection, structured backtest reporting, and template-based tearsheets.</p><p>Signal validation, statistical corrections, feature diagnostics, and backtest reporting live in one place. That makes it easier to separate prediction-quality problems from portfolio-translation problems and to ask whether an apparent result remains credible once multiple testing, autocorrelation, and leakage risks are accounted for honestly.</p><h3><code>ml4t-backtest</code></h3><p>Backtesting is crowded, which is one reason <code>ml4t-backtest</code> needs a clearer claim than &#8220;another framework.&#8221;</p><p>It is an event-driven simulator with explicit execution semantics and parity profiles that make comparisons meaningful rather than vague. The package emphasizes same-bar and next-bar execution modes, quote-aware fills, position-level and portfolio-level risk rules, and profiles spanning common frameworks, plus a conservative, realistic mode.</p><p>It also preserves inspectable artifacts after the run: fills, trades, portfolio state, predictions, and resolved config snapshots. That is what makes the bridge into <code>ml4t-diagnostic</code> reliable.</p><h3><code>ml4t-live</code></h3><p>Last but not least,<code> ml4t-live</code> is one of the more recent additions to the group.</p><p>It extends the workflow into a staged operation. The same <code>Strategy</code> interface is used in <code>ml4t-backtest</code> carries into live or shadow trading with broker adapters, feed adapters, safety controls, reconciliation, preflight checks, and execution journaling.</p><p><code>ml4t-live</code> is built around staged deployment: shadow mode first, then paper trading, then live operation with explicit controls around stale data, position limits, order limits, drawdown limits, and kill-switch persistence. That is a much more honest view of production than pretending a strategy is &#8220;deployed&#8221; once an API key works.</p><h2>Where to start</h2><p>The best starting point depends on the problem you already have.</p><p>If you need repeatable acquisition and updates:</p><ul><li><p><code>ml4t-data</code><a href="https://www.ml4trading.io/docs/data/getting-started/quickstart/"> quickstart</a></p></li><li><p><code>ml4t-data</code><a href="https://www.ml4trading.io/docs/data/providers/"> providers</a></p></li><li><p><code>ml4t-data</code><a href="https://www.ml4trading.io/docs/data/user-guide/incremental-updates/"> incremental updates</a></p></li></ul><p>If you already have data and need ML-ready features and labels:</p><ul><li><p><code>ml4t-engineer</code><a href="https://www.ml4trading.io/docs/engineer/getting-started/quickstart/"> quickstart</a></p></li><li><p><code>ml4t-engineer</code><a href="https://www.ml4trading.io/docs/engineer/user-guide/labeling/"> labeling guide</a></p></li><li><p><code>ml4t-engineer</code><a href="https://www.ml4trading.io/docs/engineer/user-guide/dataset-builder/"> dataset builder</a></p></li></ul><p>If you have signals and want to test credibility:</p><ul><li><p><code>ml4t-diagnostic</code><a href="https://www.ml4trading.io/docs/diagnostic/getting-started/quickstart/"> quickstart</a></p></li><li><p><code>ml4t-diagnostic</code><a href="https://www.ml4trading.io/docs/diagnostic/user-guide/workflows/"> workflows</a></p></li><li><p><code>ml4t-diagnostic</code><a href="https://www.ml4trading.io/docs/diagnostic/user-guide/statistical-tests/"> statistical tests</a></p></li><li><p><code>ml4t-diagnostic</code><a href="https://www.ml4trading.io/docs/diagnostic/user-guide/backtest-tearsheets/"> backtest tearsheets</a></p></li></ul><p>If you want to compare execution assumptions:</p><ul><li><p><code>ml4t-backtest</code><a href="https://www.ml4trading.io/docs/backtest/getting-started/quickstart/"> quickstart</a></p></li><li><p><code>ml4t-backtest</code><a href="https://www.ml4trading.io/docs/backtest/user-guide/profiles/"> profiles</a></p></li><li><p><code>ml4t-backtest</code><a href="https://www.ml4trading.io/docs/backtest/user-guide/execution-semantics/"> execution semantics</a></p></li></ul><p>If you want the safest path from backtest to production:</p><ul><li><p><code>ml4t-live</code><a href="https://www.ml4trading.io/docs/live/getting-started/quickstart/"> quickstart</a></p></li><li><p><code>ml4t-live</code><a href="https://www.ml4trading.io/docs/live/user-guide/risk/"> risk guide</a></p></li><li><p><code>ml4t-live</code><a href="https://www.ml4trading.io/docs/live/user-guide/examples/"> examples guide</a></p></li><li><p><code>ml4t-live</code><a href="https://www.ml4trading.io/docs/live/user-guide/operator-guide/"> operator guide</a></p></li></ul><p>If you want to inspect the finance-native model layer:</p><ul><li><p><code>ml4t-models</code><a href="https://www.ml4trading.io/docs/models/"> docs</a></p></li><li><p><code>ml4t-models</code><a href="https://www.ml4trading.io/docs/models/getting-started/quickstart/"> quickstart</a></p></li><li><p><code>ml4t/models</code><a href="https://github.com/ml4t/models"> repo</a></p></li></ul><p>I wanted to start this newsletter run with the libraries because they are the parts that readers can use immediately.</p><p>People in this field already know they need cleaner data pipelines, leak-aware feature work, honest validation, realistic execution, and safer production handoff. The question is whether those principles have been turned into reusable software with sufficient structure to improve how people actually work.</p><p>This issue maps the public software layer. Each library is large enough to deserve its own treatment later. For now, the job is simply to make that layer visible.</p><p>Useful feedback starts where these abstractions break against real workflows: provider gaps, labeling edge cases, diagnostics that need different assumptions, execution profiles that do not match a venue, or model contracts that fail on ragged panels.</p>]]></content:encoded></item><item><title><![CDATA[Nine case studies, one end-to-end workflow]]></title><description><![CDATA[Setup, labels, features, models, costs, risk &#8212; what the ML4T strategy research workflow does at every stage.]]></description><link>https://insights.ml4trading.io/p/nine-case-studies-one-end-to-end</link><guid isPermaLink="false">https://insights.ml4trading.io/p/nine-case-studies-one-end-to-end</guid><dc:creator><![CDATA[Stefan Jansen]]></dc:creator><pubDate>Tue, 05 May 2026 16:59:44 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/eb7c58b2-f698-4c1d-9fba-7b4982064af9_1200x630.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The early chapters of <em>Machine Learning for Trading</em>, 3rd edition, introduce a research workflow for systematic strategy development. Chapters 6 through 20 then apply it to nine case studies that span seven asset classes, five forecasting horizons, and frequencies from 8-hourly to monthly. The case studies are concrete, worked examples a reader can pick from &#8212; the one closest to your data, cadence, or asset class. This issue walks through what the workflow does at each stage, with pointers to where the libraries that support it are located.</p><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/FCKRK/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f407c497-db6d-41a9-9caa-bd5682e630d8_1220x1166.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5f0d75bc-633a-43b2-ba49-e3a9770928ab_1220x1290.png&quot;,&quot;height&quot;:658,&quot;title&quot;:&quot;Case studies at a glance&quot;,&quot;description&quot;:&quot;Nine case studies in chapters 6 to 20 of Machine Learning for Trading, 3rd edition.&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/FCKRK/1/" width="730" height="658" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><p>Each case has its own page at <a href="https://www.ml4trading.io/case-studies/">ml4trading.io/case-studies</a> with pipeline details, related chapters, and links to the GitHub code.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gQjh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadc7a327-61c5-4097-8144-4a12ed732caf_2720x1568.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gQjh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadc7a327-61c5-4097-8144-4a12ed732caf_2720x1568.jpeg 424w, https://substackcdn.com/image/fetch/$s_!gQjh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadc7a327-61c5-4097-8144-4a12ed732caf_2720x1568.jpeg 848w, https://substackcdn.com/image/fetch/$s_!gQjh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadc7a327-61c5-4097-8144-4a12ed732caf_2720x1568.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!gQjh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadc7a327-61c5-4097-8144-4a12ed732caf_2720x1568.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gQjh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadc7a327-61c5-4097-8144-4a12ed732caf_2720x1568.jpeg" width="1456" height="839" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/adc7a327-61c5-4097-8144-4a12ed732caf_2720x1568.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:839,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2439157,&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://insights.ml4trading.io/i/196556682?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadc7a327-61c5-4097-8144-4a12ed732caf_2720x1568.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_!gQjh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadc7a327-61c5-4097-8144-4a12ed732caf_2720x1568.jpeg 424w, https://substackcdn.com/image/fetch/$s_!gQjh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadc7a327-61c5-4097-8144-4a12ed732caf_2720x1568.jpeg 848w, https://substackcdn.com/image/fetch/$s_!gQjh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadc7a327-61c5-4097-8144-4a12ed732caf_2720x1568.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!gQjh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadc7a327-61c5-4097-8144-4a12ed732caf_2720x1568.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><p><em>The ML for Trading workflow that organizes the book &#8212; research loop above the evidence boundary, deployment below, and feedback closing the cycle.</em></p><h2>What the workflow does at each stage</h2><p><strong>Setup</strong> <em>(Chapter 6).</em> Each case begins with an explicit specification: the asset universe, the rebalance cadence, the train/validation/holdout split, the baseline checkpoints the case will measure itself against, and a search-accounting log that records every model trained &#8212; feature inputs, hyperparameters, fold-level metrics, and runtime artifacts. Chapter 6 argues for explicit search accounting as a guard against backtest overfitting: reproducibility is hard to recover once prior runs have disappeared from memory.</p><p><strong>Labels</strong> <em>(Chapter 7).</em> The label is the quantity the model is trained to predict; defining it is a modeling decision, not a downstream encoding of a separate target. Chapter 7 organizes labels into fixed-horizon and variable-horizon families. Fixed-horizon labels are evaluated at a predetermined offset: continuous forward returns over the trading horizon for regression, or discrete state codes &#8212; the sign of the return, a quantile bucket, or exceedance of a volatility-scaled threshold &#8212; for classification. Variable-horizon labels let the realized horizon depend on the path: trend-scanning labels expand the look-forward window until a trend test rejects, and triple-barrier labels resolve when one of a profit target, stop loss, or time limit binds first. Horizon and the instrument&#8217;s cost regime at that horizon constrain the choice &#8212; a 21-day forward return on monthly ETFs is a different estimation problem than an 8-hour funding-period return on crypto perpetuals. Label construction primitives, alternative bar samplers, and the overlap-aware sample-weighting they require are provided by <a href="https://github.com/ml4t/engineer">ml4t-engineer</a>.</p><p><strong>Features</strong> <em>(Chapter 8).</em> Engineered features come from <a href="https://github.com/ml4t/engineer">ml4t-engineer</a>: roughly 120 technical indicators across 11 categories &#8212; momentum, volatility, trend, volume, microstructure, and others &#8212; Polars-native and JIT-compiled, with around 60 cross-validated against TA-Lib. Where the asset structure supports them, alternative bar samplers (volume bars, dollar bars, tick-imbalance bars) replace fixed-time bars; microstructure features appear when intrabar data are available.</p><p><strong>Model-based features</strong> <em>(Chapter 9).</em> Features extracted from auxiliary statistical models fit per series, used to encode dynamics that engineered indicators capture only loosely: </p><ul><li><p>Kalman-filtered states and innovations, </p></li><li><p>spectral and path-signature coefficients, </p></li><li><p>ARIMA residuals, </p></li><li><p>GARCH and HAR/rough-volatility estimates, </p></li><li><p>HMM and Wasserstein regime posteriors, </p></li><li><p>fractional-differencing transforms for stationarity, and </p></li><li><p>uncertainty-aware variants of each. </p></li></ul><p>The distinction is mechanical rather than thematic &#8212; the feature is an estimated quantity from a fitted model, so its training-time and inference-time computation has to respect the same purged-walk-forward discipline as the prediction model that consumes it.</p><p><strong>Feature evaluation</strong> <em>(Chapter 7, second pass).</em> Before any model is trained, every feature is screened individually &#8212; daily cross-sectional information coefficient, ICIR, HAC-robust standard errors, walk-forward folds. Features that fail the triage screen do not silently carry forward into model training. The diagnostic machinery here lives in <a href="https://github.com/ml4t/diagnostic">ml4t-diagnostic</a>, which also provides the deflated Sharpe ratio, combinatorial purged cross-validation, and the multiple-testing corrections used downstream.</p><p><strong>Model families</strong> <em>(Chapters 11&#8211;15).</em> Each case runs the families that fit its data:</p><ul><li><p>regularized linear models (Chapter 11), </p></li><li><p>gradient-boosted trees and tabular deep learning (Chapter 12), </p></li><li><p>sequence deep learning, including LSTMs, TCNs, and transformers ( Chapter 13),</p></li><li><p>latent-factor models, including IPCA and a stochastic-discount-factor specification (Chapter 14), and </p></li><li><p>double machine learning for the cases where confounding is the open question (Chapter 15). </p></li></ul><p>The latent-factor and SDF estimators, together with a conditional-autoencoder model and several end-to-end portfolio-learning architectures, are packaged in <a href="https://github.com/ml4t/models">ml4t-models</a> &#8212; the most recent of the six libraries. Hyperparameter search and fold-level evaluation are uniform across families; comparability across cases comes from running the same protocol everywhere, not from picking a per-case favorite.</p><p><strong>Signal-stage backtest</strong> <em>(Chapter 16).</em> Predictions become positions through the backtester provided by <a href="https://github.com/ml4t/backtest">ml4t-backtest</a> &#8212; event-driven with point-in-time correctness, exit-first order processing matching real broker behavior, configurable same-bar or next-bar fills, and quote-aware execution that distinguishes bid, ask, and midpoint sources. The same code path runs the validation backtest and the frozen-holdout backtest, with no leakage between them.</p><p><strong>Portfolio construction</strong> <em>(Chapter 17).</em> Allocator choice is part of the experiment. Equal-weight long-short top-N is the baseline; risk parity, mean-variance with shrinkage, and robust-optimization variants run alongside where the universe supports them. End-to-end portfolio-learning models &#8212; where the allocator is itself learned rather than rule-based &#8212; are part of <a href="https://github.com/ml4t/models">ml4t-models</a>. The point is to isolate how much of any net result comes from the signal and how much comes from the allocator.</p><p><strong>Transaction costs</strong> <em>(Chapter 18).</em> Costs are modeled instrument-by-instrument and calibrated to the level a participant trading the case-study universe would incur, rather than a flat basis-point placeholder applied uniformly. Equity bid-ask half-spreads are derived from quote data with a bottom-quintile discipline; futures roll costs and continuous-contract artifacts are handled at the bar-construction level; FX uses interbank-spread approximations; option strategies use premium-scaled bid-asks sized to the round-trip; per-share commissions enter where the cadence makes them binding. Each case reports a sensitivity analysis at multiple cost levels &#8212; a single static cost assumption hides where the strategy actually breaks down. The cost machinery sits on the same execution layer as the backtester.</p><p><strong>Risk overlays</strong> <em>(Chapter 19).</em> Daily-loss caps, drawdown-triggered position cuts, position-size limits, and regime-aware sizing where the data supports an explicit regime layer. The overlays are applied as a separate pass over the cost-aware backtest output rather than fused into the signal stage. Keeping them separate preserves a useful diagnostic distinction: when a result disappoints, you can ask whether the signal had alpha that the cost regime erased, whether the risk overlay was the binding constraint, or whether the overlay never engaged at all.</p><p><strong>Cross-case analysis</strong> <em>(Chapter 20).</em> The synthesis appears in Chapter 20, which treats the nine cases as a single experiment rather than nine independent reports. It examines how well upstream feature-triage diagnostics predict downstream strategy survival, identifies, case by case, where prediction quality, portfolio translation, or execution friction is the binding constraint, and points to the lever each case suggests for the next research iteration. Detailed per-case numbers are the subject of upcoming issues.</p><h2>What&#8217;s coming</h2><p>Coming issues will move case-by-case &#8212; each case&#8217;s binding constraint, the iteration step the evidence suggests, what changed between research cycles, and the open questions left on the table. The cross-case synthesis from Chapter 20, individual stages worth a deep dive (feature triage, instrument-specific cost modeling, allocator comparison), and the methods themselves all have their own future issues queued up.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Vtgj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe84c1941-18a3-4248-9192-3f89d50b595a_2944x1440.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Vtgj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe84c1941-18a3-4248-9192-3f89d50b595a_2944x1440.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Vtgj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe84c1941-18a3-4248-9192-3f89d50b595a_2944x1440.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Vtgj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe84c1941-18a3-4248-9192-3f89d50b595a_2944x1440.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Vtgj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe84c1941-18a3-4248-9192-3f89d50b595a_2944x1440.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Vtgj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe84c1941-18a3-4248-9192-3f89d50b595a_2944x1440.jpeg" width="1456" height="712" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e84c1941-18a3-4248-9192-3f89d50b595a_2944x1440.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:712,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2651436,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://insights.ml4trading.io/i/196556682?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe84c1941-18a3-4248-9192-3f89d50b595a_2944x1440.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_!Vtgj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe84c1941-18a3-4248-9192-3f89d50b595a_2944x1440.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Vtgj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe84c1941-18a3-4248-9192-3f89d50b595a_2944x1440.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Vtgj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe84c1941-18a3-4248-9192-3f89d50b595a_2944x1440.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Vtgj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe84c1941-18a3-4248-9192-3f89d50b595a_2944x1440.jpeg 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><em>The research loop from Chapter 6, alongside the live-trading loop. The new case-study iteration agent runs inside the right-hand loop.</em></p><p>A <strong>new agent has also joined the research loop.</strong> It runs its own iterations on each case study &#8212; re-running setup decisions, refining the feature panel, adjusting cost assumptions and risk parameters, and proposing the next experiment to try. Whatever it surfaces worth reporting will land here.</p><p>Per-case detail lives at <a href="https://www.ml4trading.io/case-studies/">ml4trading.io/case-studies</a>. GitHub repo going live close to launch.</p>]]></content:encoded></item><item><title><![CDATA[Inside the Agent Lab]]></title><description><![CDATA[A live implementation of the AIA Forecaster paper, and what each pipeline stage actually does.]]></description><link>https://insights.ml4trading.io/p/inside-the-agent-lab</link><guid isPermaLink="false">https://insights.ml4trading.io/p/inside-the-agent-lab</guid><dc:creator><![CDATA[Stefan Jansen]]></dc:creator><pubDate>Fri, 01 May 2026 15:40:31 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!g4Sb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb7df520-1c9a-485a-80f6-e627f5435d63_2752x1536.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The <a href="https://ml4trading.io/agent-lab/">Agent Lab</a> currently assigns an 82% probability to the upper bound of the federal funds rate being above 3.00% after the April 2027 FOMC meeting. <a href="https://kalshi.com">Kalshi</a> trades the same question at 47%. On a different question &#8212; whether month-over-month core PCE inflation will print above 0.3% in April 2026 &#8212; the Lab is at 30%, and the market is at 51%, the disagreement running the other way.</p><p>The Agent Lab is our implementation of the <a href="https://doi.org/10.48550/arXiv.2511.07678">AIA Forecaster (Alur et al. 2025)</a> from Bridgewater AIA Labs &#8212; the multi-agent research pipeline, Chapter 24 of the third edition teaches end-to-end. It runs on live prediction-market questions, publishes a probability against each one, and persists every search result, agent trace, and intermediate aggregate to a database so that any run can be replayed against its original evidence.</p><p>This issue walks through what the Lab actually does. We are running it as a research experiment alongside the book, not as an institutional product, and the simplifications matter; we will name them as they come up.</p><h2>What you see on a question page</h2><p>The landing page lists featured questions across the US macro calendar &#8212; federal funds rate, core PCE, payrolls, and GDP. Each card shows the market price, the Lab&#8217;s forecast, a one-line agent-derived rationale, and a link to the full dossier.</p><p>The dossier is the part worth seeing. For a given question, it shows:</p><ul><li><p>The distribution of individual agent probabilities for that run.</p></li><li><p>The probability trajectory as new daily forecasts accumulate.</p></li><li><p>The pipeline arithmetic &#8212; agents in, mean probability out.</p></li><li><p>The supervisor&#8217;s synthesis of the evidence with citations to the sources that the agents actually retrieved.</p></li><li><p>Run ID, generation timestamp, the model used for that run, and the number of search calls.</p></li></ul><p>Every number is timestamped and attributable. This is the chapter&#8217;s position made operational: agents as engineering systems for evidence-rich decision support, with replayable traces rather than chat interfaces.</p><h2>From Chapter 24 to running code</h2><p>Chapter 24 walks the design space through ten notebooks: a ReAct loop, tool contracts and explicit state, a research agent, aggregation arithmetic, multi-agent research, adversarial debate, the full forecasting pipeline, and an evaluation/governance pass. The notebooks run deterministically in mock mode for teaching and CI, and switch to live providers and live search when the reader is ready.</p><p>The <code>aia-forecaster</code> repository (available at publication in June) takes the same architecture and runs it against live Kalshi and Polymarket questions. What the repo adds beyond the notebooks is the operational infrastructure: a SQLite run log with token-cost telemetry, market connectors with retry and filtering, an evaluation harness against historical resolutions, configuration profiles, and a scheduler for daily pull-and-forecast jobs.</p><h2>How a forecast is built</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!g4Sb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb7df520-1c9a-485a-80f6-e627f5435d63_2752x1536.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!g4Sb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb7df520-1c9a-485a-80f6-e627f5435d63_2752x1536.jpeg 424w, https://substackcdn.com/image/fetch/$s_!g4Sb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb7df520-1c9a-485a-80f6-e627f5435d63_2752x1536.jpeg 848w, https://substackcdn.com/image/fetch/$s_!g4Sb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb7df520-1c9a-485a-80f6-e627f5435d63_2752x1536.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!g4Sb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb7df520-1c9a-485a-80f6-e627f5435d63_2752x1536.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!g4Sb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb7df520-1c9a-485a-80f6-e627f5435d63_2752x1536.jpeg" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/db7df520-1c9a-485a-80f6-e627f5435d63_2752x1536.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:813,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1715541,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://insights.ml4trading.io/i/196124984?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb7df520-1c9a-485a-80f6-e627f5435d63_2752x1536.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_!g4Sb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb7df520-1c9a-485a-80f6-e627f5435d63_2752x1536.jpeg 424w, https://substackcdn.com/image/fetch/$s_!g4Sb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb7df520-1c9a-485a-80f6-e627f5435d63_2752x1536.jpeg 848w, https://substackcdn.com/image/fetch/$s_!g4Sb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb7df520-1c9a-485a-80f6-e627f5435d63_2752x1536.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!g4Sb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb7df520-1c9a-485a-80f6-e627f5435d63_2752x1536.jpeg 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><em>The AIA Forecaster pipeline &#8212; from market question to published probability.</em></p><p>For each market on each daily run, the Lab does the following:</p><ol><li><p><strong>Reword the question.</strong> Kalshi market titles are written for traders. The pipeline rewrites each one into a single explicit yes/no question that names the date, threshold, units, and resolution source. &#8220;Will the rate of core PCE inflation be above 0.3% in April 2026?&#8221; becomes the longer &#8220;Will the month-over-month percent change in core PCE be above 0.3% in April 2026, according to the Bureau of Economic Analysis?&#8221; The paper publishes this prompt verbatim in Appendix F. It does most of the work of preventing the units-and-time-frame mistakes a fast reader would make.</p></li><li><p><strong>Run the research agents.</strong> Three agents run a ReAct loop in parallel over a search tool. They are <em>identical</em>: same prompt, same temperature, no role specialization. Diversity comes from stochastic sampling, not from prescribed roles. Each agent returns a probability and the evidence chain that produced it. (The paper&#8217;s production configuration uses ten agents on a frontier model; we run three on an open-source model. More on that below.)</p></li><li><p><strong>Aggregate.</strong> The mean of the three agent probabilities is the ensemble forecast.</p></li><li><p><strong>Supervisor pass.</strong> A separate agent reviews the ensemble against the market price and the agents&#8217; rationales. It can override the ensemble &#8212; but only when its confidence in the override is explicitly high. Most of the time, it confirms.</p></li><li><p><strong>Persist.</strong> The rewritten question, the search results, every agent trace, the aggregate, and the supervisor&#8217;s synthesis all land in SQLite, keyed by a run ID. Any run is replayable with its evidence held constant.</p></li></ol><p>The point of step 5 is that nothing the Lab publishes is a black box. If a forecast looks wrong, the question is &#8220;which step produced it&#8221; &#8212; and the answer is in the database.</p><p>A note on two stages that look ordinary on the diagram but carry most of the system. </p><ol><li><p><strong>Search matters.</strong> On a batch of 64 live markets, the paper evaluates the same pipeline: Brier 0.1002 with search and 0.3609 without, worse than always predicting 50%, which mechanically scores 0.25. Each agent&#8217;s iterated search-and-reason loop is what produces the headline result. </p></li><li><p><strong>The supervisor is not a judge.</strong> The paper tested a simpler &#8220;best of M&#8221; supervisor that reads the agents&#8217; forecasts and picks the one it considers best, and it lost to the simple mean &#8212; selecting the worst of the M forecasts 7.2% of the time. The agentic supervisor&#8217;s gain comes specifically from running <em>new</em> searches to resolve disagreements, not from re-judging the existing answers. Naive verification underperforms averaging; only verification plus additional evidence beats it.</p></li></ol><h2>What the system is and is not</h2><p>A few honest caveats about the version visitors see today.</p><p><strong>Open-source model by default; three agents, not ten.</strong> The paper&#8217;s headline configuration runs ten agents per question on a frontier model. We run three agents on Qwen 3 (32 billion Parameters) &#8212; open-source, locally hosted, free at the margin &#8212; because a daily sweep on a frontier model with the full number of research agent iterations would cost on the order of $5/market/day. The price is paid in quality: an open-source model produces forecasts that illustrate how the pipeline works, not the numbers the paper produced - both web search and model quality matter materially. The same pipeline can run on Anthropic&#8217;s Sonnet &#8212; and we do occasionally use it for comparison sweeps &#8212; but the daily schedule uses Qwen.</p><p><strong>It is not built to beat the market.</strong> The paper&#8217;s headline result is that AIA Forecaster matches a human superforecaster panel on <a href="https://arxiv.org/abs/2409.19839">ForecastBench</a> &#8212; Brier score 0.075, statistically indistinguishable. On liquid prediction markets, the system <em>underperforms</em> the market consensus on its own. Instead, it produces independent information that improves on the consensus when combined with it. The paper formalizes this with a regression of resolution outcome on (market price, AIA forecast): even on the harder benchmark where AIA loses to consensus on its own, the optimal ensemble assigns roughly a third of its weight to the AIA forecasts, and the combined estimator beats either input alone. The Lab&#8217;s position is the same: a calibrated probability against each question, alongside the market price, not in place of it.</p><p><strong>Calibration is currently off.</strong> Language models trained with RLHF tend to hedge toward the middle of the probability scale: even when the evidence supports an extreme forecast, the raw probability tends to be timid. The paper&#8217;s correction is Platt scaling &#8212; a logistic transform applied to each forecast as it is produced. The transform has one coefficient, which the paper sets a priori to &#8730;3, a value drawn from the calibration literature (<a href="https://arxiv.org/abs/2111.03153">Neyman and Roughgarden, 2022</a>) rather than fitting it against the authors&#8217; own benchmarks &#8212; a choice they explicitly make to avoid overfitting. With only three agents and open-weight models, the risk for us cuts the other way: extremization can amplify a wrong-side-of-50% forecast into a confidently-wrong forecast. The recent prompt rebuild already produces appropriately confident outputs, so we run with calibration disabled for now.</p><p><strong>The forecasts move in both directions.</strong> On the Fed-rate questions in the opener, the Lab is well above the market. On core PCE, it is well below. The system is not built to take a contrarian view; it is built to produce an evidence-backed probability and let disagreement, in either direction, stand or fall in the face of resolution.</p><h2>Read a dossier</h2><p><a href="https://ml4trading.io/agent-lab/">Open the Agent Lab</a>, pick a question where the forecast and the market visibly disagree, and read the dossier end-to-end. The agent distribution, the trajectory, the supervisor&#8217;s synthesis, and the search citations are all there. The next Insights issue lands Tuesday.</p>]]></content:encoded></item><item><title><![CDATA[More than 27 chapters]]></title><description><![CDATA[How the five libraries, 112 primers, and 56 agent skills complement the 27 chapters.]]></description><link>https://insights.ml4trading.io/p/more-than-27-chapters</link><guid isPermaLink="false">https://insights.ml4trading.io/p/more-than-27-chapters</guid><dc:creator><![CDATA[Stefan Jansen]]></dc:creator><pubDate>Tue, 28 Apr 2026 14:06:11 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/7b2f07b7-11e8-4a55-b19b-8bd1415e62af_1200x630.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The third edition of <em>Machine Learning for Trading</em> ships with 27 chapters (and 400+ notebooks). It also ships with five open-source Python libraries, <a href="https://ml4trading.io/primer/">112 primer articles</a>, and <a href="https://ml4trading.io/skills/">56 agent skills</a> across nine categories. Issue 1 promised to unpack what the companion material does that the chapters alone cannot. This issue is part of that unpacking &#8212; two of the libraries in detail, plus a tour of the primer set. Skills and the agent layer that consumes them get their own treatment in forthcoming issues.</p><h2>Five libraries, one workflow</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jgfG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b0bc17-083d-4439-b113-975ac3337150_3200x1200.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jgfG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b0bc17-083d-4439-b113-975ac3337150_3200x1200.png 424w, https://substackcdn.com/image/fetch/$s_!jgfG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b0bc17-083d-4439-b113-975ac3337150_3200x1200.png 848w, https://substackcdn.com/image/fetch/$s_!jgfG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b0bc17-083d-4439-b113-975ac3337150_3200x1200.png 1272w, https://substackcdn.com/image/fetch/$s_!jgfG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b0bc17-083d-4439-b113-975ac3337150_3200x1200.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jgfG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b0bc17-083d-4439-b113-975ac3337150_3200x1200.png" width="1456" height="546" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/66b0bc17-083d-4439-b113-975ac3337150_3200x1200.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:546,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:122137,&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://insights.ml4trading.io/i/195746689?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b0bc17-083d-4439-b113-975ac3337150_3200x1200.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_!jgfG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b0bc17-083d-4439-b113-975ac3337150_3200x1200.png 424w, https://substackcdn.com/image/fetch/$s_!jgfG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b0bc17-083d-4439-b113-975ac3337150_3200x1200.png 848w, https://substackcdn.com/image/fetch/$s_!jgfG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b0bc17-083d-4439-b113-975ac3337150_3200x1200.png 1272w, https://substackcdn.com/image/fetch/$s_!jgfG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b0bc17-083d-4439-b113-975ac3337150_3200x1200.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>The five libraries trace the research-to-production path the book teaches: data acquisition, feature engineering, signal validation, strategy simulation and evaluation, and live deployment. Each library is finance-native &#8212; APIs, semantics, and data contracts tailored to the domain rather than borrowed from a generic ML stack. The chapters establish the methods. The library, its tests, and its validation harness ensure the methods are implemented correctly at scale.</p><p>This issue goes deeper into two areas: data management and the backtest-to-live pair.</p><h2><code>ml4t-data</code>: twenty providers, one interface</h2><p>Most ML-for-trading projects start by writing the same data layer. Ten different vendor SDKs with ten different schemas, ad-hoc CSVs that drift out of date, and a notebook full of one-off fetches that may or may not reproduce. <code>ml4t-data</code> provides the data layer that the project should not have to write.</p><p>A single <code>DataManager</code> unifies 20+ provider adapters behind one interface &#8212; the same <code>fetch</code>, <code>load</code>, and <code>update</code> calls regardless of source. Coverage spans 850,000 FRED economic series, 70+ global exchanges via Finnhub, 10,000+ cryptocurrencies via CoinGecko, prediction-market history from Kalshi and Polymarket, academic factor data (Fama-French, AQR), and Databento-backed futures for CME and ICE. Data is stored locally in Hive-partitioned Parquet with metadata tracking and is queryable directly with DuckDB or Polars. CLI commands handle incremental updates, gap detection, and validation against OHLC invariants and anomaly detectors.</p><p>The two modules where lookahead bias is most likely to enter quietly get dedicated treatment. The futures module builds continuous contracts with configurable roll logic for CME and ICE products. The COT (Commitment of Traders) module joins weekly CFTC positioning data to OHLCV under explicit point-in-time semantics &#8212; the join key is the release date, not the date the positions describe &#8212; so the model never sees a Tuesday&#8217;s positions before the Friday they were published.</p><h2><code>ml4t-backtest</code> &#8594; <code>ml4t-live</code>: the same strategy, twice</h2><p>The hardest move in the workflow is the move from a backtested strategy to a live one. The two environments share almost nothing by default &#8212; different data feeds, different fill semantics, different failure modes &#8212; and the bugs that survive the transition are the ones that erase paper-PnL the fastest. The backtest and live libraries are designed as a single system that cleanly crosses that boundary.</p><p><code>ml4t-backtest</code> is the simulation engine, and its headline claim is cross-framework parity. Behavioral profiles for Zipline, Backtrader, VectorBT, and LEAN set dozens of knobs to match each target framework exactly so that you can either reproduce the backtester you know, or the behavior of the broker you use. Validated on 250 assets over 20 years, the Zipline profile reproduces 226,723 trades with zero gap and a $10.30 value discrepancy on the final portfolio (0.0014%), running 8&#215; faster than the reference. The point of the parity work is to establish that the engine does what the standard implementations do, so the strategy author can stop worrying about the engine.</p><p><code>ml4t-live</code> takes the same <code>SignalStrategy</code> class, unmodified, into production. <code>SafeBroker</code> enforces 16 risk parameters &#8212; position limits, order limits, daily-loss caps, fat-finger rejection at &#177;5% from market, asset whitelisting. Shadow mode runs the strategy logic on live data without placing real orders, closing the gap between a passing backtest and a safe live deployment. The kill switch persists atomic JSON state, so a mid-run crash does not leave orphaned positions. The design constraint is zero-rewrite migration: the code that passed the backtest is the code that runs the broker.</p><h2>112 primers: a menu of choice</h2><p>The second edition carried its own prerequisites. Chapters had to stop and introduce hypothesis testing, linear regression, and basic time-series mechanics. That crowded out pages for the trading applications the book was actually about. The third edition moves that material into primers and gives the chapters back to trading.</p><p>The result is a menu for you to pick and choose from along two axes:</p><ol><li><p><strong>Level of preparation:</strong> 20 foundational primers, 66 intermediate, 26 advanced.</p></li><li><p><strong>Topic:</strong> 24 primers are cross-chapter, the other 88 provide background on or further expand on individual chapters: Ch 9 on model-based features has 11 primers, Ch 17 on portfolio construction has 8, Ch 14 on latent factors has 7.</p></li></ol><p>264 unique research citations back the set. A few primers to show the range:</p><ul><li><p><strong>&#8220;Volatility: Realized, Implied, and Why It Clusters&#8221;</strong> (Cross-chapter, foundational). Three distinct volatility objects &#8212; realized, implied, and conditional &#8212; and why they are not interchangeable. Square-root annualization explained. Volatility clustering as a potential regime marker, not an artifact of noisy estimation.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!KNMT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f8600bd-56c2-46b3-bb05-95f8da5a76ae_1784x881.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!KNMT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f8600bd-56c2-46b3-bb05-95f8da5a76ae_1784x881.png 424w, https://substackcdn.com/image/fetch/$s_!KNMT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f8600bd-56c2-46b3-bb05-95f8da5a76ae_1784x881.png 848w, https://substackcdn.com/image/fetch/$s_!KNMT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f8600bd-56c2-46b3-bb05-95f8da5a76ae_1784x881.png 1272w, https://substackcdn.com/image/fetch/$s_!KNMT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f8600bd-56c2-46b3-bb05-95f8da5a76ae_1784x881.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!KNMT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f8600bd-56c2-46b3-bb05-95f8da5a76ae_1784x881.png" width="1456" height="719" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5f8600bd-56c2-46b3-bb05-95f8da5a76ae_1784x881.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:719,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:98211,&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://insights.ml4trading.io/i/195746689?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f8600bd-56c2-46b3-bb05-95f8da5a76ae_1784x881.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_!KNMT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f8600bd-56c2-46b3-bb05-95f8da5a76ae_1784x881.png 424w, https://substackcdn.com/image/fetch/$s_!KNMT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f8600bd-56c2-46b3-bb05-95f8da5a76ae_1784x881.png 848w, https://substackcdn.com/image/fetch/$s_!KNMT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f8600bd-56c2-46b3-bb05-95f8da5a76ae_1784x881.png 1272w, https://substackcdn.com/image/fetch/$s_!KNMT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f8600bd-56c2-46b3-bb05-95f8da5a76ae_1784x881.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><em>SPY daily log returns and 20-day rolling annualized realized volatility, 2018&#8211;2024. Long calm stretches near 10&#8211;15% punctuated by short clusters &#8212; late 2018, the COVID spike to ~94%, the 2022 sell-off, and the 2023 banking episodes. Roughly 5% of days exceed 30% annualised volatility. From the primer <a href="https://ml4trading.io/primer/00/03-volatility/">&#8220;Volatility: Realized, Implied, and Why It Clusters&#8221;</a>.</em></p></li><li><p><strong>&#8220;Random Matrix Theory for PCA in Finance&#8221;</strong> (Ch 14, advanced). The Marchenko&#8211;Pastur law provides a null benchmark for the eigenvalue distribution of a sample covariance or correlation matrix in the absence of structure. In finance, eigenvalues that exceed the upper edge of the Marchenko&#8211;Pastur bulk (the range of eigenvalues that finite-sample estimation noise alone can generate) are often interpreted as candidate signal components, while eigenvalues inside the bulk are treated as noise-dominated. This gives a practical, though assumption-dependent, way to decide how many principal components to retain and motivates covariance cleaning and eigenvalue shrinkage methods.</p></li><li><p><strong>&#8220;Temporal-Difference Learning and Bellman Equations&#8221;</strong> (Ch 21, intermediate). The foundation for value-based RL methods used in applications such as execution and hedging includes the Bellman equations, value iteration, TD(0), the bias&#8211;variance trade-off relative to Monte Carlo estimation, and the transition from tabular control methods such as Q-learning and SARSA to neural variants such as DQN and Double DQN.</p></li></ul><h2>What&#8217;s next</h2><p>Friday&#8217;s issue opens the <a href="https://www.ml4trading.io/agent-lab/">Agent Lab</a> &#8212; our implementation of the multi-agent research pipeline based on Bridgewater&#8217;s <a href="https://arxiv.org/html/2511.07678v1">AIA Forecaster</a> that Chapter 24 teaches &#8212; running daily on live questions from Kalshi and Polymarket. The 56 agent skills and the agent layer that orchestrates the full research-to-production workflow will be included in a later issue.</p>]]></content:encoded></item><item><title><![CDATA[What changed in six years, and what didn't]]></title><description><![CDATA[A survey of what's new in the 3rd ed of ML for Trading &#8212; generative AI, autonomous agents, causal ML, nine case studies, five libraries &#8212; and what didn't change.]]></description><link>https://insights.ml4trading.io/p/what-changed-in-six-years</link><guid isPermaLink="false">https://insights.ml4trading.io/p/what-changed-in-six-years</guid><dc:creator><![CDATA[Stefan Jansen]]></dc:creator><pubDate>Fri, 24 Apr 2026 12:05:49 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/a3816396-52ae-4dee-8d21-4a84d0f87e84_1200x630.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The second edition of <em>Machine Learning for Trading</em> shipped on 31 July 2020. Two months earlier, OpenAI posted the GPT-3 paper to arXiv. The third edition ships in June 2026. The second edition added a few early deep-learning applications to the first (December 2018). The second-to-third gap is much larger because it covers some of the most consequential six years AI and ML have ever seen.</p><p>The field moved. Two questions the book tries to answer did not:</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://insights.ml4trading.io/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading ML for Trading Insights! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><ol><li><p>How to develop a trading strategy end-to-end; the book now includes nine case studies from equities and futures to ETFs, FX, and crypto, with holding periods from minutes to months.</p></li><li><p>How to evaluate a strategy without fooling yourself with a plausible-looking backtest; the new <a href="https://ml4trading.io/libraries/ml4t-diagnostic/">ml4t-diagnostic</a> library ships state-of-the-art overfitting guards &#8212; from the Deflated Sharpe ratio to the Rademacher Anti-Serum &#8212; and the chapters cover process discipline and the relevant tests in detail.</p></li></ol><h2>How the landscape changed</h2><p><strong>Generative AI and autonomous agents are rapidly becoming part of the research workflow.</strong> Three new chapters respond directly:</p><ol><li><p>Retrieval-augmented generation for financial research (Ch 22),</p></li><li><p>Knowledge graphs (Ch 23), and</p></li><li><p>Autonomous agents (Ch 24).</p></li></ol><p>Alongside these three, Chapter 10 compresses the second edition&#8217;s three NLP chapters &#8212; sentiment, topic modeling, word embeddings &#8212; into a single chapter organized around transformer-based embeddings as a pipeline stage. Topic modeling and word2vec mostly drop out.</p><p><strong>Deep learning diversified, then dispersed.</strong> The second edition had a dedicated six-chapter deep-learning part; the third has none. The deeper shift is that finance has begun to develop its own domain-specific architectures, from latent-factor models to end-to-end portfolio learning, rather than importing deep learning from other domains unchanged. The material now travels with the application it serves.</p><ul><li><p>GANs and diffusion models are used for synthetic data (Ch 5).</p></li><li><p>Transformers support the text feature pipeline (Ch 10).</p></li><li><p>Tabular DL sits alongside gradient boosting (Ch 12).</p></li><li><p>Sequence models land in Chapter 13. <a href="https://doi.org/10.1093/rfs/hhaa009">Gu, Kelly, and Xiu&#8217;s 2019 conditional autoencoder</a> and <a href="https://doi.org/10.48550/arXiv.1904.00745">Chen, Pelger, and Zhu&#8217;s 2021 deep-learning stochastic discount factor</a> anchor the latent-factor chapter (Ch 14).</p></li><li><p>End-to-end portfolio learning sits in Chapter 17.</p></li><li><p>Deep reinforcement learning, with three concrete applications &#8212; optimal execution, market making, and deep hedging &#8212; stays in Chapter 21.</p></li></ul><p><strong>Chapter 13 takes a deliberately skeptical view of deep learning for time series.</strong> Foundation models are harder to extract value from off the shelf on financial data than in other domains. The chapter&#8217;s cross-dataset rollup asks where deep learning actually lands on the curve when LSTMs, TCNs, attention variants, and a foundation model are run across the case-study datasets. Deep learning is a tool with specific strengths, not a blanket replacement.</p><p><strong>Three additions at the chapter and section levels.</strong> Causal analysis and conformal predictions have continued to gain importance:</p><ul><li><p>Causal machine learning (Ch 15) is a new chapter: Pearl-style identification, double ML for isolating factor effects, Bayesian structural time series, time-series causal discovery.</p></li><li><p>Conformal prediction is now a standard pipeline stage in Chapter 11, not an advanced topic.</p></li></ul><p>Both matter more now than at any earlier point because LLMs and agents have collapsed the cost of generating plausible-looking hypotheses, and the counterweight is formal robustness.</p><p>Chapter 9 adds a new perspective: ARIMA, GARCH, spectral, regime-switching, and Bayesian time-series models are treated as feature extractors for a downstream predictor rather than as standalone forecasters.</p><p><strong>Operational reality moved from the edges of the book to the center.</strong> From strategy implementation to deployment, details matter in practice:</p><ul><li><p>Chapter 18 is a dedicated chapter on transaction costs &#8212; taxonomy, microstructure-regime link, Almgren&#8211;Chriss as the unifying framework, and the guardrails for when costs kill a strategy.</p></li><li><p>Chapter 19 is dedicated to risk management &#8212; VaR and CVaR, path risk, stress testing, adaptive controls without leakage, and kill switches.</p></li><li><p>Chapter 25 covers live trading through Interactive Brokers, Alpaca, and QuantConnect.</p></li><li><p>Chapter 26 covers MLOps and governance.</p></li></ul><p>None of the four had a counterpart in the second edition. The backtrader and zipline backtesters have been replaced by <a href="https://ml4trading.io/libraries/ml4t-backtest/">ml4t-backtest</a>, and we also demonstrate vectorized alternatives like <a href="https://vectorbt.dev/">vectorBT</a>.</p><p><strong>Two foundation-level additions.</strong></p><ol><li><p>Market microstructure gets its own chapter (Ch 3): tick, volume, and dollar bars as information-driven sampling, limit-order-book reconstruction, continuous-futures construction.</p></li><li><p>Synthetic financial data moved from an advanced topic in 2E Chapter 21 to a foundation chapter (Ch 5), and broadened well beyond GANs to include Monte Carlo baselines, diffusion models, LLM-based structured-data synthesis, and an explicit fidelity&#8211;utility&#8211;privacy evaluation framework.</p></li></ol><p><strong>Data and infrastructure caught up.</strong> Polars replaces pandas across notebooks where the migration is worthwhile. Commercial data sources sit alongside free ones, because free data has become increasingly rare over the past six years, and has serious limitations. Crypto is more central, and platforms like Alpaca make it materially easier to move from research prototype to paper trading and then to small-scale live execution than it was in 2020. Prediction markets &#8212; Kalshi, Polymarket &#8212; appear to be a new research frontier.</p><h2>What didn&#8217;t change</h2><p>The constant is process discipline. If anything, the third edition gives it more weight than the second.</p><p><strong>Backtesting is one stage in a research pipeline, not the finish line.</strong> The book breaks the research-to-deployment arc into dedicated chapters rather than a single chapter on simulation. Chapter 16 is the simulation stage: the <a href="https://ml4trading.io/libraries/ml4t-backtest/">ml4t-backtest</a> library, event-driven and vectorized modes, walk-forward with purging and embargo. Chapter 17 is portfolio construction: equal-weight and risk parity as hard benchmarks, the Markowitz curse, hierarchical risk parity, regime-adaptive allocation without discrete switching, and end-to-end portfolio learning. Chapter 18 handles costs, Chapter 19 handles risk, and Chapter 20 synthesizes across the nine case studies &#8212; reporting what generalized, what didn&#8217;t, and what was deliberately left on the table.</p><p><strong>Statistical discipline is threaded through the chapters.</strong> The anchor papers are organizing content in Chapters 7, 11, 16, and 20:</p><ul><li><p>Deflated Sharpe ratio &#8212; <a href="https://doi.org/10.2139/ssrn.2460551">Bailey and L&#243;pez de Prado (2014)</a></p></li><li><p>Rademacher Anti-Serum &#8212; Paleologo (2025), <em>Elements of Quantitative Investing</em>, &#167;8.3</p></li><li><p>Purged, embargoed, and combinatorial cross-validation &#8212; L&#243;pez de Prado (2018), <em>Advances in Financial Machine Learning</em></p></li><li><p>Probability of Backtest Overfitting &#8212; <a href="https://doi.org/10.2139/ssrn.2326253">Bailey, Borwein, L&#243;pez de Prado, and Zhu (2015)</a></p></li><li><p>Multiple-testing corrections in factor research &#8212; <a href="https://doi.org/10.1093/rfs/hhv059">Harvey, Liu, and Zhu (2016)</a></p></li><li><p>Conformal prediction &#8212; the Vovk, Gammerman, and Shafer lineage</p></li></ul><p><strong>Hands-on implementation remains front and center, growing substantially in scope and scale.</strong> The third edition is built around <strong>nine case studies</strong> across asset classes and frequencies:</p><ul><li><p>ETFs</p></li><li><p>Broad US equities</p></li><li><p>US firm characteristics</p></li><li><p>NASDAQ-100 microstructure on minute-bar TAQ data</p></li><li><p>S&amp;P 500 equities joined with options analytics</p></li><li><p>S&amp;P 500 options as a volatility strategy</p></li><li><p>CME futures</p></li><li><p>FX majors</p></li><li><p>Crypto perpetuals, with funding as a structural signal</p></li></ul><p>Roughly 170 case-study notebooks carry each case through the same pipeline stages &#8212; setup, labels, features, model-based features, evaluation, linear, GBM, tabular DL, sequence DL, latent factors, causal, backtest, portfolio construction, costs, risk, synthesis. Cross-case rollups appear at the ends of the model chapters and in a dedicated synthesis chapter.</p><p>The second edition taught, model by model, on different datasets. The third edition teaches one pipeline across nine datasets, with explicit protocols for reporting across cases. The cross-case grid is the clearest pedagogical difference between the editions.</p><h2>More than &#8216;just a book&#8217;: 450+ notebooks, 100+ primers, 56 agent skills, and five libraries</h2><p>The third edition ships with roughly 450 notebooks, <a href="https://ml4trading.io/primer/">over one hundred primer articles</a>, <a href="https://ml4trading.io/skills/">56 agent skills</a> across nine categories (concepts, data, features, validation, backtest, portfolio, production, advanced AI, workflows), and five open-source Python libraries:</p><ol><li><p><a href="https://ml4trading.io/libraries/ml4t-data/">ml4t-data</a> &#8212; sourcing, validation, and point-in-time data pipelines.</p></li><li><p><a href="https://ml4trading.io/libraries/ml4t-engineer/">ml4t-engineer</a> &#8212; feature and label engineering with 120+ financial indicators.</p></li><li><p><a href="https://ml4trading.io/libraries/ml4t-diagnostic/">ml4t-diagnostic</a> &#8212; model evaluation, overfitting guards, and uncertainty quantification.</p></li><li><p><a href="https://ml4trading.io/libraries/ml4t-backtest/">ml4t-backtest</a> &#8212; event-driven and vectorized strategy simulation with walk-forward controls.</p></li><li><p><a href="https://ml4trading.io/libraries/ml4t-live/">ml4t-live</a> &#8212; broker adapters for live execution (Interactive Brokers, Alpaca, QuantConnect).</p></li></ol><p>The agent skills exist because coding agents increasingly participate in implementation. A skill encodes the canonical approach to a specific task &#8212; a walk-forward split with purging and embargo, a deflated Sharpe check on a set of backtests, a cost-sensitivity sweep &#8212; in a form a reader&#8217;s agent can consume without reinventing it. The book carries the argument; the skill shortens the distance between the argument and a correct implementation when an agent does the typing.</p><p>The <a href="https://ml4trading.io/agent-lab/">Agent Lab</a> on <a href="https://ml4trading.io">ml4trading.io</a> is our implementation of Bridgewater&#8217;s <a href="https://doi.org/10.48550/arXiv.2511.07678">AIA Forecaster</a> &#8212; the multi-agent research pipeline that Chapter 24 shows how to build. It publishes Platt-calibrated probabilities on live Kalshi and Polymarket questions.</p><h2>About <em>Insights</em></h2><p>This is Issue 1 of <em>Insights</em>, a twice-weekly letter running through the June launch and after. Each issue takes one claim from the book &#8212; a library, a primer article, an agent skill, a case study, or a new paper &#8212; and goes deeper than the book alone has room for. The next issue covers what the five libraries, the primer set, and the 56 skills do that 27 chapters alone cannot. The one after opens the Agent Lab.</p><p>If you subscribed to the second-edition list: welcome back.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://insights.ml4trading.io/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading ML for Trading Insights! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item></channel></rss>