{"track":"data-stories","examples":[{"id":"story-platform","track":"data-stories","title":"What is this platform made of?","summary":"A story told from the platform's own graph: the layers, the most connected things, who can reach what, and where the edge is looser than the handler. Five steps, every number computed from the routes, flows and tables.","principle":"story-grounded","also":["story-shape","story-caveats"],"tags":["data-stories","ontology","narrative","real data"],"evidence":["lib/bizont/story.ts (platformStory)","lib/bizont/build.ts (buildGraph)","lib/datastory/index.ts (checkStory)"],"body":{"kind":"story","story":{"id":"ontology-platform","title":"What this platform is made of","question":"Where is the platform most connected, and where is access looser than it looks?","steps":[{"id":"layers","role":"setup","heading":"What it is made of","facts":{"nodes":"840","edges":"927"},"takeaway":"840 things and 927 connections, in six layers: who acts, how work is done, where data lives, what it means, what can act or teach, and who may do what."},{"id":"hubs","role":"evidence","heading":"Where it is most connected","facts":{"top":"Motion","topN":"18","second":"/api/access/validate","secondN":"14"},"takeaway":"Motion is the most connected component, with 18 connections; next is /api/access/validate with 14. A change to either ripples furthest."},{"id":"tiers","role":"evidence","heading":"Who can reach what","facts":{"routes":"428","open":"336"},"takeaway":"428 routes and pages are classified by who may reach them; 336 are open to anyone at the edge."},{"id":"models","role":"complication","heading":"Where the edge is looser than it looks","facts":{"modelRoutes":"55","modelOpen":"47","looser":"192"},"takeaway":"55 routes call a model, and 47 of them are open at the edge. A further 192 public API routes have a handler that checks a session or more, so the edge is looser than the handler."},{"id":"next","role":"resolution","heading":"Where to look first","facts":{"modelOpen":"47","looser":"192","first":"/api/agent/repo"},"takeaway":"Start with the 47 open routes that call a model, beginning with /api/agent/repo: each needs a guard, a budget and a test. Then the 192 whose handler is stricter than the edge."}],"answer":"The platform is 840 things in six layers; Motion is the hub, and 47 open routes call a model.","caveats":["Tiers are what the edge enforces; a handler may check more, which is the point of the last two steps.","Connections are the edges the sources produce (flows, routes, migrations), not every call in the code."]},"spec":{"title":"What this platform is made of","description":"Where is the platform most connected, and where is access looser than it looks?","provenance":"data","state":{"layers":[{"layer":"Organization","things":19},{"layer":"Business processes","things":135},{"layer":"Data and interfaces","things":531},{"layer":"Business meaning","things":68},{"layer":"AI assets","things":82},{"layer":"Governance and runtime","things":5}],"hubs":[{"thing":"Motion","connections":18},{"thing":"/api/access/validate","connections":14},{"thing":"Ontology steward","connections":11},{"thing":"Research agent runner","connections":10},{"thing":"Generative UI","connections":10},{"thing":"/api/buddy","connections":9},{"thing":"Charts","connections":9},{"thing":"/api/access/session","connections":8}],"tiers":[{"tier":"public","routes":336},{"tier":"student","routes":48},{"tier":"professor","routes":9},{"tier":"admin","routes":35}],"models":[{"tier":"public","routes":47},{"tier":"student","routes":7},{"tier":"professor","routes":0},{"tier":"admin","routes":1}]},"root":{"type":"Page","children":[{"type":"Card","props":{"title":"What it is made of"},"children":[{"type":"Text","props":{"text":"840 things and 927 connections, in six layers: who acts, how work is done, where data lives, what it means, what can act or teach, and who may do what.","muted":false}},{"type":"Chart","props":{"title":"Things in each layer","mark":"bar","height":228,"horizontal":true,"data":{"$state":"/layers"},"encoding":{"x":{"field":"layer","type":"nominal","title":"Layer"},"y":{"field":"things","type":"quantitative","title":"Things"}}}}]},{"type":"Card","props":{"title":"Where it is most connected"},"children":[{"type":"Text","props":{"text":"Motion is the most connected component, with 18 connections; next is /api/access/validate with 14. A change to either ripples furthest.","muted":false}},{"type":"Chart","props":{"title":"Most connected things","mark":"bar","height":284,"horizontal":true,"data":{"$state":"/hubs"},"encoding":{"x":{"field":"thing","type":"nominal","title":"Thing"},"y":{"field":"connections","type":"quantitative","title":"Connections"}}}}]},{"type":"Card","props":{"title":"Who can reach what"},"children":[{"type":"Text","props":{"text":"428 routes and pages are classified by who may reach them; 336 are open to anyone at the edge.","muted":false}},{"type":"Chart","props":{"title":"Routes and pages by access tier","mark":"bar","height":180,"data":{"$state":"/tiers"},"encoding":{"x":{"field":"tier","type":"nominal","title":"Tier at the edge"},"y":{"field":"routes","type":"quantitative","title":"Routes"}}}}]},{"type":"Card","props":{"title":"Where the edge is looser than it looks"},"children":[{"type":"Text","props":{"text":"55 routes call a model, and 47 of them are open at the edge. A further 192 public API routes have a handler that checks a session or more, so the edge is looser than the handler.","muted":false}},{"type":"Chart","props":{"title":"Routes that call a model, by access tier","mark":"bar","height":180,"data":{"$state":"/models"},"encoding":{"x":{"field":"tier","type":"nominal","title":"Tier at the edge"},"y":{"field":"routes","type":"quantitative","title":"Routes that call a model"}}}}]},{"type":"Card","props":{"title":"Where to look first"},"children":[{"type":"Text","props":{"text":"Start with the 47 open routes that call a model, beginning with /api/agent/repo: each needs a guard, a budget and a test. Then the 192 whose handler is stricter than the edge.","muted":false}}]},{"type":"Callout","props":{"variant":"success","title":"The answer","body":"The platform is 840 things in six layers; Motion is the hub, and 47 open routes call a model."}},{"type":"Callout","props":{"variant":"warning","title":"What this cannot tell you","body":"Tiers are what the edge enforces; a handler may check more, which is the point of the last two steps. Connections are the edges the sources produce (flows, routes, migrations), not every call in the code."}}]}}}},{"id":"story-change","track":"data-stories","title":"What happens if we change a busy route?","summary":"The same graph, asked a different question: who depends on the best-connected route that a flow walks through, which flows walk through it, what it shares with others, and what to re-run. It works for any node the graph has.","principle":"story-shape","also":["story-grounded"],"tags":["data-stories","ontology","impact","narrative","real data"],"evidence":["lib/bizont/story.ts (changeStory)","lib/bizont/analysis.ts (impact)"],"body":{"kind":"story","story":{"id":"ontology-change-endpoint:api_access_validate","title":"Changing /api/access/validate","question":"What happens if we change /api/access/validate?","steps":[{"id":"direct","role":"setup","heading":"What it touches directly","facts":{"node":"/api/access/validate","direct":"14","kind":"Endpoint"},"takeaway":"/api/access/validate is an endpoint in the data layer with 14 direct connections."},{"id":"dependents","role":"evidence","heading":"Who depends on it","facts":{"total":"26","layers":"1","node":"/api/access/validate"},"takeaway":"If /api/access/validate changes, 26 things depend on it, across 1 layer."},{"id":"processes","role":"evidence","heading":"Which flows walk through it","facts":{"processes":"13","steps":"13"},"takeaway":"13 flows walk through it, using it in 13 steps."},{"id":"shared","role":"complication","heading":"What it shares with others","facts":{"hub":"Tier: public","hubN":"340","relies":"5"},"takeaway":"It relies on 5 things, and its busiest neighbor, Tier: public, has 340 connections of its own, so a change there reaches the others too."},{"id":"rerun","role":"resolution","heading":"What to re-run","facts":{"flows":"guest-to-portfolio adaptive-quiz buddy-practice spec-studio admin-flags-routes admin-publish-lecture agent-boundaries cross-platform-build spec-to-app ide-review demo-student-tour demo-professor-tour presentation-stage","count":"13","direct":"14","dependents":"26"},"takeaway":"Before changing it, re-run 13 flows: pnpm flow guest-to-portfolio, pnpm flow adaptive-quiz, pnpm flow buddy-practice, pnpm flow spec-studio, pnpm flow admin-flags-routes, pnpm flow admin-publish-lecture, pnpm flow agent-boundaries, pnpm flow cross-platform-build, pnpm flow spec-to-app, pnpm flow ide-review, pnpm flow demo-student-tour, pnpm flow demo-professor-tour, pnpm flow presentation-stage."}],"answer":"26 things depend on /api/access/validate; 13 flows should be re-run.","caveats":["Dependence follows the edges in the graph; code that reaches a thing without a recorded edge is not shown.","A flow is re-run by name here; whether it covers the exact line you change is for you to judge."]},"spec":{"title":"Changing /api/access/validate","description":"What happens if we change /api/access/validate?","provenance":"data","state":{"direct":[{"connection":"GUARDED_BY out","count":1},{"connection":"CALLS in","count":13}],"dependents":[{"layer":"Business processes","things":26}],"processes":[{"flow":"guest-to-portfolio","steps":1},{"flow":"adaptive-quiz","steps":1},{"flow":"buddy-practice","steps":1},{"flow":"spec-studio","steps":1},{"flow":"admin-flags-routes","steps":1},{"flow":"admin-publish-lecture","steps":1},{"flow":"agent-boundaries","steps":1},{"flow":"cross-platform-build","steps":1},{"flow":"spec-to-app","steps":1},{"flow":"ide-review","steps":1},{"flow":"demo-student-tour","steps":1},{"flow":"demo-professor-tour","steps":1},{"flow":"presentation-stage","steps":1}],"shared":[{"kind":"Role","things":4},{"kind":"Endpoint","things":336}]},"root":{"type":"Page","children":[{"type":"Card","props":{"title":"What it touches directly"},"children":[{"type":"Text","props":{"text":"/api/access/validate is an endpoint in the data layer with 14 direct connections.","muted":false}},{"type":"Chart","props":{"title":"Direct connections by kind","mark":"bar","height":180,"horizontal":true,"data":{"$state":"/direct"},"encoding":{"x":{"field":"connection","type":"nominal","title":"Connection"},"y":{"field":"count","type":"quantitative","title":"Count"}}}}]},{"type":"Card","props":{"title":"Who depends on it"},"children":[{"type":"Text","props":{"text":"If /api/access/validate changes, 26 things depend on it, across 1 layer.","muted":false}},{"type":"Chart","props":{"title":"Things that depend on it, by layer","mark":"bar","height":180,"data":{"$state":"/dependents"},"encoding":{"x":{"field":"layer","type":"nominal","title":"Layer"},"y":{"field":"things","type":"quantitative","title":"Things"}}}}]},{"type":"Card","props":{"title":"Which flows walk through it"},"children":[{"type":"Text","props":{"text":"13 flows walk through it, using it in 13 steps.","muted":false}},{"type":"Chart","props":{"title":"Steps that use it, by flow","mark":"bar","height":424,"horizontal":true,"data":{"$state":"/processes"},"encoding":{"x":{"field":"flow","type":"nominal","title":"Flow"},"y":{"field":"steps","type":"quantitative","title":"Steps"}}}}]},{"type":"Card","props":{"title":"What it shares with others"},"children":[{"type":"Text","props":{"text":"It relies on 5 things, and its busiest neighbor, Tier: public, has 340 connections of its own, so a change there reaches the others too.","muted":false}},{"type":"Chart","props":{"title":"What is connected to Tier: public","mark":"bar","height":180,"data":{"$state":"/shared"},"encoding":{"x":{"field":"kind","type":"nominal","title":"Kind"},"y":{"field":"things","type":"quantitative","title":"Things"}}}}]},{"type":"Card","props":{"title":"What to re-run"},"children":[{"type":"Text","props":{"text":"Before changing it, re-run 13 flows: pnpm flow guest-to-portfolio, pnpm flow adaptive-quiz, pnpm flow buddy-practice, pnpm flow spec-studio, pnpm flow admin-flags-routes, pnpm flow admin-publish-lecture, pnpm flow agent-boundaries, pnpm flow cross-platform-build, pnpm flow spec-to-app, pnpm flow ide-review, pnpm flow demo-student-tour, pnpm flow demo-professor-tour, pnpm flow presentation-stage.","muted":false}}]},{"type":"Callout","props":{"variant":"success","title":"The answer","body":"26 things depend on /api/access/validate; 13 flows should be re-run."}},{"type":"Callout","props":{"variant":"warning","title":"What this cannot tell you","body":"Dependence follows the edges in the graph; code that reaches a thing without a recorded edge is not shown. A flow is re-run by name here; whether it covers the exact line you change is for you to judge."}}]}}}},{"id":"story-learning","track":"data-stories","title":"Where do learners get stuck?","summary":"Setup, evidence, a complication, then what to do: five steps, each a chart and one sentence, every number computed.","principle":"story-shape","also":["story-caveats"],"tags":["data-stories","learning","narrative"],"evidence":["lib/datastory/index.ts (checkStory, storySpec)","lib/codebuddy/core.ts"],"body":{"kind":"story","story":{"id":"where-learners-stick","title":"Where do learners get stuck?","question":"Which concept do learners find hardest, and what helps?","steps":[{"id":"class","role":"setup","heading":"Sixty learners, six concepts","facts":{"learners":"60","concepts":"6","attempts":"4","answers":"1440"},"takeaway":"60 learners answered 4 questions on each of 6 concepts: 1440 answers. Where did they get stuck?"},{"id":"weakest","role":"evidence","heading":"Recursion is where they struggle","facts":{"weakest":"Recursion","weakestRate":"43%","strongest":"Variables","strongestRate":"83%"},"takeaway":"Recursion is answered correctly 43% of the time, against 83% for Variables. It is the one to look at."},{"id":"practice","role":"evidence","heading":"Does practice help?","facts":{"first":"32%","last":"48%","concept":"Recursion"},"takeaway":"On Recursion the share correct rises from 32% on the first attempt to 48% on the last."},{"id":"hints","role":"complication","heading":"And a hint?","facts":{"hinted":"59%","unhinted":"32%","concept":"Recursion"},"takeaway":"With a hint, Recursion is answered correctly 59% of the time; without, 32%. A hint helps, but it also means the answer was not entirely the learner's own, so it is credited less."},{"id":"next","role":"resolution","heading":"What to do next","facts":{"concept":"Recursion"},"takeaway":"Spend the next session on Recursion: start with unhinted practice questions, and bring in hints only after a first try."}],"answer":"Recursion is the hardest concept, practice and hints both help, and the next session should target it.","caveats":["The quiz results are simulated from a simple model of ability and difficulty, so the pattern is known to be there.","With real learners, check the sample is large enough and that questions on one concept are comparable before acting."]},"spec":{"title":"Where do learners get stuck?","description":"Which concept do learners find hardest, and what helps?","provenance":"data","state":{"class":[{"concept":"Recursion","correct":43},{"concept":"Error handling","correct":55},{"concept":"Functions","correct":64},{"concept":"Loops","correct":67},{"concept":"Testing","correct":67},{"concept":"Variables","correct":83}],"weakest":[{"concept":"Recursion","correct":43},{"concept":"Variables","correct":83}],"practice":[{"attempt":1,"correct":32},{"attempt":2,"correct":43},{"attempt":3,"correct":48},{"attempt":4,"correct":48}],"hints":[{"answer":"Without a hint","correct":32},{"answer":"With a hint","correct":59}]},"root":{"type":"Page","children":[{"type":"Card","props":{"title":"Sixty learners, six concepts"},"children":[{"type":"Text","props":{"text":"60 learners answered 4 questions on each of 6 concepts: 1440 answers. Where did they get stuck?","muted":false}},{"type":"Chart","props":{"title":"Share of answers correct, by concept","mark":"bar","horizontal":true,"height":240,"sort":"-y","data":{"$state":"/class"},"encoding":{"x":{"field":"concept","type":"nominal","title":"Concept"},"y":{"field":"correct","type":"quantitative","title":"Correct (%)","domain":[0,100]}}}}]},{"type":"Card","props":{"title":"Recursion is where they struggle"},"children":[{"type":"Text","props":{"text":"Recursion is answered correctly 43% of the time, against 83% for Variables. It is the one to look at.","muted":false}},{"type":"Chart","props":{"title":"Weakest and strongest concept: share correct","mark":"bar","height":180,"data":{"$state":"/weakest"},"encoding":{"x":{"field":"concept","type":"nominal","title":"Concept"},"y":{"field":"correct","type":"quantitative","title":"Correct (%)","domain":[0,100]}}}}]},{"type":"Card","props":{"title":"Does practice help?"},"children":[{"type":"Text","props":{"text":"On Recursion the share correct rises from 32% on the first attempt to 48% on the last.","muted":false}},{"type":"Chart","props":{"title":"Recursion: share correct by attempt","mark":"line","height":200,"data":{"$state":"/practice"},"encoding":{"x":{"field":"attempt","type":"quantitative","title":"Attempt"},"y":{"field":"correct","type":"quantitative","title":"Correct (%)","domain":[0,100]}}}}]},{"type":"Card","props":{"title":"And a hint?"},"children":[{"type":"Text","props":{"text":"With a hint, Recursion is answered correctly 59% of the time; without, 32%. A hint helps, but it also means the answer was not entirely the learner's own, so it is credited less.","muted":false}},{"type":"Chart","props":{"title":"Recursion: share correct, with and without a hint","mark":"bar","height":200,"data":{"$state":"/hints"},"encoding":{"x":{"field":"answer","type":"nominal","title":"Answer"},"y":{"field":"correct","type":"quantitative","title":"Correct (%)","domain":[0,100]}}}}]},{"type":"Card","props":{"title":"What to do next"},"children":[{"type":"Text","props":{"text":"Spend the next session on Recursion: start with unhinted practice questions, and bring in hints only after a first try.","muted":false}}]},{"type":"Callout","props":{"variant":"success","title":"The answer","body":"Recursion is the hardest concept, practice and hints both help, and the next session should target it."}},{"type":"Callout","props":{"variant":"warning","title":"What this cannot tell you","body":"The quiz results are simulated from a simple model of ability and difficulty, so the pattern is known to be there. With real learners, check the sample is large enough and that questions on one concept are comparable before acting."}}]}}}},{"id":"story-signups","track":"data-stories","title":"Is signup growth steady?","summary":"Three steps from one series: the trend, the spread around it, and what a plan should assume. The smallest story that still has a shape.","principle":"story-shape","also":["story-grounded","story-caveats"],"tags":["data-stories","growth","narrative"],"evidence":["lib/datastory/index.ts (checkStory)","lib/playbook/examples/charts.ts (SIGNUPS)"],"body":{"kind":"story","story":{"id":"signups-steady","title":"Is signup growth steady?","question":"Are signups growing steadily enough to plan on?","steps":[{"id":"series","role":"setup","heading":"Signups over 12 months","facts":{"months":"12","first":"116","last":"260","growth":"124%","from":"2026-01","to":"2026-12"},"takeaway":"Monthly signups went from 116 in 2026-01 to 260 in 2026-12, up 124%."},{"id":"gains","role":"evidence","heading":"Month-on-month change","facts":{"avgGain":"13","dips":"3","worstFall":"5"},"takeaway":"The average month adds 13 signups. 3 of the months fell, the worst by 5."},{"id":"plan","role":"resolution","heading":"What to plan on","facts":{"avgGain":"13"},"takeaway":"Plan on about 13 more signups each month, and treat any single month's change as noise unless it is outside the usual spread."}],"answer":"Growth is steady enough to plan on at the average monthly gain; individual months are noisy.","caveats":["Twelve months is a short history; seasonality cannot be seen in it.","The signup counts are simulated for this example."]},"spec":{"title":"Is signup growth steady?","description":"Are signups growing steadily enough to plan on?","provenance":"data","state":{"series":[{"month":"2026-01-01","signups":116},{"month":"2026-02-01","signups":145},{"month":"2026-03-01","signups":142},{"month":"2026-04-01","signups":156},{"month":"2026-05-01","signups":179},{"month":"2026-06-01","signups":207},{"month":"2026-07-01","signups":206},{"month":"2026-08-01","signups":211},{"month":"2026-09-01","signups":246},{"month":"2026-10-01","signups":250},{"month":"2026-11-01","signups":245},{"month":"2026-12-01","signups":260}],"gains":[{"month":"2026-02-01","change":29},{"month":"2026-03-01","change":-3},{"month":"2026-04-01","change":14},{"month":"2026-05-01","change":23},{"month":"2026-06-01","change":28},{"month":"2026-07-01","change":-1},{"month":"2026-08-01","change":5},{"month":"2026-09-01","change":35},{"month":"2026-10-01","change":4},{"month":"2026-11-01","change":-5},{"month":"2026-12-01","change":15}]},"root":{"type":"Page","children":[{"type":"Card","props":{"title":"Signups over 12 months"},"children":[{"type":"Text","props":{"text":"Monthly signups went from 116 in 2026-01 to 260 in 2026-12, up 124%.","muted":false}},{"type":"Chart","props":{"title":"Signups by month","mark":"line","height":200,"data":{"$state":"/series"},"encoding":{"x":{"field":"month","type":"temporal","title":"Month"},"y":{"field":"signups","type":"quantitative","title":"Signups"}}}}]},{"type":"Card","props":{"title":"Month-on-month change"},"children":[{"type":"Text","props":{"text":"The average month adds 13 signups. 3 of the months fell, the worst by 5.","muted":false}},{"type":"Chart","props":{"title":"Change from the previous month","mark":"bar","height":200,"data":{"$state":"/gains"},"encoding":{"x":{"field":"month","type":"temporal","title":"Month"},"y":{"field":"change","type":"quantitative","title":"Change in signups"}}}}]},{"type":"Card","props":{"title":"What to plan on"},"children":[{"type":"Text","props":{"text":"Plan on about 13 more signups each month, and treat any single month's change as noise unless it is outside the usual spread.","muted":false}}]},{"type":"Callout","props":{"variant":"success","title":"The answer","body":"Growth is steady enough to plan on at the average monthly gain; individual months are noisy."}},{"type":"Callout","props":{"variant":"warning","title":"What this cannot tell you","body":"Twelve months is a short history; seasonality cannot be seen in it. The signup counts are simulated for this example."}}]}}}},{"id":"story-alpha","track":"data-stories","title":"Is it alpha, or is it luck?","summary":"The same format on a harder question: eight steps, a simulation with a known truth, and an honest table of how often the method is wrong.","principle":"story-grounded","also":["story-caveats"],"tags":["data-stories","finance","narrative"],"evidence":["lib/alpha/story.ts (alphaStory)","lib/datastory/index.ts (checkStory)"],"body":{"kind":"story","story":{"id":"alpha-or-luck","title":"Is it alpha, or is it luck?","question":"How do you tell a trading rule that has an edge from one that only looks good because it was chosen from many?","steps":[{"id":"two-markets","role":"setup","heading":"Two markets. One hides an edge.","facts":{"years":"7.9","rules":"48"},"takeaway":"Here are 7.9 years of two simulated markets. One is pure noise; the other hides a trend that flips between up and down for months. By eye you cannot tell which. A rule has to: so we try 48 of them."},{"id":"best-of-many","role":"evidence","heading":"Market A: try 48 rules and the best one looks good","facts":{"rules":"48","rule":"Reversion: 60-day, 1.5 deviations","sharpe":"0.82"},"takeaway":"Market A has no edge, yet the best of 48 rules, Reversion: 60-day, 1.5 deviations, shows a Sharpe ratio of 0.82 on the first part of the data. Try enough rules and something always looks like skill."},{"id":"unseen-data","role":"complication","heading":"Then the data it was never chosen on","facts":{"inSample":"0.82","outOfSample":"-0.28","hold":"0.27"},"takeaway":"On the later data the same rule earned a Sharpe of -0.28, against 0.82 when it was chosen. The in-sample number was selection, not skill. Buy and hold managed 0.27 on that stretch."},{"id":"pay-for-trials","role":"evidence","heading":"Charge each winner for the 48 rules tried","facts":{"pAdjustedA":"1.00","deflatedA":"0.28","pAdjustedB":"0.42","deflatedB":"0.54","rules":"48"},"takeaway":"Paying for 48 tries, Market A's winner has an adjusted p-value of 1.00 and a deflated Sharpe of 0.28: no evidence of an edge. Market B's winner has 0.42 and 0.54."},{"id":"trend-holds","role":"evidence","heading":"Market B: the winner holds up on new data","facts":{"rule":"Trend: 30/60-day averages","inSample":"1.16","outOfSample":"0.54","walkForward":"0.82","refit":"125"},"takeaway":"In Market B, Trend: 30/60-day averages scored 1.16 on the first part and 0.54 on the later data. Re-choosing every 125 days using only the past (walk-forward) earned 0.82: the edge is there, and smaller than the first number said."},{"id":"costs","role":"complication","heading":"Trading is not free","facts":{"free":"0.56","cheap":"0.54","dear":"0.47","steep":"0.35","turnover":"6.8","rule":"Trend: 30/60-day averages","bps":"5, 20, 50"},"takeaway":"Trend: 30/60-day averages turns its position over 6.8 times a year. Out of sample its Sharpe is 0.56 with free trading, 0.54 at 5 bps, 0.47 at 20 and 0.35 at 50. The more a rule trades, the more of its edge it hands over."},{"id":"many-markets","role":"evidence","heading":"Not one lucky seed: 40 markets of each kind","facts":{"markets":"40","bar":"0.9","inA":"0.70","outA":"-0.04","clearsA":"0 of 40","holdsA":"12 of 40","inB":"1.42","outB":"0.66","clearsB":"7 of 40","holdsB":"26 of 40"},"takeaway":"The two markets above were picked because they show the point; this table is the typical case. Across 40 no-edge markets the winner averaged 0.70 in sample and -0.04 out of sample, and the deflated Sharpe cleared 0.9 in 0 of 40. Across 40 trend markets it averaged 1.42 then 0.66, clearing 0.9 in 7 of 40: a strict test misses some real edges but invented none here."},{"id":"what-to-do","role":"resolution","heading":"What to do with a result that looks good","facts":{},"takeaway":"Judge it on data it was not chosen on. Count every rule you tried and charge the winner for them. Take trading costs off before you decide. Re-choose using only the past, as you would live. Prefer rules you can explain, and be suspicious of a Sharpe that is too good."}],"answer":"A rule has alpha only if it survives data it was not chosen on, after paying for every rule that was tried and for the cost of trading it.","caveats":["These are simulated markets. The hidden trend is far stronger than any real market's, so a rule can find it in a few years of data.","Real returns have fat tails, changing volatility and crowded trades that this does not model.","A single split and a single walk-forward are the simplest honest checks, not the only ones. Nothing here is investment advice."]},"spec":{"title":"Is it alpha, or is it luck?","description":"How do you tell a trading rule that has an edge from one that only looks good because it was chosen from many?","provenance":"data","state":{"two_markets":[{"day":0,"growth":0.993,"market":"Market A"},{"day":10,"growth":0.977,"market":"Market A"},{"day":20,"growth":0.945,"market":"Market A"},{"day":30,"growth":0.975,"market":"Market A"},{"day":40,"growth":0.963,"market":"Market A"},{"day":50,"growth":0.923,"market":"Market A"},{"day":60,"growth":0.921,"market":"Market A"},{"day":70,"growth":0.927,"market":"Market A"},{"day":80,"growth":0.94,"market":"Market A"},{"day":90,"growth":0.92,"market":"Market A"},{"day":100,"growth":0.927,"market":"Market A"},{"day":110,"growth":0.95,"market":"Market A"},{"day":120,"growth":0.959,"market":"Market A"},{"day":130,"growth":0.936,"market":"Market A"},{"day":140,"growth":0.857,"market":"Market A"},{"day":150,"growth":0.846,"market":"Market A"},{"day":160,"growth":0.844,"market":"Market A"},{"day":170,"growth":0.863,"market":"Market A"},{"day":180,"growth":0.858,"market":"Market A"},{"day":190,"growth":0.876,"market":"Market A"},{"day":200,"growth":0.899,"market":"Market A"},{"day":210,"growth":0.918,"market":"Market A"},{"day":220,"growth":0.96,"market":"Market A"},{"day":230,"growth":0.994,"market":"Market A"},{"day":240,"growth":1.001,"market":"Market A"},{"day":250,"growth":1.003,"market":"Market A"},{"day":260,"growth":1.001,"market":"Market A"},{"day":270,"growth":1.002,"market":"Market A"},{"day":280,"growth":0.985,"market":"Market A"},{"day":290,"growth":0.954,"market":"Market A"},{"day":300,"growth":0.958,"market":"Market A"},{"day":310,"growth":0.976,"market":"Market A"},{"day":320,"growth":1.003,"market":"Market A"},{"day":330,"growth":1.045,"market":"Market A"},{"day":340,"growth":1.049,"market":"Market A"},{"day":350,"growth":1.042,"market":"Market A"},{"day":360,"growth":1.067,"market":"Market A"},{"day":370,"growth":1.096,"market":"Market A"},{"day":380,"growth":1.092,"market":"Market A"},{"day":390,"growth":1.022,"market":"Market A"},{"day":400,"growth":1.06,"market":"Market A"},{"day":410,"growth":1.004,"market":"Market A"},{"day":420,"growth":1.004,"market":"Market A"},{"day":430,"growth":0.999,"market":"Market A"},{"day":440,"growth":1.01,"market":"Market A"},{"day":450,"growth":1.013,"market":"Market A"},{"day":460,"growth":1.035,"market":"Market A"},{"day":470,"growth":1.054,"market":"Market A"},{"day":480,"growth":1.099,"market":"Market A"},{"day":490,"growth":1.078,"market":"Market A"},{"day":500,"growth":1.022,"market":"Market A"},{"day":510,"growth":1.018,"market":"Market A"},{"day":520,"growth":1.012,"market":"Market A"},{"day":530,"growth":1.002,"market":"Market A"},{"day":540,"growth":0.966,"market":"Market A"},{"day":550,"growth":0.932,"market":"Market A"},{"day":560,"growth":0.911,"market":"Market A"},{"day":570,"growth":0.902,"market":"Market A"},{"day":580,"growth":0.897,"market":"Market A"},{"day":590,"growth":0.908,"market":"Market A"},{"day":600,"growth":0.913,"market":"Market A"},{"day":610,"growth":0.905,"market":"Market A"},{"day":620,"growth":0.917,"market":"Market A"},{"day":630,"growth":0.901,"market":"Market A"},{"day":640,"growth":0.916,"market":"Market A"},{"day":650,"growth":0.916,"market":"Market A"},{"day":660,"growth":0.898,"market":"Market A"},{"day":670,"growth":0.909,"market":"Market A"},{"day":680,"growth":0.909,"market":"Market A"},{"day":690,"growth":0.888,"market":"Market A"},{"day":700,"growth":0.871,"market":"Market A"},{"day":710,"growth":0.876,"market":"Market A"},{"day":720,"growth":0.902,"market":"Market A"},{"day":730,"growth":0.844,"market":"Market A"},{"day":740,"growth":0.863,"market":"Market A"},{"day":750,"growth":0.893,"market":"Market A"},{"day":760,"growth":0.886,"market":"Market A"},{"day":770,"growth":0.913,"market":"Market A"},{"day":780,"growth":0.889,"market":"Market A"},{"day":790,"growth":0.854,"market":"Market A"},{"day":800,"growth":0.83,"market":"Market A"},{"day":810,"growth":0.827,"market":"Market A"},{"day":820,"growth":0.835,"market":"Market A"},{"day":830,"growth":0.808,"market":"Market A"},{"day":840,"growth":0.819,"market":"Market A"},{"day":850,"growth":0.805,"market":"Market A"},{"day":860,"growth":0.788,"market":"Market A"},{"day":870,"growth":0.794,"market":"Market A"},{"day":880,"growth":0.764,"market":"Market A"},{"day":890,"growth":0.772,"market":"Market A"},{"day":900,"growth":0.732,"market":"Market A"},{"day":910,"growth":0.757,"market":"Market A"},{"day":920,"growth":0.776,"market":"Market A"},{"day":930,"growth":0.771,"market":"Market A"},{"day":940,"growth":0.772,"market":"Market A"},{"day":950,"growth":0.766,"market":"Market A"},{"day":960,"growth":0.741,"market":"Market A"},{"day":970,"growth":0.76,"market":"Market A"},{"day":980,"growth":0.767,"market":"Market A"},{"day":990,"growth":0.757,"market":"Market A"},{"day":1000,"growth":0.711,"market":"Market A"},{"day":1010,"growth":0.708,"market":"Market A"},{"day":1020,"growth":0.752,"market":"Market A"},{"day":1030,"growth":0.783,"market":"Market A"},{"day":1040,"growth":0.772,"market":"Market A"},{"day":1050,"growth":0.781,"market":"Market A"},{"day":1060,"growth":0.755,"market":"Market A"},{"day":1070,"growth":0.751,"market":"Market A"},{"day":1080,"growth":0.764,"market":"Market A"},{"day":1090,"growth":0.754,"market":"Market A"},{"day":1100,"growth":0.739,"market":"Market A"},{"day":1110,"growth":0.759,"market":"Market A"},{"day":1120,"growth":0.717,"market":"Market A"},{"day":1130,"growth":0.713,"market":"Market A"},{"day":1140,"growth":0.698,"market":"Market A"},{"day":1150,"growth":0.72,"market":"Market A"},{"day":1160,"growth":0.711,"market":"Market A"},{"day":1170,"growth":0.691,"market":"Market A"},{"day":1180,"growth":0.695,"market":"Market A"},{"day":1190,"growth":0.678,"market":"Market A"},{"day":1200,"growth":0.675,"market":"Market A"},{"day":1210,"growth":0.649,"market":"Market A"},{"day":1220,"growth":0.652,"market":"Market A"},{"day":1230,"growth":0.661,"market":"Market A"},{"day":1240,"growth":0.676,"market":"Market A"},{"day":1250,"growth":0.663,"market":"Market A"},{"day":1260,"growth":0.662,"market":"Market A"},{"day":1270,"growth":0.703,"market":"Market A"},{"day":1280,"growth":0.697,"market":"Market A"},{"day":1290,"growth":0.685,"market":"Market A"},{"day":1300,"growth":0.678,"market":"Market A"},{"day":1310,"growth":0.723,"market":"Market A"},{"day":1320,"growth":0.727,"market":"Market A"},{"day":1330,"growth":0.713,"market":"Market A"},{"day":1340,"growth":0.701,"market":"Market A"},{"day":1350,"growth":0.68,"market":"Market A"},{"day":1360,"growth":0.654,"market":"Market A"},{"day":1370,"growth":0.612,"market":"Market A"},{"day":1380,"growth":0.613,"market":"Market A"},{"day":1390,"growth":0.638,"market":"Market A"},{"day":1400,"growth":0.65,"market":"Market A"},{"day":1410,"growth":0.625,"market":"Market A"},{"day":1420,"growth":0.591,"market":"Market A"},{"day":1430,"growth":0.588,"market":"Market A"},{"day":1440,"growth":0.594,"market":"Market A"},{"day":1450,"growth":0.609,"market":"Market A"},{"day":1460,"growth":0.604,"market":"Market A"},{"day":1470,"growth":0.64,"market":"Market A"},{"day":1480,"growth":0.633,"market":"Market A"},{"day":1490,"growth":0.626,"market":"Market A"},{"day":1500,"growth":0.61,"market":"Market A"},{"day":1510,"growth":0.622,"market":"Market A"},{"day":1520,"growth":0.617,"market":"Market A"},{"day":1530,"growth":0.622,"market":"Market A"},{"day":1540,"growth":0.632,"market":"Market A"},{"day":1550,"growth":0.639,"market":"Market A"},{"day":1560,"growth":0.626,"market":"Market A"},{"day":1570,"growth":0.609,"market":"Market A"},{"day":1580,"growth":0.619,"market":"Market A"},{"day":1590,"growth":0.641,"market":"Market A"},{"day":1600,"growth":0.697,"market":"Market A"},{"day":1610,"growth":0.725,"market":"Market A"},{"day":1620,"growth":0.723,"market":"Market A"},{"day":1630,"growth":0.751,"market":"Market A"},{"day":1640,"growth":0.793,"market":"Market A"},{"day":1650,"growth":0.8,"market":"Market A"},{"day":1660,"growth":0.735,"market":"Market A"},{"day":1670,"growth":0.729,"market":"Market A"},{"day":1680,"growth":0.745,"market":"Market A"},{"day":1690,"growth":0.753,"market":"Market A"},{"day":1700,"growth":0.79,"market":"Market A"},{"day":1710,"growth":0.786,"market":"Market A"},{"day":1720,"growth":0.779,"market":"Market A"},{"day":1730,"growth":0.77,"market":"Market A"},{"day":1740,"growth":0.758,"market":"Market A"},{"day":1750,"growth":0.755,"market":"Market A"},{"day":1760,"growth":0.779,"market":"Market A"},{"day":1770,"growth":0.814,"market":"Market A"},{"day":1780,"growth":0.786,"market":"Market A"},{"day":1790,"growth":0.806,"market":"Market A"},{"day":1800,"growth":0.799,"market":"Market A"},{"day":1810,"growth":0.759,"market":"Market A"},{"day":1820,"growth":0.722,"market":"Market A"},{"day":1830,"growth":0.725,"market":"Market A"},{"day":1840,"growth":0.701,"market":"Market A"},{"day":1850,"growth":0.694,"market":"Market A"},{"day":1860,"growth":0.694,"market":"Market A"},{"day":1870,"growth":0.708,"market":"Market A"},{"day":1880,"growth":0.704,"market":"Market A"},{"day":1890,"growth":0.706,"market":"Market A"},{"day":1900,"growth":0.732,"market":"Market A"},{"day":1910,"growth":0.717,"market":"Market A"},{"day":1920,"growth":0.723,"market":"Market A"},{"day":1930,"growth":0.753,"market":"Market A"},{"day":1940,"growth":0.752,"market":"Market A"},{"day":1950,"growth":0.747,"market":"Market A"},{"day":1960,"growth":0.724,"market":"Market A"},{"day":1970,"growth":0.688,"market":"Market A"},{"day":1980,"growth":0.678,"market":"Market A"},{"day":1990,"growth":0.715,"market":"Market A"},{"day":0,"growth":0.991,"market":"Market B"},{"day":10,"growth":0.967,"market":"Market B"},{"day":20,"growth":0.948,"market":"Market B"},{"day":30,"growth":0.991,"market":"Market B"},{"day":40,"growth":0.971,"market":"Market B"},{"day":50,"growth":0.915,"market":"Market B"},{"day":60,"growth":0.898,"market":"Market B"},{"day":70,"growth":0.888,"market":"Market B"},{"day":80,"growth":0.886,"market":"Market B"},{"day":90,"growth":0.852,"market":"Market B"},{"day":100,"growth":0.843,"market":"Market B"},{"day":110,"growth":0.863,"market":"Market B"},{"day":120,"growth":0.883,"market":"Market B"},{"day":130,"growth":0.873,"market":"Market B"},{"day":140,"growth":0.81,"market":"Market B"},{"day":150,"growth":0.81,"market":"Market B"},{"day":160,"growth":0.818,"market":"Market B"},{"day":170,"growth":0.848,"market":"Market B"},{"day":180,"growth":0.854,"market":"Market B"},{"day":190,"growth":0.883,"market":"Market B"},{"day":200,"growth":0.904,"market":"Market B"},{"day":210,"growth":0.908,"market":"Market B"},{"day":220,"growth":0.933,"market":"Market B"},{"day":230,"growth":0.951,"market":"Market B"},{"day":240,"growth":0.941,"market":"Market B"},{"day":250,"growth":0.927,"market":"Market B"},{"day":260,"growth":0.91,"market":"Market B"},{"day":270,"growth":0.895,"market":"Market B"},{"day":280,"growth":0.865,"market":"Market B"},{"day":290,"growth":0.823,"market":"Market B"},{"day":300,"growth":0.813,"market":"Market B"},{"day":310,"growth":0.815,"market":"Market B"},{"day":320,"growth":0.823,"market":"Market B"},{"day":330,"growth":0.843,"market":"Market B"},{"day":340,"growth":0.839,"market":"Market B"},{"day":350,"growth":0.845,"market":"Market B"},{"day":360,"growth":0.877,"market":"Market B"},{"day":370,"growth":0.912,"market":"Market B"},{"day":380,"growth":0.921,"market":"Market B"},{"day":390,"growth":0.873,"market":"Market B"},{"day":400,"growth":0.917,"market":"Market B"},{"day":410,"growth":0.88,"market":"Market B"},{"day":420,"growth":0.891,"market":"Market B"},{"day":430,"growth":0.899,"market":"Market B"},{"day":440,"growth":0.92,"market":"Market B"},{"day":450,"growth":0.935,"market":"Market B"},{"day":460,"growth":0.968,"market":"Market B"},{"day":470,"growth":0.999,"market":"Market B"},{"day":480,"growth":1.055,"market":"Market B"},{"day":490,"growth":1.048,"market":"Market B"},{"day":500,"growth":1.007,"market":"Market B"},{"day":510,"growth":1.016,"market":"Market B"},{"day":520,"growth":1.024,"market":"Market B"},{"day":530,"growth":1.027,"market":"Market B"},{"day":540,"growth":1.003,"market":"Market B"},{"day":550,"growth":0.979,"market":"Market B"},{"day":560,"growth":0.97,"market":"Market B"},{"day":570,"growth":0.973,"market":"Market B"},{"day":580,"growth":0.981,"market":"Market B"},{"day":590,"growth":1.006,"market":"Market B"},{"day":600,"growth":1.024,"market":"Market B"},{"day":610,"growth":1.028,"market":"Market B"},{"day":620,"growth":1.04,"market":"Market B"},{"day":630,"growth":1.005,"market":"Market B"},{"day":640,"growth":1.004,"market":"Market B"},{"day":650,"growth":0.987,"market":"Market B"},{"day":660,"growth":0.963,"market":"Market B"},{"day":670,"growth":0.987,"market":"Market B"},{"day":680,"growth":1.001,"market":"Market B"},{"day":690,"growth":0.991,"market":"Market B"},{"day":700,"growth":0.984,"market":"Market B"},{"day":710,"growth":1.003,"market":"Market B"},{"day":720,"growth":1.046,"market":"Market B"},{"day":730,"growth":0.986,"market":"Market B"},{"day":740,"growth":0.99,"market":"Market B"},{"day":750,"growth":1.008,"market":"Market B"},{"day":760,"growth":0.984,"market":"Market B"},{"day":770,"growth":1.005,"market":"Market B"},{"day":780,"growth":0.992,"market":"Market B"},{"day":790,"growth":0.962,"market":"Market B"},{"day":800,"growth":0.919,"market":"Market B"},{"day":810,"growth":0.9,"market":"Market B"},{"day":820,"growth":0.894,"market":"Market B"},{"day":830,"growth":0.861,"market":"Market B"},{"day":840,"growth":0.884,"market":"Market B"},{"day":850,"growth":0.88,"market":"Market B"},{"day":860,"growth":0.873,"market":"Market B"},{"day":870,"growth":0.891,"market":"Market B"},{"day":880,"growth":0.868,"market":"Market B"},{"day":890,"growth":0.889,"market":"Market B"},{"day":900,"growth":0.854,"market":"Market B"},{"day":910,"growth":0.895,"market":"Market B"},{"day":920,"growth":0.929,"market":"Market B"},{"day":930,"growth":0.935,"market":"Market B"},{"day":940,"growth":0.949,"market":"Market B"},{"day":950,"growth":0.953,"market":"Market B"},{"day":960,"growth":0.935,"market":"Market B"},{"day":970,"growth":0.971,"market":"Market B"},{"day":980,"growth":0.993,"market":"Market B"},{"day":990,"growth":0.975,"market":"Market B"},{"day":1000,"growth":0.9,"market":"Market B"},{"day":1010,"growth":0.881,"market":"Market B"},{"day":1020,"growth":0.92,"market":"Market B"},{"day":1030,"growth":0.942,"market":"Market B"},{"day":1040,"growth":0.933,"market":"Market B"},{"day":1050,"growth":0.956,"market":"Market B"},{"day":1060,"growth":0.936,"market":"Market B"},{"day":1070,"growth":0.915,"market":"Market B"},{"day":1080,"growth":0.916,"market":"Market B"},{"day":1090,"growth":0.888,"market":"Market B"},{"day":1100,"growth":0.856,"market":"Market B"},{"day":1110,"growth":0.865,"market":"Market B"},{"day":1120,"growth":0.803,"market":"Market B"},{"day":1130,"growth":0.785,"market":"Market B"},{"day":1140,"growth":0.755,"market":"Market B"},{"day":1150,"growth":0.766,"market":"Market B"},{"day":1160,"growth":0.744,"market":"Market B"},{"day":1170,"growth":0.71,"market":"Market B"},{"day":1180,"growth":0.702,"market":"Market B"},{"day":1190,"growth":0.674,"market":"Market B"},{"day":1200,"growth":0.659,"market":"Market B"},{"day":1210,"growth":0.623,"market":"Market B"},{"day":1220,"growth":0.616,"market":"Market B"},{"day":1230,"growth":0.617,"market":"Market B"},{"day":1240,"growth":0.64,"market":"Market B"},{"day":1250,"growth":0.635,"market":"Market B"},{"day":1260,"growth":0.643,"market":"Market B"},{"day":1270,"growth":0.692,"market":"Market B"},{"day":1280,"growth":0.694,"market":"Market B"},{"day":1290,"growth":0.691,"market":"Market B"},{"day":1300,"growth":0.694,"market":"Market B"},{"day":1310,"growth":0.749,"market":"Market B"},{"day":1320,"growth":0.763,"market":"Market B"},{"day":1330,"growth":0.758,"market":"Market B"},{"day":1340,"growth":0.755,"market":"Market B"},{"day":1350,"growth":0.742,"market":"Market B"},{"day":1360,"growth":0.723,"market":"Market B"},{"day":1370,"growth":0.686,"market":"Market B"},{"day":1380,"growth":0.696,"market":"Market B"},{"day":1390,"growth":0.733,"market":"Market B"},{"day":1400,"growth":0.735,"market":"Market B"},{"day":1410,"growth":0.694,"market":"Market B"},{"day":1420,"growth":0.646,"market":"Market B"},{"day":1430,"growth":0.632,"market":"Market B"},{"day":1440,"growth":0.627,"market":"Market B"},{"day":1450,"growth":0.632,"market":"Market B"},{"day":1460,"growth":0.616,"market":"Market B"},{"day":1470,"growth":0.642,"market":"Market B"},{"day":1480,"growth":0.624,"market":"Market B"},{"day":1490,"growth":0.607,"market":"Market B"},{"day":1500,"growth":0.582,"market":"Market B"},{"day":1510,"growth":0.583,"market":"Market B"},{"day":1520,"growth":0.569,"market":"Market B"},{"day":1530,"growth":0.564,"market":"Market B"},{"day":1540,"growth":0.563,"market":"Market B"},{"day":1550,"growth":0.559,"market":"Market B"},{"day":1560,"growth":0.539,"market":"Market B"},{"day":1570,"growth":0.515,"market":"Market B"},{"day":1580,"growth":0.515,"market":"Market B"},{"day":1590,"growth":0.524,"market":"Market B"},{"day":1600,"growth":0.571,"market":"Market B"},{"day":1610,"growth":0.601,"market":"Market B"},{"day":1620,"growth":0.607,"market":"Market B"},{"day":1630,"growth":0.639,"market":"Market B"},{"day":1640,"growth":0.684,"market":"Market B"},{"day":1650,"growth":0.699,"market":"Market B"},{"day":1660,"growth":0.65,"market":"Market B"},{"day":1670,"growth":0.64,"market":"Market B"},{"day":1680,"growth":0.643,"market":"Market B"},{"day":1690,"growth":0.639,"market":"Market B"},{"day":1700,"growth":0.66,"market":"Market B"},{"day":1710,"growth":0.645,"market":"Market B"},{"day":1720,"growth":0.628,"market":"Market B"},{"day":1730,"growth":0.61,"market":"Market B"},{"day":1740,"growth":0.591,"market":"Market B"},{"day":1750,"growth":0.579,"market":"Market B"},{"day":1760,"growth":0.587,"market":"Market B"},{"day":1770,"growth":0.603,"market":"Market B"},{"day":1780,"growth":0.573,"market":"Market B"},{"day":1790,"growth":0.577,"market":"Market B"},{"day":1800,"growth":0.562,"market":"Market B"},{"day":1810,"growth":0.525,"market":"Market B"},{"day":1820,"growth":0.491,"market":"Market B"},{"day":1830,"growth":0.485,"market":"Market B"},{"day":1840,"growth":0.461,"market":"Market B"},{"day":1850,"growth":0.448,"market":"Market B"},{"day":1860,"growth":0.441,"market":"Market B"},{"day":1870,"growth":0.451,"market":"Market B"},{"day":1880,"growth":0.453,"market":"Market B"},{"day":1890,"growth":0.461,"market":"Market B"},{"day":1900,"growth":0.484,"market":"Market B"},{"day":1910,"growth":0.48,"market":"Market B"},{"day":1920,"growth":0.491,"market":"Market B"},{"day":1930,"growth":0.518,"market":"Market B"},{"day":1940,"growth":0.524,"market":"Market B"},{"day":1950,"growth":0.527,"market":"Market B"},{"day":1960,"growth":0.518,"market":"Market B"},{"day":1970,"growth":0.498,"market":"Market B"},{"day":1980,"growth":0.498,"market":"Market B"},{"day":1990,"growth":0.531,"market":"Market B"}],"best_of_many":[{"rule":"Reversion: 60-day, 1.5 deviations","sharpe":0.82},{"rule":"Reversion: 60-day, 1 deviations","sharpe":0.66},{"rule":"Reversion: 40-day, 1 deviations","sharpe":0.66},{"rule":"Reversion: 60-day, 2 deviations","sharpe":0.62},{"rule":"Trend: 50/250-day averages","sharpe":0.44},{"rule":"Trend: 30/250-day averages","sharpe":0.44},{"rule":"Reversion: 10-day, 1 deviations","sharpe":0.39},{"rule":"Reversion: 40-day, 1.5 deviations","sharpe":0.34}],"unseen_data":[{"period":"Chosen on (in sample)","sharpe":0.82},{"period":"Then tested (out of sample)","sharpe":-0.28}],"pay_for_trials":[{"market":"A (no edge)","rule":"Reversion: 60-day, 1.5 deviations","sharpe":"0.82","p":"0.05","pAdjusted":"1.00","deflated":"0.28"},{"market":"B (hidden trend)","rule":"Trend: 30/60-day averages","sharpe":"1.16","p":"0.01","pAdjusted":"0.42","deflated":"0.54"}],"trend_holds":[{"step":"Chosen on (in sample)","sharpe":1.16},{"step":"Then tested (out of sample)","sharpe":0.54},{"step":"Walk-forward (only the past)","sharpe":0.82}],"costs":[{"cost":"0 bps","sharpe":0.56},{"cost":"5 bps","sharpe":0.54},{"cost":"20 bps","sharpe":0.47},{"cost":"50 bps","sharpe":0.35}],"many_markets":[{"kind":"No edge","inSample":"0.70","outOfSample":"-0.04","holds":"12 of 40","clears":"0 of 40"},{"kind":"Hidden trend","inSample":"1.42","outOfSample":"0.66","holds":"26 of 40","clears":"7 of 40"}]},"root":{"type":"Page","children":[{"type":"Card","props":{"title":"Two markets. One hides an edge."},"children":[{"type":"Text","props":{"text":"Here are 7.9 years of two simulated markets. One is pure noise; the other hides a trend that flips between up and down for months. By eye you cannot tell which. A rule has to: so we try 48 of them.","muted":false}},{"type":"Chart","props":{"title":"Growth of 1 invested, by market","mark":"line","height":220,"data":{"$state":"/two_markets"},"encoding":{"x":{"field":"day","type":"quantitative","title":"Trading day"},"y":{"field":"growth","type":"quantitative","title":"Growth of 1"},"color":{"field":"market","type":"nominal","title":"Market"}}}}]},{"type":"Card","props":{"title":"Market A: try 48 rules and the best one looks good"},"children":[{"type":"Text","props":{"text":"Market A has no edge, yet the best of 48 rules, Reversion: 60-day, 1.5 deviations, shows a Sharpe ratio of 0.82 on the first part of the data. Try enough rules and something always looks like skill.","muted":false}},{"type":"Chart","props":{"title":"In-sample Sharpe ratio of the eight best rules, Market A","mark":"bar","horizontal":true,"height":240,"sort":"-y","data":{"$state":"/best_of_many"},"encoding":{"x":{"field":"rule","type":"nominal","title":"Rule"},"y":{"field":"sharpe","type":"quantitative","title":"Sharpe ratio (in sample)"}}}}]},{"type":"Card","props":{"title":"Then the data it was never chosen on"},"children":[{"type":"Text","props":{"text":"On the later data the same rule earned a Sharpe of -0.28, against 0.82 when it was chosen. The in-sample number was selection, not skill. Buy and hold managed 0.27 on that stretch.","muted":false}},{"type":"Chart","props":{"title":"The winning rule, before and after, Market A","mark":"bar","height":200,"data":{"$state":"/unseen_data"},"encoding":{"x":{"field":"period","type":"nominal","title":"Period"},"y":{"field":"sharpe","type":"quantitative","title":"Sharpe ratio"}}}}]},{"type":"Card","props":{"title":"Charge each winner for the 48 rules tried"},"children":[{"type":"Text","props":{"text":"Paying for 48 tries, Market A's winner has an adjusted p-value of 1.00 and a deflated Sharpe of 0.28: no evidence of an edge. Market B's winner has 0.42 and 0.54.","muted":false}},{"type":"Table","props":{"caption":"Adjusted p-value: the chance of a result this good by luck, after trying every rule. Deflated Sharpe: the probability the edge is real, 1 being certain.","columns":[{"key":"market","label":"Market"},{"key":"rule","label":"Winning rule"},{"key":"sharpe","label":"Sharpe (in sample)","align":"right"},{"key":"pAdjusted","label":"Adjusted p","align":"right"},{"key":"deflated","label":"Deflated Sharpe","align":"right"}],"rows":{"$state":"/pay_for_trials"}}}]},{"type":"Card","props":{"title":"Market B: the winner holds up on new data"},"children":[{"type":"Text","props":{"text":"In Market B, Trend: 30/60-day averages scored 1.16 on the first part and 0.54 on the later data. Re-choosing every 125 days using only the past (walk-forward) earned 0.82: the edge is there, and smaller than the first number said.","muted":false}},{"type":"Chart","props":{"title":"Market B: chosen, tested, and walked forward","mark":"bar","height":200,"data":{"$state":"/trend_holds"},"encoding":{"x":{"field":"step","type":"nominal","title":"How it was judged"},"y":{"field":"sharpe","type":"quantitative","title":"Sharpe ratio"}}}}]},{"type":"Card","props":{"title":"Trading is not free"},"children":[{"type":"Text","props":{"text":"Trend: 30/60-day averages turns its position over 6.8 times a year. Out of sample its Sharpe is 0.56 with free trading, 0.54 at 5 bps, 0.47 at 20 and 0.35 at 50. The more a rule trades, the more of its edge it hands over.","muted":false}},{"type":"Chart","props":{"title":"Out-of-sample Sharpe by cost per unit traded, Market B winner","mark":"bar","height":200,"data":{"$state":"/costs"},"encoding":{"x":{"field":"cost","type":"nominal","title":"Cost per unit of position changed"},"y":{"field":"sharpe","type":"quantitative","title":"Sharpe ratio"}}}}]},{"type":"Card","props":{"title":"Not one lucky seed: 40 markets of each kind"},"children":[{"type":"Text","props":{"text":"The two markets above were picked because they show the point; this table is the typical case. Across 40 no-edge markets the winner averaged 0.70 in sample and -0.04 out of sample, and the deflated Sharpe cleared 0.9 in 0 of 40. Across 40 trend markets it averaged 1.42 then 0.66, clearing 0.9 in 7 of 40: a strict test misses some real edges but invented none here.","muted":false}},{"type":"Table","props":{"caption":"Winner of 48 rules in each of 40 simulated markets per kind.","columns":[{"key":"kind","label":"Market kind"},{"key":"inSample","label":"Mean Sharpe, in sample","align":"right"},{"key":"outOfSample","label":"Mean Sharpe, out of sample","align":"right"},{"key":"holds","label":"Out-of-sample Sharpe above 0.3","align":"right"},{"key":"clears","label":"Deflated Sharpe above 0.9","align":"right"}],"rows":{"$state":"/many_markets"}}}]},{"type":"Card","props":{"title":"What to do with a result that looks good"},"children":[{"type":"Text","props":{"text":"Judge it on data it was not chosen on. Count every rule you tried and charge the winner for them. Take trading costs off before you decide. Re-choose using only the past, as you would live. Prefer rules you can explain, and be suspicious of a Sharpe that is too good.","muted":false}}]},{"type":"Callout","props":{"variant":"success","title":"The answer","body":"A rule has alpha only if it survives data it was not chosen on, after paying for every rule that was tried and for the cost of trading it."}},{"type":"Callout","props":{"variant":"warning","title":"What this cannot tell you","body":"These are simulated markets. The hidden trend is far stronger than any real market's, so a rule can find it in a few years of data. Real returns have fat tails, changing volatility and crowded trades that this does not model. A single split and a single walk-forward are the simplest honest checks, not the only ones. Nothing here is investment advice."}}]}}}}]}