{"track":"alpha","examples":[{"id":"alpha-trend-found","track":"alpha","title":"A rule where there is a real trend","summary":"Thirty- and sixty-day averages on a market with a hidden up-and-down regime: the edge shows on data the rule was not chosen on.","principle":"alpha-out-of-sample","also":["alpha-trials"],"tags":["alpha","backtest","algorithms"],"evidence":["lib/alpha/strategies.ts (sma, momentum, reversion)","lib/alpha/backtest.ts (backtest)","lib/alpha/research.ts (research)"],"body":{"kind":"inline-spec","spec":{"title":"A trend rule on a market with a trend","description":"The market hides a trend that flips for months at a time. A rule that follows the direction of the last few weeks can find it, and the proof is the part of the chart it was not chosen on.","provenance":"data","state":{"growth":[{"day":0,"growth":1.009,"series":"The rule, after costs"},{"day":10,"growth":0.99,"series":"The rule, after costs"},{"day":20,"growth":1.006,"series":"The rule, after costs"},{"day":30,"growth":1.04,"series":"The rule, after costs"},{"day":40,"growth":1.091,"series":"The rule, after costs"},{"day":50,"growth":1.104,"series":"The rule, after costs"},{"day":60,"growth":1.101,"series":"The rule, after costs"},{"day":70,"growth":1.09,"series":"The rule, after costs"},{"day":80,"growth":1.063,"series":"The rule, after costs"},{"day":90,"growth":1.085,"series":"The rule, after costs"},{"day":100,"growth":1.092,"series":"The rule, after costs"},{"day":110,"growth":1.133,"series":"The rule, after costs"},{"day":120,"growth":1.178,"series":"The rule, after costs"},{"day":130,"growth":1.19,"series":"The rule, after costs"},{"day":140,"growth":1.128,"series":"The rule, after costs"},{"day":150,"growth":1.186,"series":"The rule, after costs"},{"day":160,"growth":1.138,"series":"The rule, after costs"},{"day":170,"growth":1.12,"series":"The rule, after costs"},{"day":180,"growth":1.109,"series":"The rule, after costs"},{"day":190,"growth":1.089,"series":"The rule, after costs"},{"day":200,"growth":1.107,"series":"The rule, after costs"},{"day":210,"growth":1.146,"series":"The rule, after costs"},{"day":220,"growth":1.183,"series":"The rule, after costs"},{"day":230,"growth":1.249,"series":"The rule, after costs"},{"day":240,"growth":1.241,"series":"The rule, after costs"},{"day":250,"growth":1.192,"series":"The rule, after costs"},{"day":260,"growth":1.202,"series":"The rule, after costs"},{"day":270,"growth":1.19,"series":"The rule, after costs"},{"day":280,"growth":1.185,"series":"The rule, after costs"},{"day":290,"growth":1.212,"series":"The rule, after costs"},{"day":300,"growth":1.24,"series":"The rule, after costs"},{"day":310,"growth":1.25,"series":"The rule, after costs"},{"day":320,"growth":1.245,"series":"The rule, after costs"},{"day":330,"growth":1.235,"series":"The rule, after costs"},{"day":340,"growth":1.203,"series":"The rule, after costs"},{"day":350,"growth":1.235,"series":"The rule, after costs"},{"day":360,"growth":1.24,"series":"The rule, after costs"},{"day":370,"growth":1.255,"series":"The rule, after costs"},{"day":380,"growth":1.212,"series":"The rule, after costs"},{"day":390,"growth":1.211,"series":"The rule, after costs"},{"day":400,"growth":1.295,"series":"The rule, after costs"},{"day":410,"growth":1.326,"series":"The rule, after costs"},{"day":420,"growth":1.293,"series":"The rule, after costs"},{"day":430,"growth":1.274,"series":"The rule, after costs"},{"day":440,"growth":1.286,"series":"The rule, after costs"},{"day":450,"growth":1.298,"series":"The rule, after costs"},{"day":460,"growth":1.323,"series":"The rule, after costs"},{"day":470,"growth":1.379,"series":"The rule, after costs"},{"day":480,"growth":1.3,"series":"The rule, after costs"},{"day":490,"growth":1.306,"series":"The rule, after costs"},{"day":500,"growth":1.329,"series":"The rule, after costs"},{"day":510,"growth":1.318,"series":"The rule, after costs"},{"day":520,"growth":1.289,"series":"The rule, after costs"},{"day":530,"growth":1.306,"series":"The rule, after costs"},{"day":540,"growth":1.344,"series":"The rule, after costs"},{"day":550,"growth":1.407,"series":"The rule, after costs"},{"day":560,"growth":1.435,"series":"The rule, after costs"},{"day":570,"growth":1.445,"series":"The rule, after costs"},{"day":580,"growth":1.499,"series":"The rule, after costs"},{"day":590,"growth":1.459,"series":"The rule, after costs"},{"day":600,"growth":1.465,"series":"The rule, after costs"},{"day":610,"growth":1.475,"series":"The rule, after costs"},{"day":620,"growth":1.444,"series":"The rule, after costs"},{"day":630,"growth":1.426,"series":"The rule, after costs"},{"day":640,"growth":1.46,"series":"The rule, after costs"},{"day":650,"growth":1.402,"series":"The rule, after costs"},{"day":660,"growth":1.428,"series":"The rule, after costs"},{"day":670,"growth":1.482,"series":"The rule, after costs"},{"day":680,"growth":1.491,"series":"The rule, after costs"},{"day":690,"growth":1.514,"series":"The rule, after costs"},{"day":700,"growth":1.521,"series":"The rule, after costs"},{"day":710,"growth":1.491,"series":"The rule, after costs"},{"day":720,"growth":1.549,"series":"The rule, after costs"},{"day":730,"growth":1.584,"series":"The rule, after costs"},{"day":740,"growth":1.555,"series":"The rule, after costs"},{"day":750,"growth":1.436,"series":"The rule, after costs"},{"day":760,"growth":1.44,"series":"The rule, after costs"},{"day":770,"growth":1.378,"series":"The rule, after costs"},{"day":780,"growth":1.345,"series":"The rule, after costs"},{"day":790,"growth":1.357,"series":"The rule, after costs"},{"day":800,"growth":1.385,"series":"The rule, after costs"},{"day":810,"growth":1.357,"series":"The rule, after costs"},{"day":820,"growth":1.327,"series":"The rule, after costs"},{"day":830,"growth":1.325,"series":"The rule, after costs"},{"day":840,"growth":1.364,"series":"The rule, after costs"},{"day":850,"growth":1.414,"series":"The rule, after costs"},{"day":860,"growth":1.398,"series":"The rule, after costs"},{"day":870,"growth":1.505,"series":"The rule, after costs"},{"day":880,"growth":1.539,"series":"The rule, after costs"},{"day":890,"growth":1.598,"series":"The rule, after costs"},{"day":900,"growth":1.573,"series":"The rule, after costs"},{"day":910,"growth":1.618,"series":"The rule, after costs"},{"day":920,"growth":1.693,"series":"The rule, after costs"},{"day":930,"growth":1.71,"series":"The rule, after costs"},{"day":940,"growth":1.779,"series":"The rule, after costs"},{"day":950,"growth":1.819,"series":"The rule, after costs"},{"day":960,"growth":1.921,"series":"The rule, after costs"},{"day":970,"growth":1.943,"series":"The rule, after costs"},{"day":980,"growth":1.937,"series":"The rule, after costs"},{"day":990,"growth":1.868,"series":"The rule, after costs"},{"day":1000,"growth":1.877,"series":"The rule, after costs"},{"day":1010,"growth":1.885,"series":"The rule, after costs"},{"day":1020,"growth":2.029,"series":"The rule, after costs"},{"day":1030,"growth":2.037,"series":"The rule, after costs"},{"day":1040,"growth":2.027,"series":"The rule, after costs"},{"day":1050,"growth":2.034,"series":"The rule, after costs"},{"day":1060,"growth":2.197,"series":"The rule, after costs"},{"day":1070,"growth":2.238,"series":"The rule, after costs"},{"day":1080,"growth":2.225,"series":"The rule, after costs"},{"day":1090,"growth":2.214,"series":"The rule, after costs"},{"day":1100,"growth":2.176,"series":"The rule, after costs"},{"day":1110,"growth":2.122,"series":"The rule, after costs"},{"day":1120,"growth":2.234,"series":"The rule, after costs"},{"day":1130,"growth":2.2,"series":"The rule, after costs"},{"day":1140,"growth":2.086,"series":"The rule, after costs"},{"day":1150,"growth":2.077,"series":"The rule, after costs"},{"day":1160,"growth":2.076,"series":"The rule, after costs"},{"day":1170,"growth":1.933,"series":"The rule, after costs"},{"day":1180,"growth":1.974,"series":"The rule, after costs"},{"day":1190,"growth":1.987,"series":"The rule, after costs"},{"day":1200,"growth":1.971,"series":"The rule, after costs"},{"day":1210,"growth":2.019,"series":"The rule, after costs"},{"day":1220,"growth":1.936,"series":"The rule, after costs"},{"day":1230,"growth":1.99,"series":"The rule, after costs"},{"day":1240,"growth":1.824,"series":"The rule, after costs"},{"day":1250,"growth":1.794,"series":"The rule, after costs"},{"day":1260,"growth":1.79,"series":"The rule, after costs"},{"day":1270,"growth":1.831,"series":"The rule, after costs"},{"day":1280,"growth":1.845,"series":"The rule, after costs"},{"day":1290,"growth":1.848,"series":"The rule, after costs"},{"day":1300,"growth":1.858,"series":"The rule, after costs"},{"day":1310,"growth":1.925,"series":"The rule, after costs"},{"day":1320,"growth":2.01,"series":"The rule, after costs"},{"day":1330,"growth":2.009,"series":"The rule, after costs"},{"day":1340,"growth":1.971,"series":"The rule, after costs"},{"day":1350,"growth":1.806,"series":"The rule, after costs"},{"day":1360,"growth":1.784,"series":"The rule, after costs"},{"day":1370,"growth":1.801,"series":"The rule, after costs"},{"day":1380,"growth":1.895,"series":"The rule, after costs"},{"day":1390,"growth":2.027,"series":"The rule, after costs"},{"day":1400,"growth":2.072,"series":"The rule, after costs"},{"day":1410,"growth":1.928,"series":"The rule, after costs"},{"day":1420,"growth":1.897,"series":"The rule, after costs"},{"day":1430,"growth":1.909,"series":"The rule, after costs"},{"day":1440,"growth":1.919,"series":"The rule, after costs"},{"day":1450,"growth":1.858,"series":"The rule, after costs"},{"day":1460,"growth":1.899,"series":"The rule, after costs"},{"day":1470,"growth":1.946,"series":"The rule, after costs"},{"day":1480,"growth":2.002,"series":"The rule, after costs"},{"day":1490,"growth":2.067,"series":"The rule, after costs"},{"day":1500,"growth":2.108,"series":"The rule, after costs"},{"day":1510,"growth":2.079,"series":"The rule, after costs"},{"day":1520,"growth":2.022,"series":"The rule, after costs"},{"day":1530,"growth":2.125,"series":"The rule, after costs"},{"day":1540,"growth":2.107,"series":"The rule, after costs"},{"day":1550,"growth":2.161,"series":"The rule, after costs"},{"day":1560,"growth":2.312,"series":"The rule, after costs"},{"day":1570,"growth":2.469,"series":"The rule, after costs"},{"day":1580,"growth":2.499,"series":"The rule, after costs"},{"day":1590,"growth":2.628,"series":"The rule, after costs"},{"day":1600,"growth":2.698,"series":"The rule, after costs"},{"day":1610,"growth":2.741,"series":"The rule, after costs"},{"day":1620,"growth":2.679,"series":"The rule, after costs"},{"day":1630,"growth":2.658,"series":"The rule, after costs"},{"day":1640,"growth":2.612,"series":"The rule, after costs"},{"day":1650,"growth":2.651,"series":"The rule, after costs"},{"day":1660,"growth":2.629,"series":"The rule, after costs"},{"day":1670,"growth":2.686,"series":"The rule, after costs"},{"day":1680,"growth":2.835,"series":"The rule, after costs"},{"day":1690,"growth":2.869,"series":"The rule, after costs"},{"day":1700,"growth":2.885,"series":"The rule, after costs"},{"day":1710,"growth":2.835,"series":"The rule, after costs"},{"day":1720,"growth":2.729,"series":"The rule, after costs"},{"day":1730,"growth":2.681,"series":"The rule, after costs"},{"day":1740,"growth":2.508,"series":"The rule, after costs"},{"day":0,"growth":1.009,"series":"Buy and hold"},{"day":10,"growth":0.99,"series":"Buy and hold"},{"day":20,"growth":0.974,"series":"Buy and hold"},{"day":30,"growth":0.941,"series":"Buy and hold"},{"day":40,"growth":0.896,"series":"Buy and hold"},{"day":50,"growth":0.885,"series":"Buy and hold"},{"day":60,"growth":0.887,"series":"Buy and hold"},{"day":70,"growth":0.896,"series":"Buy and hold"},{"day":80,"growth":0.918,"series":"Buy and hold"},{"day":90,"growth":0.914,"series":"Buy and hold"},{"day":100,"growth":0.92,"series":"Buy and hold"},{"day":110,"growth":0.954,"series":"Buy and hold"},{"day":120,"growth":0.992,"series":"Buy and hold"},{"day":130,"growth":1.002,"series":"Buy and hold"},{"day":140,"growth":0.95,"series":"Buy and hold"},{"day":150,"growth":0.999,"series":"Buy and hold"},{"day":160,"growth":0.958,"series":"Buy and hold"},{"day":170,"growth":0.97,"series":"Buy and hold"},{"day":180,"growth":0.979,"series":"Buy and hold"},{"day":190,"growth":1.002,"series":"Buy and hold"},{"day":200,"growth":1.018,"series":"Buy and hold"},{"day":210,"growth":1.054,"series":"Buy and hold"},{"day":220,"growth":1.087,"series":"Buy and hold"},{"day":230,"growth":1.148,"series":"Buy and hold"},{"day":240,"growth":1.141,"series":"Buy and hold"},{"day":250,"growth":1.096,"series":"Buy and hold"},{"day":260,"growth":1.106,"series":"Buy and hold"},{"day":270,"growth":1.114,"series":"Buy and hold"},{"day":280,"growth":1.118,"series":"Buy and hold"},{"day":290,"growth":1.092,"series":"Buy and hold"},{"day":300,"growth":1.066,"series":"Buy and hold"},{"day":310,"growth":1.056,"series":"Buy and hold"},{"day":320,"growth":1.06,"series":"Buy and hold"},{"day":330,"growth":1.067,"series":"Buy and hold"},{"day":340,"growth":1.095,"series":"Buy and hold"},{"day":350,"growth":1.115,"series":"Buy and hold"},{"day":360,"growth":1.12,"series":"Buy and hold"},{"day":370,"growth":1.132,"series":"Buy and hold"},{"day":380,"growth":1.094,"series":"Buy and hold"},{"day":390,"growth":1.093,"series":"Buy and hold"},{"day":400,"growth":1.075,"series":"Buy and hold"},{"day":410,"growth":1.048,"series":"Buy and hold"},{"day":420,"growth":1.075,"series":"Buy and hold"},{"day":430,"growth":1.089,"series":"Buy and hold"},{"day":440,"growth":1.078,"series":"Buy and hold"},{"day":450,"growth":1.071,"series":"Buy and hold"},{"day":460,"growth":1.092,"series":"Buy and hold"},{"day":470,"growth":1.139,"series":"Buy and hold"},{"day":480,"growth":1.073,"series":"Buy and hold"},{"day":490,"growth":1.078,"series":"Buy and hold"},{"day":500,"growth":1.097,"series":"Buy and hold"},{"day":510,"growth":1.071,"series":"Buy and hold"},{"day":520,"growth":1.094,"series":"Buy and hold"},{"day":530,"growth":1.08,"series":"Buy and hold"},{"day":540,"growth":1.048,"series":"Buy and hold"},{"day":550,"growth":1,"series":"Buy and hold"},{"day":560,"growth":0.98,"series":"Buy and hold"},{"day":570,"growth":0.973,"series":"Buy and hold"},{"day":580,"growth":0.937,"series":"Buy and hold"},{"day":590,"growth":0.962,"series":"Buy and hold"},{"day":600,"growth":0.958,"series":"Buy and hold"},{"day":610,"growth":0.95,"series":"Buy and hold"},{"day":620,"growth":0.97,"series":"Buy and hold"},{"day":630,"growth":0.945,"series":"Buy and hold"},{"day":640,"growth":0.967,"series":"Buy and hold"},{"day":650,"growth":0.929,"series":"Buy and hold"},{"day":660,"growth":0.974,"series":"Buy and hold"},{"day":670,"growth":1.011,"series":"Buy and hold"},{"day":680,"growth":1.018,"series":"Buy and hold"},{"day":690,"growth":1.033,"series":"Buy and hold"},{"day":700,"growth":1.038,"series":"Buy and hold"},{"day":710,"growth":1.018,"series":"Buy and hold"},{"day":720,"growth":1.057,"series":"Buy and hold"},{"day":730,"growth":1.081,"series":"Buy and hold"},{"day":740,"growth":1.061,"series":"Buy and hold"},{"day":750,"growth":0.98,"series":"Buy and hold"},{"day":760,"growth":0.959,"series":"Buy and hold"},{"day":770,"growth":1.002,"series":"Buy and hold"},{"day":780,"growth":1.026,"series":"Buy and hold"},{"day":790,"growth":1.016,"series":"Buy and hold"},{"day":800,"growth":1.04,"series":"Buy and hold"},{"day":810,"growth":1.019,"series":"Buy and hold"},{"day":820,"growth":0.996,"series":"Buy and hold"},{"day":830,"growth":0.997,"series":"Buy and hold"},{"day":840,"growth":0.967,"series":"Buy and hold"},{"day":850,"growth":0.932,"series":"Buy and hold"},{"day":860,"growth":0.941,"series":"Buy and hold"},{"day":870,"growth":0.874,"series":"Buy and hold"},{"day":880,"growth":0.854,"series":"Buy and hold"},{"day":890,"growth":0.822,"series":"Buy and hold"},{"day":900,"growth":0.834,"series":"Buy and hold"},{"day":910,"growth":0.81,"series":"Buy and hold"},{"day":920,"growth":0.773,"series":"Buy and hold"},{"day":930,"growth":0.765,"series":"Buy and hold"},{"day":940,"growth":0.734,"series":"Buy and hold"},{"day":950,"growth":0.717,"series":"Buy and hold"},{"day":960,"growth":0.679,"series":"Buy and hold"},{"day":970,"growth":0.67,"series":"Buy and hold"},{"day":980,"growth":0.672,"series":"Buy and hold"},{"day":990,"growth":0.696,"series":"Buy and hold"},{"day":1000,"growth":0.692,"series":"Buy and hold"},{"day":1010,"growth":0.7,"series":"Buy and hold"},{"day":1020,"growth":0.753,"series":"Buy and hold"},{"day":1030,"growth":0.756,"series":"Buy and hold"},{"day":1040,"growth":0.752,"series":"Buy and hold"},{"day":1050,"growth":0.755,"series":"Buy and hold"},{"day":1060,"growth":0.816,"series":"Buy and hold"},{"day":1070,"growth":0.831,"series":"Buy and hold"},{"day":1080,"growth":0.826,"series":"Buy and hold"},{"day":1090,"growth":0.822,"series":"Buy and hold"},{"day":1100,"growth":0.807,"series":"Buy and hold"},{"day":1110,"growth":0.787,"series":"Buy and hold"},{"day":1120,"growth":0.746,"series":"Buy and hold"},{"day":1130,"growth":0.758,"series":"Buy and hold"},{"day":1140,"growth":0.798,"series":"Buy and hold"},{"day":1150,"growth":0.8,"series":"Buy and hold"},{"day":1160,"growth":0.756,"series":"Buy and hold"},{"day":1170,"growth":0.703,"series":"Buy and hold"},{"day":1180,"growth":0.688,"series":"Buy and hold"},{"day":1190,"growth":0.683,"series":"Buy and hold"},{"day":1200,"growth":0.688,"series":"Buy and hold"},{"day":1210,"growth":0.671,"series":"Buy and hold"},{"day":1220,"growth":0.699,"series":"Buy and hold"},{"day":1230,"growth":0.679,"series":"Buy and hold"},{"day":1240,"growth":0.66,"series":"Buy and hold"},{"day":1250,"growth":0.633,"series":"Buy and hold"},{"day":1260,"growth":0.634,"series":"Buy and hold"},{"day":1270,"growth":0.619,"series":"Buy and hold"},{"day":1280,"growth":0.614,"series":"Buy and hold"},{"day":1290,"growth":0.612,"series":"Buy and hold"},{"day":1300,"growth":0.609,"series":"Buy and hold"},{"day":1310,"growth":0.587,"series":"Buy and hold"},{"day":1320,"growth":0.561,"series":"Buy and hold"},{"day":1330,"growth":0.561,"series":"Buy and hold"},{"day":1340,"growth":0.57,"series":"Buy and hold"},{"day":1350,"growth":0.621,"series":"Buy and hold"},{"day":1360,"growth":0.655,"series":"Buy and hold"},{"day":1370,"growth":0.661,"series":"Buy and hold"},{"day":1380,"growth":0.696,"series":"Buy and hold"},{"day":1390,"growth":0.744,"series":"Buy and hold"},{"day":1400,"growth":0.761,"series":"Buy and hold"},{"day":1410,"growth":0.708,"series":"Buy and hold"},{"day":1420,"growth":0.696,"series":"Buy and hold"},{"day":1430,"growth":0.7,"series":"Buy and hold"},{"day":1440,"growth":0.695,"series":"Buy and hold"},{"day":1450,"growth":0.718,"series":"Buy and hold"},{"day":1460,"growth":0.702,"series":"Buy and hold"},{"day":1470,"growth":0.684,"series":"Buy and hold"},{"day":1480,"growth":0.664,"series":"Buy and hold"},{"day":1490,"growth":0.643,"series":"Buy and hold"},{"day":1500,"growth":0.63,"series":"Buy and hold"},{"day":1510,"growth":0.639,"series":"Buy and hold"},{"day":1520,"growth":0.656,"series":"Buy and hold"},{"day":1530,"growth":0.623,"series":"Buy and hold"},{"day":1540,"growth":0.628,"series":"Buy and hold"},{"day":1550,"growth":0.612,"series":"Buy and hold"},{"day":1560,"growth":0.571,"series":"Buy and hold"},{"day":1570,"growth":0.535,"series":"Buy and hold"},{"day":1580,"growth":0.528,"series":"Buy and hold"},{"day":1590,"growth":0.501,"series":"Buy and hold"},{"day":1600,"growth":0.488,"series":"Buy and hold"},{"day":1610,"growth":0.48,"series":"Buy and hold"},{"day":1620,"growth":0.49,"series":"Buy and hold"},{"day":1630,"growth":0.494,"series":"Buy and hold"},{"day":1640,"growth":0.502,"series":"Buy and hold"},{"day":1650,"growth":0.527,"series":"Buy and hold"},{"day":1660,"growth":0.523,"series":"Buy and hold"},{"day":1670,"growth":0.534,"series":"Buy and hold"},{"day":1680,"growth":0.564,"series":"Buy and hold"},{"day":1690,"growth":0.57,"series":"Buy and hold"},{"day":1700,"growth":0.574,"series":"Buy and hold"},{"day":1710,"growth":0.564,"series":"Buy and hold"},{"day":1720,"growth":0.543,"series":"Buy and hold"},{"day":1730,"growth":0.542,"series":"Buy and hold"},{"day":1740,"growth":0.578,"series":"Buy and hold"}],"metrics":[{"period":"In sample (chosen on)","sharpe":"1.16","ret":"17.8%","dd":"21%","turn":"7.9"},{"period":"Out of sample (not seen)","sharpe":"0.54","ret":"8.6%","dd":"23%","turn":"6.8"},{"period":"Out of sample, before costs","sharpe":"0.56","ret":"8.9%","dd":"23%","turn":"6.8"}]},"root":{"type":"Page","children":[{"type":"Text","props":{"text":"The market hides a trend that flips for months at a time. A rule that follows the direction of the last few weeks can find it, and the proof is the part of the chart it was not chosen on.","muted":false}},{"type":"Text","props":{"text":"The market is simulated, with a trend planted in it by construction, so a rule that \"finds\" an edge proves the method works, not that this edge exists in a real market. Trading days are counted after warm-up; the first 1050 are in sample.","muted":true}},{"type":"Chart","props":{"title":"Trend: 30/60-day averages: growth of 1 on a simulated market (hidden trend)","mark":"line","height":220,"data":{"$state":"/growth"},"encoding":{"x":{"field":"day","type":"quantitative","title":"Trading day"},"y":{"field":"growth","type":"quantitative","title":"Growth of 1 (starts at 1)"},"color":{"field":"series","type":"nominal","title":"Series"}}}},{"type":"Table","props":{"caption":"Trend: 30/60-day averages, 5 bps per unit traded. Sharpe is annualised; turnover is position changes per year.","columns":[{"key":"period","label":"Period"},{"key":"sharpe","label":"Sharpe","align":"right"},{"key":"ret","label":"Mean yearly return","align":"right"},{"key":"dd","label":"Worst fall","align":"right"},{"key":"turn","label":"Turnover","align":"right"}],"rows":{"$state":"/metrics"}}}]}}}},{"id":"alpha-no-edge","track":"alpha","title":"The same kind of rule where there is nothing","summary":"A trend rule on a market with no edge: it can look fine in sample and has nothing out of it.","principle":"alpha-trials","tags":["alpha","backtest","algorithms"],"evidence":["lib/alpha/strategies.ts (sma, momentum, reversion)","lib/alpha/backtest.ts (backtest)","lib/alpha/research.ts (research)"],"body":{"kind":"inline-spec","spec":{"title":"A trend rule on a market with no edge","description":"Nothing here predicts anything. Any gain the rule shows is the luck of one path, and it does not carry to data it was not chosen on.","provenance":"data","state":{"growth":[{"day":0,"growth":1.011,"series":"The rule, after costs"},{"day":10,"growth":1.009,"series":"The rule, after costs"},{"day":20,"growth":1.01,"series":"The rule, after costs"},{"day":30,"growth":0.992,"series":"The rule, after costs"},{"day":40,"growth":1.004,"series":"The rule, after costs"},{"day":50,"growth":0.999,"series":"The rule, after costs"},{"day":60,"growth":0.98,"series":"The rule, after costs"},{"day":70,"growth":0.953,"series":"The rule, after costs"},{"day":80,"growth":1,"series":"The rule, after costs"},{"day":90,"growth":1.003,"series":"The rule, after costs"},{"day":100,"growth":0.997,"series":"The rule, after costs"},{"day":110,"growth":1.021,"series":"The rule, after costs"},{"day":120,"growth":1.048,"series":"The rule, after costs"},{"day":130,"growth":1.045,"series":"The rule, after costs"},{"day":140,"growth":0.978,"series":"The rule, after costs"},{"day":150,"growth":1.014,"series":"The rule, after costs"},{"day":160,"growth":1.069,"series":"The rule, after costs"},{"day":170,"growth":1.069,"series":"The rule, after costs"},{"day":180,"growth":1.073,"series":"The rule, after costs"},{"day":190,"growth":1.061,"series":"The rule, after costs"},{"day":200,"growth":1.057,"series":"The rule, after costs"},{"day":210,"growth":1.033,"series":"The rule, after costs"},{"day":220,"growth":1.015,"series":"The rule, after costs"},{"day":230,"growth":1.058,"series":"The rule, after costs"},{"day":240,"growth":1.038,"series":"The rule, after costs"},{"day":250,"growth":0.984,"series":"The rule, after costs"},{"day":260,"growth":0.98,"series":"The rule, after costs"},{"day":270,"growth":0.955,"series":"The rule, after costs"},{"day":280,"growth":0.963,"series":"The rule, after costs"},{"day":290,"growth":0.998,"series":"The rule, after costs"},{"day":300,"growth":1.034,"series":"The rule, after costs"},{"day":310,"growth":1.057,"series":"The rule, after costs"},{"day":320,"growth":1.066,"series":"The rule, after costs"},{"day":330,"growth":1.071,"series":"The rule, after costs"},{"day":340,"growth":1.057,"series":"The rule, after costs"},{"day":350,"growth":1.051,"series":"The rule, after costs"},{"day":360,"growth":1.059,"series":"The rule, after costs"},{"day":370,"growth":1.08,"series":"The rule, after costs"},{"day":380,"growth":1.061,"series":"The rule, after costs"},{"day":390,"growth":1.079,"series":"The rule, after costs"},{"day":400,"growth":1.078,"series":"The rule, after costs"},{"day":410,"growth":1.057,"series":"The rule, after costs"},{"day":420,"growth":1.025,"series":"The rule, after costs"},{"day":430,"growth":1.023,"series":"The rule, after costs"},{"day":440,"growth":1.046,"series":"The rule, after costs"},{"day":450,"growth":1.066,"series":"The rule, after costs"},{"day":460,"growth":1.058,"series":"The rule, after costs"},{"day":470,"growth":1.027,"series":"The rule, after costs"},{"day":480,"growth":1.095,"series":"The rule, after costs"},{"day":490,"growth":1.071,"series":"The rule, after costs"},{"day":500,"growth":1.034,"series":"The rule, after costs"},{"day":510,"growth":1.041,"series":"The rule, after costs"},{"day":520,"growth":1.08,"series":"The rule, after costs"},{"day":530,"growth":1.052,"series":"The rule, after costs"},{"day":540,"growth":1.011,"series":"The rule, after costs"},{"day":550,"growth":1.01,"series":"The rule, after costs"},{"day":560,"growth":1.013,"series":"The rule, after costs"},{"day":570,"growth":1.003,"series":"The rule, after costs"},{"day":580,"growth":1.035,"series":"The rule, after costs"},{"day":590,"growth":1.021,"series":"The rule, after costs"},{"day":600,"growth":1.038,"series":"The rule, after costs"},{"day":610,"growth":1.059,"series":"The rule, after costs"},{"day":620,"growth":1.051,"series":"The rule, after costs"},{"day":630,"growth":1.092,"series":"The rule, after costs"},{"day":640,"growth":1.08,"series":"The rule, after costs"},{"day":650,"growth":1.138,"series":"The rule, after costs"},{"day":660,"growth":1.099,"series":"The rule, after costs"},{"day":670,"growth":1.072,"series":"The rule, after costs"},{"day":680,"growth":1.077,"series":"The rule, after costs"},{"day":690,"growth":1.083,"series":"The rule, after costs"},{"day":700,"growth":1.074,"series":"The rule, after costs"},{"day":710,"growth":1.015,"series":"The rule, after costs"},{"day":720,"growth":0.99,"series":"The rule, after costs"},{"day":730,"growth":0.978,"series":"The rule, after costs"},{"day":740,"growth":0.96,"series":"The rule, after costs"},{"day":750,"growth":0.902,"series":"The rule, after costs"},{"day":760,"growth":0.871,"series":"The rule, after costs"},{"day":770,"growth":0.819,"series":"The rule, after costs"},{"day":780,"growth":0.786,"series":"The rule, after costs"},{"day":790,"growth":0.792,"series":"The rule, after costs"},{"day":800,"growth":0.801,"series":"The rule, after costs"},{"day":810,"growth":0.774,"series":"The rule, after costs"},{"day":820,"growth":0.77,"series":"The rule, after costs"},{"day":830,"growth":0.755,"series":"The rule, after costs"},{"day":840,"growth":0.765,"series":"The rule, after costs"},{"day":850,"growth":0.742,"series":"The rule, after costs"},{"day":860,"growth":0.762,"series":"The rule, after costs"},{"day":870,"growth":0.724,"series":"The rule, after costs"},{"day":880,"growth":0.728,"series":"The rule, after costs"},{"day":890,"growth":0.743,"series":"The rule, after costs"},{"day":900,"growth":0.719,"series":"The rule, after costs"},{"day":910,"growth":0.727,"series":"The rule, after costs"},{"day":920,"growth":0.748,"series":"The rule, after costs"},{"day":930,"growth":0.743,"series":"The rule, after costs"},{"day":940,"growth":0.76,"series":"The rule, after costs"},{"day":950,"growth":0.764,"series":"The rule, after costs"},{"day":960,"growth":0.793,"series":"The rule, after costs"},{"day":970,"growth":0.789,"series":"The rule, after costs"},{"day":980,"growth":0.778,"series":"The rule, after costs"},{"day":990,"growth":0.76,"series":"The rule, after costs"},{"day":1000,"growth":0.734,"series":"The rule, after costs"},{"day":1010,"growth":0.733,"series":"The rule, after costs"},{"day":1020,"growth":0.779,"series":"The rule, after costs"},{"day":1030,"growth":0.771,"series":"The rule, after costs"},{"day":1040,"growth":0.758,"series":"The rule, after costs"},{"day":1050,"growth":0.751,"series":"The rule, after costs"},{"day":1060,"growth":0.8,"series":"The rule, after costs"},{"day":1070,"growth":0.805,"series":"The rule, after costs"},{"day":1080,"growth":0.79,"series":"The rule, after costs"},{"day":1090,"growth":0.776,"series":"The rule, after costs"},{"day":1100,"growth":0.752,"series":"The rule, after costs"},{"day":1110,"growth":0.78,"series":"The rule, after costs"},{"day":1120,"growth":0.833,"series":"The rule, after costs"},{"day":1130,"growth":0.831,"series":"The rule, after costs"},{"day":1140,"growth":0.798,"series":"The rule, after costs"},{"day":1150,"growth":0.781,"series":"The rule, after costs"},{"day":1160,"growth":0.812,"series":"The rule, after costs"},{"day":1170,"growth":0.778,"series":"The rule, after costs"},{"day":1180,"growth":0.781,"series":"The rule, after costs"},{"day":1190,"growth":0.773,"series":"The rule, after costs"},{"day":1200,"growth":0.753,"series":"The rule, after costs"},{"day":1210,"growth":0.759,"series":"The rule, after costs"},{"day":1220,"growth":0.743,"series":"The rule, after costs"},{"day":1230,"growth":0.735,"series":"The rule, after costs"},{"day":1240,"growth":0.726,"series":"The rule, after costs"},{"day":1250,"growth":0.708,"series":"The rule, after costs"},{"day":1260,"growth":0.722,"series":"The rule, after costs"},{"day":1270,"growth":0.725,"series":"The rule, after costs"},{"day":1280,"growth":0.718,"series":"The rule, after costs"},{"day":1290,"growth":0.708,"series":"The rule, after costs"},{"day":1300,"growth":0.695,"series":"The rule, after costs"},{"day":1310,"growth":0.681,"series":"The rule, after costs"},{"day":1320,"growth":0.662,"series":"The rule, after costs"},{"day":1330,"growth":0.657,"series":"The rule, after costs"},{"day":1340,"growth":0.634,"series":"The rule, after costs"},{"day":1350,"growth":0.622,"series":"The rule, after costs"},{"day":1360,"growth":0.647,"series":"The rule, after costs"},{"day":1370,"growth":0.645,"series":"The rule, after costs"},{"day":1380,"growth":0.67,"series":"The rule, after costs"},{"day":1390,"growth":0.707,"series":"The rule, after costs"},{"day":1400,"growth":0.714,"series":"The rule, after costs"},{"day":1410,"growth":0.656,"series":"The rule, after costs"},{"day":1420,"growth":0.65,"series":"The rule, after costs"},{"day":1430,"growth":0.656,"series":"The rule, after costs"},{"day":1440,"growth":0.648,"series":"The rule, after costs"},{"day":1450,"growth":0.617,"series":"The rule, after costs"},{"day":1460,"growth":0.606,"series":"The rule, after costs"},{"day":1470,"growth":0.601,"series":"The rule, after costs"},{"day":1480,"growth":0.594,"series":"The rule, after costs"},{"day":1490,"growth":0.585,"series":"The rule, after costs"},{"day":1500,"growth":0.586,"series":"The rule, after costs"},{"day":1510,"growth":0.568,"series":"The rule, after costs"},{"day":1520,"growth":0.543,"series":"The rule, after costs"},{"day":1530,"growth":0.526,"series":"The rule, after costs"},{"day":1540,"growth":0.539,"series":"The rule, after costs"},{"day":1550,"growth":0.534,"series":"The rule, after costs"},{"day":1560,"growth":0.507,"series":"The rule, after costs"},{"day":1570,"growth":0.524,"series":"The rule, after costs"},{"day":1580,"growth":0.521,"series":"The rule, after costs"},{"day":1590,"growth":0.539,"series":"The rule, after costs"},{"day":1600,"growth":0.544,"series":"The rule, after costs"},{"day":1610,"growth":0.544,"series":"The rule, after costs"},{"day":1620,"growth":0.532,"series":"The rule, after costs"},{"day":1630,"growth":0.535,"series":"The rule, after costs"},{"day":1640,"growth":0.549,"series":"The rule, after costs"},{"day":1650,"growth":0.569,"series":"The rule, after costs"},{"day":1660,"growth":0.557,"series":"The rule, after costs"},{"day":1670,"growth":0.562,"series":"The rule, after costs"},{"day":1680,"growth":0.586,"series":"The rule, after costs"},{"day":1690,"growth":0.585,"series":"The rule, after costs"},{"day":1700,"growth":0.581,"series":"The rule, after costs"},{"day":1710,"growth":0.563,"series":"The rule, after costs"},{"day":1720,"growth":0.558,"series":"The rule, after costs"},{"day":1730,"growth":0.565,"series":"The rule, after costs"},{"day":1740,"growth":0.536,"series":"The rule, after costs"},{"day":0,"growth":1.011,"series":"Buy and hold"},{"day":10,"growth":1.009,"series":"Buy and hold"},{"day":20,"growth":1.01,"series":"Buy and hold"},{"day":30,"growth":0.992,"series":"Buy and hold"},{"day":40,"growth":0.961,"series":"Buy and hold"},{"day":50,"growth":0.965,"series":"Buy and hold"},{"day":60,"growth":0.984,"series":"Buy and hold"},{"day":70,"growth":1.011,"series":"Buy and hold"},{"day":80,"growth":1.054,"series":"Buy and hold"},{"day":90,"growth":1.057,"series":"Buy and hold"},{"day":100,"growth":1.05,"series":"Buy and hold"},{"day":110,"growth":1.076,"series":"Buy and hold"},{"day":120,"growth":1.104,"series":"Buy and hold"},{"day":130,"growth":1.101,"series":"Buy and hold"},{"day":140,"growth":1.03,"series":"Buy and hold"},{"day":150,"growth":1.069,"series":"Buy and hold"},{"day":160,"growth":1.012,"series":"Buy and hold"},{"day":170,"growth":1.011,"series":"Buy and hold"},{"day":180,"growth":1.007,"series":"Buy and hold"},{"day":190,"growth":1.018,"series":"Buy and hold"},{"day":200,"growth":1.021,"series":"Buy and hold"},{"day":210,"growth":1.044,"series":"Buy and hold"},{"day":220,"growth":1.063,"series":"Buy and hold"},{"day":230,"growth":1.108,"series":"Buy and hold"},{"day":240,"growth":1.086,"series":"Buy and hold"},{"day":250,"growth":1.03,"series":"Buy and hold"},{"day":260,"growth":1.026,"series":"Buy and hold"},{"day":270,"growth":1.02,"series":"Buy and hold"},{"day":280,"growth":1.01,"series":"Buy and hold"},{"day":290,"growth":0.974,"series":"Buy and hold"},{"day":300,"growth":0.939,"series":"Buy and hold"},{"day":310,"growth":0.918,"series":"Buy and hold"},{"day":320,"growth":0.909,"series":"Buy and hold"},{"day":330,"growth":0.904,"series":"Buy and hold"},{"day":340,"growth":0.915,"series":"Buy and hold"},{"day":350,"growth":0.92,"series":"Buy and hold"},{"day":360,"growth":0.912,"series":"Buy and hold"},{"day":370,"growth":0.924,"series":"Buy and hold"},{"day":380,"growth":0.908,"series":"Buy and hold"},{"day":390,"growth":0.923,"series":"Buy and hold"},{"day":400,"growth":0.923,"series":"Buy and hold"},{"day":410,"growth":0.905,"series":"Buy and hold"},{"day":420,"growth":0.916,"series":"Buy and hold"},{"day":430,"growth":0.916,"series":"Buy and hold"},{"day":440,"growth":0.895,"series":"Buy and hold"},{"day":450,"growth":0.878,"series":"Buy and hold"},{"day":460,"growth":0.883,"series":"Buy and hold"},{"day":470,"growth":0.909,"series":"Buy and hold"},{"day":480,"growth":0.851,"series":"Buy and hold"},{"day":490,"growth":0.869,"series":"Buy and hold"},{"day":500,"growth":0.9,"series":"Buy and hold"},{"day":510,"growth":0.893,"series":"Buy and hold"},{"day":520,"growth":0.92,"series":"Buy and hold"},{"day":530,"growth":0.896,"series":"Buy and hold"},{"day":540,"growth":0.861,"series":"Buy and hold"},{"day":550,"growth":0.836,"series":"Buy and hold"},{"day":560,"growth":0.833,"series":"Buy and hold"},{"day":570,"growth":0.841,"series":"Buy and hold"},{"day":580,"growth":0.815,"series":"Buy and hold"},{"day":590,"growth":0.826,"series":"Buy and hold"},{"day":600,"growth":0.811,"series":"Buy and hold"},{"day":610,"growth":0.794,"series":"Buy and hold"},{"day":620,"growth":0.8,"series":"Buy and hold"},{"day":630,"growth":0.77,"series":"Buy and hold"},{"day":640,"growth":0.778,"series":"Buy and hold"},{"day":650,"growth":0.738,"series":"Buy and hold"},{"day":660,"growth":0.763,"series":"Buy and hold"},{"day":670,"growth":0.782,"series":"Buy and hold"},{"day":680,"growth":0.777,"series":"Buy and hold"},{"day":690,"growth":0.778,"series":"Buy and hold"},{"day":700,"growth":0.772,"series":"Buy and hold"},{"day":710,"growth":0.747,"series":"Buy and hold"},{"day":720,"growth":0.766,"series":"Buy and hold"},{"day":730,"growth":0.773,"series":"Buy and hold"},{"day":740,"growth":0.763,"series":"Buy and hold"},{"day":750,"growth":0.717,"series":"Buy and hold"},{"day":760,"growth":0.714,"series":"Buy and hold"},{"day":770,"growth":0.758,"series":"Buy and hold"},{"day":780,"growth":0.789,"series":"Buy and hold"},{"day":790,"growth":0.778,"series":"Buy and hold"},{"day":800,"growth":0.787,"series":"Buy and hold"},{"day":810,"growth":0.761,"series":"Buy and hold"},{"day":820,"growth":0.757,"series":"Buy and hold"},{"day":830,"growth":0.77,"series":"Buy and hold"},{"day":840,"growth":0.76,"series":"Buy and hold"},{"day":850,"growth":0.745,"series":"Buy and hold"},{"day":860,"growth":0.765,"series":"Buy and hold"},{"day":870,"growth":0.723,"series":"Buy and hold"},{"day":880,"growth":0.718,"series":"Buy and hold"},{"day":890,"growth":0.703,"series":"Buy and hold"},{"day":900,"growth":0.726,"series":"Buy and hold"},{"day":910,"growth":0.717,"series":"Buy and hold"},{"day":920,"growth":0.696,"series":"Buy and hold"},{"day":930,"growth":0.7,"series":"Buy and hold"},{"day":940,"growth":0.684,"series":"Buy and hold"},{"day":950,"growth":0.68,"series":"Buy and hold"},{"day":960,"growth":0.654,"series":"Buy and hold"},{"day":970,"growth":0.657,"series":"Buy and hold"},{"day":980,"growth":0.666,"series":"Buy and hold"},{"day":990,"growth":0.682,"series":"Buy and hold"},{"day":1000,"growth":0.668,"series":"Buy and hold"},{"day":1010,"growth":0.667,"series":"Buy and hold"},{"day":1020,"growth":0.709,"series":"Buy and hold"},{"day":1030,"growth":0.702,"series":"Buy and hold"},{"day":1040,"growth":0.69,"series":"Buy and hold"},{"day":1050,"growth":0.683,"series":"Buy and hold"},{"day":1060,"growth":0.729,"series":"Buy and hold"},{"day":1070,"growth":0.733,"series":"Buy and hold"},{"day":1080,"growth":0.719,"series":"Buy and hold"},{"day":1090,"growth":0.706,"series":"Buy and hold"},{"day":1100,"growth":0.685,"series":"Buy and hold"},{"day":1110,"growth":0.659,"series":"Buy and hold"},{"day":1120,"growth":0.617,"series":"Buy and hold"},{"day":1130,"growth":0.618,"series":"Buy and hold"},{"day":1140,"growth":0.643,"series":"Buy and hold"},{"day":1150,"growth":0.655,"series":"Buy and hold"},{"day":1160,"growth":0.63,"series":"Buy and hold"},{"day":1170,"growth":0.596,"series":"Buy and hold"},{"day":1180,"growth":0.593,"series":"Buy and hold"},{"day":1190,"growth":0.599,"series":"Buy and hold"},{"day":1200,"growth":0.613,"series":"Buy and hold"},{"day":1210,"growth":0.609,"series":"Buy and hold"},{"day":1220,"growth":0.645,"series":"Buy and hold"},{"day":1230,"growth":0.638,"series":"Buy and hold"},{"day":1240,"growth":0.63,"series":"Buy and hold"},{"day":1250,"growth":0.615,"series":"Buy and hold"},{"day":1260,"growth":0.627,"series":"Buy and hold"},{"day":1270,"growth":0.622,"series":"Buy and hold"},{"day":1280,"growth":0.627,"series":"Buy and hold"},{"day":1290,"growth":0.637,"series":"Buy and hold"},{"day":1300,"growth":0.644,"series":"Buy and hold"},{"day":1310,"growth":0.631,"series":"Buy and hold"},{"day":1320,"growth":0.614,"series":"Buy and hold"},{"day":1330,"growth":0.624,"series":"Buy and hold"},{"day":1340,"growth":0.646,"series":"Buy and hold"},{"day":1350,"growth":0.703,"series":"Buy and hold"},{"day":1360,"growth":0.731,"series":"Buy and hold"},{"day":1370,"growth":0.728,"series":"Buy and hold"},{"day":1380,"growth":0.757,"series":"Buy and hold"},{"day":1390,"growth":0.799,"series":"Buy and hold"},{"day":1400,"growth":0.806,"series":"Buy and hold"},{"day":1410,"growth":0.74,"series":"Buy and hold"},{"day":1420,"growth":0.734,"series":"Buy and hold"},{"day":1430,"growth":0.75,"series":"Buy and hold"},{"day":1440,"growth":0.759,"series":"Buy and hold"},{"day":1450,"growth":0.797,"series":"Buy and hold"},{"day":1460,"growth":0.792,"series":"Buy and hold"},{"day":1470,"growth":0.785,"series":"Buy and hold"},{"day":1480,"growth":0.776,"series":"Buy and hold"},{"day":1490,"growth":0.764,"series":"Buy and hold"},{"day":1500,"growth":0.761,"series":"Buy and hold"},{"day":1510,"growth":0.785,"series":"Buy and hold"},{"day":1520,"growth":0.82,"series":"Buy and hold"},{"day":1530,"growth":0.793,"series":"Buy and hold"},{"day":1540,"growth":0.812,"series":"Buy and hold"},{"day":1550,"growth":0.805,"series":"Buy and hold"},{"day":1560,"growth":0.765,"series":"Buy and hold"},{"day":1570,"growth":0.728,"series":"Buy and hold"},{"day":1580,"growth":0.731,"series":"Buy and hold"},{"day":1590,"growth":0.706,"series":"Buy and hold"},{"day":1600,"growth":0.699,"series":"Buy and hold"},{"day":1610,"growth":0.699,"series":"Buy and hold"},{"day":1620,"growth":0.714,"series":"Buy and hold"},{"day":1630,"growth":0.709,"series":"Buy and hold"},{"day":1640,"growth":0.712,"series":"Buy and hold"},{"day":1650,"growth":0.738,"series":"Buy and hold"},{"day":1660,"growth":0.722,"series":"Buy and hold"},{"day":1670,"growth":0.729,"series":"Buy and hold"},{"day":1680,"growth":0.759,"series":"Buy and hold"},{"day":1690,"growth":0.758,"series":"Buy and hold"},{"day":1700,"growth":0.753,"series":"Buy and hold"},{"day":1710,"growth":0.73,"series":"Buy and hold"},{"day":1720,"growth":0.694,"series":"Buy and hold"},{"day":1730,"growth":0.684,"series":"Buy and hold"},{"day":1740,"growth":0.72,"series":"Buy and hold"}],"metrics":[{"period":"In sample (chosen on)","sharpe":"-0.40","ret":"-6.1%","dd":"38%","turn":"9.8"},{"period":"Out of sample (not seen)","sharpe":"-0.68","ret":"-10.8%","dd":"40%","turn":"11.2"},{"period":"Out of sample, before costs","sharpe":"-0.65","ret":"-10.2%","dd":"39%","turn":"11.2"}]},"root":{"type":"Page","children":[{"type":"Text","props":{"text":"Nothing here predicts anything. Any gain the rule shows is the luck of one path, and it does not carry to data it was not chosen on.","muted":false}},{"type":"Text","props":{"text":"The market is simulated, with no edge planted in it, so a rule that \"finds\" an edge proves the method works, not that this edge exists in a real market. Trading days are counted after warm-up; the first 1050 are in sample.","muted":true}},{"type":"Chart","props":{"title":"Trend: 30/60-day averages: growth of 1 on a simulated market (no edge)","mark":"line","height":220,"data":{"$state":"/growth"},"encoding":{"x":{"field":"day","type":"quantitative","title":"Trading day"},"y":{"field":"growth","type":"quantitative","title":"Growth of 1 (starts at 1)"},"color":{"field":"series","type":"nominal","title":"Series"}}}},{"type":"Table","props":{"caption":"Trend: 30/60-day averages, 5 bps per unit traded. Sharpe is annualised; turnover is position changes per year.","columns":[{"key":"period","label":"Period"},{"key":"sharpe","label":"Sharpe","align":"right"},{"key":"ret","label":"Mean yearly return","align":"right"},{"key":"dd","label":"Worst fall","align":"right"},{"key":"turn","label":"Turnover","align":"right"}],"rows":{"$state":"/metrics"}}}]}}}},{"id":"alpha-costs","track":"alpha","title":"A rule that trades too much","summary":"A short-lookback reversion rule: before costs it looks like something, after costs it does not.","principle":"alpha-costs","tags":["alpha","backtest","algorithms"],"evidence":["lib/alpha/strategies.ts (sma, momentum, reversion)","lib/alpha/backtest.ts (backtest)","lib/alpha/research.ts (research)"],"body":{"kind":"inline-spec","spec":{"title":"A fast rule and its costs","description":"This rule flips its position many times a year. Compare the last two rows of the table: what it earns before costs, and what is left after.","provenance":"data","state":{"growth":[{"day":0,"growth":1.009,"series":"The rule, after costs"},{"day":10,"growth":1.028,"series":"The rule, after costs"},{"day":20,"growth":1.012,"series":"The rule, after costs"},{"day":30,"growth":1.012,"series":"The rule, after costs"},{"day":40,"growth":1.008,"series":"The rule, after costs"},{"day":50,"growth":1.004,"series":"The rule, after costs"},{"day":60,"growth":1.012,"series":"The rule, after costs"},{"day":70,"growth":0.989,"series":"The rule, after costs"},{"day":80,"growth":0.95,"series":"The rule, after costs"},{"day":90,"growth":0.963,"series":"The rule, after costs"},{"day":100,"growth":0.956,"series":"The rule, after costs"},{"day":110,"growth":0.964,"series":"The rule, after costs"},{"day":120,"growth":0.942,"series":"The rule, after costs"},{"day":130,"growth":0.934,"series":"The rule, after costs"},{"day":140,"growth":0.9,"series":"The rule, after costs"},{"day":150,"growth":0.903,"series":"The rule, after costs"},{"day":160,"growth":0.866,"series":"The rule, after costs"},{"day":170,"growth":0.852,"series":"The rule, after costs"},{"day":180,"growth":0.858,"series":"The rule, after costs"},{"day":190,"growth":0.868,"series":"The rule, after costs"},{"day":200,"growth":0.854,"series":"The rule, after costs"},{"day":210,"growth":0.818,"series":"The rule, after costs"},{"day":220,"growth":0.809,"series":"The rule, after costs"},{"day":230,"growth":0.784,"series":"The rule, after costs"},{"day":240,"growth":0.766,"series":"The rule, after costs"},{"day":250,"growth":0.727,"series":"The rule, after costs"},{"day":260,"growth":0.712,"series":"The rule, after costs"},{"day":270,"growth":0.71,"series":"The rule, after costs"},{"day":280,"growth":0.717,"series":"The rule, after costs"},{"day":290,"growth":0.716,"series":"The rule, after costs"},{"day":300,"growth":0.685,"series":"The rule, after costs"},{"day":310,"growth":0.677,"series":"The rule, after costs"},{"day":320,"growth":0.681,"series":"The rule, after costs"},{"day":330,"growth":0.687,"series":"The rule, after costs"},{"day":340,"growth":0.672,"series":"The rule, after costs"},{"day":350,"growth":0.68,"series":"The rule, after costs"},{"day":360,"growth":0.689,"series":"The rule, after costs"},{"day":370,"growth":0.695,"series":"The rule, after costs"},{"day":380,"growth":0.678,"series":"The rule, after costs"},{"day":390,"growth":0.682,"series":"The rule, after costs"},{"day":400,"growth":0.661,"series":"The rule, after costs"},{"day":410,"growth":0.635,"series":"The rule, after costs"},{"day":420,"growth":0.629,"series":"The rule, after costs"},{"day":430,"growth":0.637,"series":"The rule, after costs"},{"day":440,"growth":0.623,"series":"The rule, after costs"},{"day":450,"growth":0.617,"series":"The rule, after costs"},{"day":460,"growth":0.632,"series":"The rule, after costs"},{"day":470,"growth":0.629,"series":"The rule, after costs"},{"day":480,"growth":0.606,"series":"The rule, after costs"},{"day":490,"growth":0.61,"series":"The rule, after costs"},{"day":500,"growth":0.599,"series":"The rule, after costs"},{"day":510,"growth":0.587,"series":"The rule, after costs"},{"day":520,"growth":0.577,"series":"The rule, after costs"},{"day":530,"growth":0.571,"series":"The rule, after costs"},{"day":540,"growth":0.557,"series":"The rule, after costs"},{"day":550,"growth":0.549,"series":"The rule, after costs"},{"day":560,"growth":0.547,"series":"The rule, after costs"},{"day":570,"growth":0.543,"series":"The rule, after costs"},{"day":580,"growth":0.527,"series":"The rule, after costs"},{"day":590,"growth":0.531,"series":"The rule, after costs"},{"day":600,"growth":0.519,"series":"The rule, after costs"},{"day":610,"growth":0.516,"series":"The rule, after costs"},{"day":620,"growth":0.516,"series":"The rule, after costs"},{"day":630,"growth":0.5,"series":"The rule, after costs"},{"day":640,"growth":0.51,"series":"The rule, after costs"},{"day":650,"growth":0.492,"series":"The rule, after costs"},{"day":660,"growth":0.493,"series":"The rule, after costs"},{"day":670,"growth":0.49,"series":"The rule, after costs"},{"day":680,"growth":0.488,"series":"The rule, after costs"},{"day":690,"growth":0.486,"series":"The rule, after costs"},{"day":700,"growth":0.502,"series":"The rule, after costs"},{"day":710,"growth":0.48,"series":"The rule, after costs"},{"day":720,"growth":0.467,"series":"The rule, after costs"},{"day":730,"growth":0.459,"series":"The rule, after costs"},{"day":740,"growth":0.459,"series":"The rule, after costs"},{"day":750,"growth":0.444,"series":"The rule, after costs"},{"day":760,"growth":0.445,"series":"The rule, after costs"},{"day":770,"growth":0.432,"series":"The rule, after costs"},{"day":780,"growth":0.426,"series":"The rule, after costs"},{"day":790,"growth":0.432,"series":"The rule, after costs"},{"day":800,"growth":0.428,"series":"The rule, after costs"},{"day":810,"growth":0.426,"series":"The rule, after costs"},{"day":820,"growth":0.407,"series":"The rule, after costs"},{"day":830,"growth":0.412,"series":"The rule, after costs"},{"day":840,"growth":0.414,"series":"The rule, after costs"},{"day":850,"growth":0.402,"series":"The rule, after costs"},{"day":860,"growth":0.411,"series":"The rule, after costs"},{"day":870,"growth":0.4,"series":"The rule, after costs"},{"day":880,"growth":0.4,"series":"The rule, after costs"},{"day":890,"growth":0.398,"series":"The rule, after costs"},{"day":900,"growth":0.38,"series":"The rule, after costs"},{"day":910,"growth":0.387,"series":"The rule, after costs"},{"day":920,"growth":0.379,"series":"The rule, after costs"},{"day":930,"growth":0.368,"series":"The rule, after costs"},{"day":940,"growth":0.37,"series":"The rule, after costs"},{"day":950,"growth":0.36,"series":"The rule, after costs"},{"day":960,"growth":0.362,"series":"The rule, after costs"},{"day":970,"growth":0.365,"series":"The rule, after costs"},{"day":980,"growth":0.367,"series":"The rule, after costs"},{"day":990,"growth":0.364,"series":"The rule, after costs"},{"day":1000,"growth":0.379,"series":"The rule, after costs"},{"day":1010,"growth":0.386,"series":"The rule, after costs"},{"day":1020,"growth":0.385,"series":"The rule, after costs"},{"day":1030,"growth":0.397,"series":"The rule, after costs"},{"day":1040,"growth":0.4,"series":"The rule, after costs"},{"day":1050,"growth":0.405,"series":"The rule, after costs"},{"day":1060,"growth":0.389,"series":"The rule, after costs"},{"day":1070,"growth":0.389,"series":"The rule, after costs"},{"day":1080,"growth":0.398,"series":"The rule, after costs"},{"day":1090,"growth":0.401,"series":"The rule, after costs"},{"day":1100,"growth":0.403,"series":"The rule, after costs"},{"day":1110,"growth":0.394,"series":"The rule, after costs"},{"day":1120,"growth":0.371,"series":"The rule, after costs"},{"day":1130,"growth":0.37,"series":"The rule, after costs"},{"day":1140,"growth":0.367,"series":"The rule, after costs"},{"day":1150,"growth":0.357,"series":"The rule, after costs"},{"day":1160,"growth":0.355,"series":"The rule, after costs"},{"day":1170,"growth":0.344,"series":"The rule, after costs"},{"day":1180,"growth":0.33,"series":"The rule, after costs"},{"day":1190,"growth":0.334,"series":"The rule, after costs"},{"day":1200,"growth":0.324,"series":"The rule, after costs"},{"day":1210,"growth":0.323,"series":"The rule, after costs"},{"day":1220,"growth":0.314,"series":"The rule, after costs"},{"day":1230,"growth":0.303,"series":"The rule, after costs"},{"day":1240,"growth":0.292,"series":"The rule, after costs"},{"day":1250,"growth":0.29,"series":"The rule, after costs"},{"day":1260,"growth":0.282,"series":"The rule, after costs"},{"day":1270,"growth":0.284,"series":"The rule, after costs"},{"day":1280,"growth":0.279,"series":"The rule, after costs"},{"day":1290,"growth":0.278,"series":"The rule, after costs"},{"day":1300,"growth":0.278,"series":"The rule, after costs"},{"day":1310,"growth":0.28,"series":"The rule, after costs"},{"day":1320,"growth":0.283,"series":"The rule, after costs"},{"day":1330,"growth":0.283,"series":"The rule, after costs"},{"day":1340,"growth":0.276,"series":"The rule, after costs"},{"day":1350,"growth":0.26,"series":"The rule, after costs"},{"day":1360,"growth":0.261,"series":"The rule, after costs"},{"day":1370,"growth":0.265,"series":"The rule, after costs"},{"day":1380,"growth":0.259,"series":"The rule, after costs"},{"day":1390,"growth":0.251,"series":"The rule, after costs"},{"day":1400,"growth":0.247,"series":"The rule, after costs"},{"day":1410,"growth":0.232,"series":"The rule, after costs"},{"day":1420,"growth":0.229,"series":"The rule, after costs"},{"day":1430,"growth":0.231,"series":"The rule, after costs"},{"day":1440,"growth":0.236,"series":"The rule, after costs"},{"day":1450,"growth":0.234,"series":"The rule, after costs"},{"day":1460,"growth":0.24,"series":"The rule, after costs"},{"day":1470,"growth":0.237,"series":"The rule, after costs"},{"day":1480,"growth":0.232,"series":"The rule, after costs"},{"day":1490,"growth":0.232,"series":"The rule, after costs"},{"day":1500,"growth":0.234,"series":"The rule, after costs"},{"day":1510,"growth":0.227,"series":"The rule, after costs"},{"day":1520,"growth":0.22,"series":"The rule, after costs"},{"day":1530,"growth":0.216,"series":"The rule, after costs"},{"day":1540,"growth":0.217,"series":"The rule, after costs"},{"day":1550,"growth":0.216,"series":"The rule, after costs"},{"day":1560,"growth":0.212,"series":"The rule, after costs"},{"day":1570,"growth":0.201,"series":"The rule, after costs"},{"day":1580,"growth":0.203,"series":"The rule, after costs"},{"day":1590,"growth":0.2,"series":"The rule, after costs"},{"day":1600,"growth":0.197,"series":"The rule, after costs"},{"day":1610,"growth":0.197,"series":"The rule, after costs"},{"day":1620,"growth":0.195,"series":"The rule, after costs"},{"day":1630,"growth":0.2,"series":"The rule, after costs"},{"day":1640,"growth":0.203,"series":"The rule, after costs"},{"day":1650,"growth":0.199,"series":"The rule, after costs"},{"day":1660,"growth":0.2,"series":"The rule, after costs"},{"day":1670,"growth":0.199,"series":"The rule, after costs"},{"day":1680,"growth":0.199,"series":"The rule, after costs"},{"day":1690,"growth":0.199,"series":"The rule, after costs"},{"day":1700,"growth":0.198,"series":"The rule, after costs"},{"day":1710,"growth":0.199,"series":"The rule, after costs"},{"day":1720,"growth":0.194,"series":"The rule, after costs"},{"day":1730,"growth":0.192,"series":"The rule, after costs"},{"day":1740,"growth":0.188,"series":"The rule, after costs"},{"day":0,"growth":1.011,"series":"Buy and hold"},{"day":10,"growth":1.009,"series":"Buy and hold"},{"day":20,"growth":1.01,"series":"Buy and hold"},{"day":30,"growth":0.992,"series":"Buy and hold"},{"day":40,"growth":0.961,"series":"Buy and hold"},{"day":50,"growth":0.965,"series":"Buy and hold"},{"day":60,"growth":0.984,"series":"Buy and hold"},{"day":70,"growth":1.011,"series":"Buy and hold"},{"day":80,"growth":1.054,"series":"Buy and hold"},{"day":90,"growth":1.057,"series":"Buy and hold"},{"day":100,"growth":1.05,"series":"Buy and hold"},{"day":110,"growth":1.076,"series":"Buy and hold"},{"day":120,"growth":1.104,"series":"Buy and hold"},{"day":130,"growth":1.101,"series":"Buy and hold"},{"day":140,"growth":1.03,"series":"Buy and hold"},{"day":150,"growth":1.069,"series":"Buy and hold"},{"day":160,"growth":1.012,"series":"Buy and hold"},{"day":170,"growth":1.011,"series":"Buy and hold"},{"day":180,"growth":1.007,"series":"Buy and hold"},{"day":190,"growth":1.018,"series":"Buy and hold"},{"day":200,"growth":1.021,"series":"Buy and hold"},{"day":210,"growth":1.044,"series":"Buy and hold"},{"day":220,"growth":1.063,"series":"Buy and hold"},{"day":230,"growth":1.108,"series":"Buy and hold"},{"day":240,"growth":1.086,"series":"Buy and hold"},{"day":250,"growth":1.03,"series":"Buy and hold"},{"day":260,"growth":1.026,"series":"Buy and hold"},{"day":270,"growth":1.02,"series":"Buy and hold"},{"day":280,"growth":1.01,"series":"Buy and hold"},{"day":290,"growth":0.974,"series":"Buy and hold"},{"day":300,"growth":0.939,"series":"Buy and hold"},{"day":310,"growth":0.918,"series":"Buy and hold"},{"day":320,"growth":0.909,"series":"Buy and hold"},{"day":330,"growth":0.904,"series":"Buy and hold"},{"day":340,"growth":0.915,"series":"Buy and hold"},{"day":350,"growth":0.92,"series":"Buy and hold"},{"day":360,"growth":0.912,"series":"Buy and hold"},{"day":370,"growth":0.924,"series":"Buy and hold"},{"day":380,"growth":0.908,"series":"Buy and hold"},{"day":390,"growth":0.923,"series":"Buy and hold"},{"day":400,"growth":0.923,"series":"Buy and hold"},{"day":410,"growth":0.905,"series":"Buy and hold"},{"day":420,"growth":0.916,"series":"Buy and hold"},{"day":430,"growth":0.916,"series":"Buy and hold"},{"day":440,"growth":0.895,"series":"Buy and hold"},{"day":450,"growth":0.878,"series":"Buy and hold"},{"day":460,"growth":0.883,"series":"Buy and hold"},{"day":470,"growth":0.909,"series":"Buy and hold"},{"day":480,"growth":0.851,"series":"Buy and hold"},{"day":490,"growth":0.869,"series":"Buy and hold"},{"day":500,"growth":0.9,"series":"Buy and hold"},{"day":510,"growth":0.893,"series":"Buy and hold"},{"day":520,"growth":0.92,"series":"Buy and hold"},{"day":530,"growth":0.896,"series":"Buy and hold"},{"day":540,"growth":0.861,"series":"Buy and hold"},{"day":550,"growth":0.836,"series":"Buy and hold"},{"day":560,"growth":0.833,"series":"Buy and hold"},{"day":570,"growth":0.841,"series":"Buy and hold"},{"day":580,"growth":0.815,"series":"Buy and hold"},{"day":590,"growth":0.826,"series":"Buy and hold"},{"day":600,"growth":0.811,"series":"Buy and hold"},{"day":610,"growth":0.794,"series":"Buy and hold"},{"day":620,"growth":0.8,"series":"Buy and hold"},{"day":630,"growth":0.77,"series":"Buy and hold"},{"day":640,"growth":0.778,"series":"Buy and hold"},{"day":650,"growth":0.738,"series":"Buy and hold"},{"day":660,"growth":0.763,"series":"Buy and hold"},{"day":670,"growth":0.782,"series":"Buy and hold"},{"day":680,"growth":0.777,"series":"Buy and hold"},{"day":690,"growth":0.778,"series":"Buy and hold"},{"day":700,"growth":0.772,"series":"Buy and hold"},{"day":710,"growth":0.747,"series":"Buy and hold"},{"day":720,"growth":0.766,"series":"Buy and hold"},{"day":730,"growth":0.773,"series":"Buy and hold"},{"day":740,"growth":0.763,"series":"Buy and hold"},{"day":750,"growth":0.717,"series":"Buy and hold"},{"day":760,"growth":0.714,"series":"Buy and hold"},{"day":770,"growth":0.758,"series":"Buy and hold"},{"day":780,"growth":0.789,"series":"Buy and hold"},{"day":790,"growth":0.778,"series":"Buy and hold"},{"day":800,"growth":0.787,"series":"Buy and hold"},{"day":810,"growth":0.761,"series":"Buy and hold"},{"day":820,"growth":0.757,"series":"Buy and hold"},{"day":830,"growth":0.77,"series":"Buy and hold"},{"day":840,"growth":0.76,"series":"Buy and hold"},{"day":850,"growth":0.745,"series":"Buy and hold"},{"day":860,"growth":0.765,"series":"Buy and hold"},{"day":870,"growth":0.723,"series":"Buy and hold"},{"day":880,"growth":0.718,"series":"Buy and hold"},{"day":890,"growth":0.703,"series":"Buy and hold"},{"day":900,"growth":0.726,"series":"Buy and hold"},{"day":910,"growth":0.717,"series":"Buy and hold"},{"day":920,"growth":0.696,"series":"Buy and hold"},{"day":930,"growth":0.7,"series":"Buy and hold"},{"day":940,"growth":0.684,"series":"Buy and hold"},{"day":950,"growth":0.68,"series":"Buy and hold"},{"day":960,"growth":0.654,"series":"Buy and hold"},{"day":970,"growth":0.657,"series":"Buy and hold"},{"day":980,"growth":0.666,"series":"Buy and hold"},{"day":990,"growth":0.682,"series":"Buy and hold"},{"day":1000,"growth":0.668,"series":"Buy and hold"},{"day":1010,"growth":0.667,"series":"Buy and hold"},{"day":1020,"growth":0.709,"series":"Buy and hold"},{"day":1030,"growth":0.702,"series":"Buy and hold"},{"day":1040,"growth":0.69,"series":"Buy and hold"},{"day":1050,"growth":0.683,"series":"Buy and hold"},{"day":1060,"growth":0.729,"series":"Buy and hold"},{"day":1070,"growth":0.733,"series":"Buy and hold"},{"day":1080,"growth":0.719,"series":"Buy and hold"},{"day":1090,"growth":0.706,"series":"Buy and hold"},{"day":1100,"growth":0.685,"series":"Buy and hold"},{"day":1110,"growth":0.659,"series":"Buy and hold"},{"day":1120,"growth":0.617,"series":"Buy and hold"},{"day":1130,"growth":0.618,"series":"Buy and hold"},{"day":1140,"growth":0.643,"series":"Buy and hold"},{"day":1150,"growth":0.655,"series":"Buy and hold"},{"day":1160,"growth":0.63,"series":"Buy and hold"},{"day":1170,"growth":0.596,"series":"Buy and hold"},{"day":1180,"growth":0.593,"series":"Buy and hold"},{"day":1190,"growth":0.599,"series":"Buy and hold"},{"day":1200,"growth":0.613,"series":"Buy and hold"},{"day":1210,"growth":0.609,"series":"Buy and hold"},{"day":1220,"growth":0.645,"series":"Buy and hold"},{"day":1230,"growth":0.638,"series":"Buy and hold"},{"day":1240,"growth":0.63,"series":"Buy and hold"},{"day":1250,"growth":0.615,"series":"Buy and hold"},{"day":1260,"growth":0.627,"series":"Buy and hold"},{"day":1270,"growth":0.622,"series":"Buy and hold"},{"day":1280,"growth":0.627,"series":"Buy and hold"},{"day":1290,"growth":0.637,"series":"Buy and hold"},{"day":1300,"growth":0.644,"series":"Buy and hold"},{"day":1310,"growth":0.631,"series":"Buy and hold"},{"day":1320,"growth":0.614,"series":"Buy and hold"},{"day":1330,"growth":0.624,"series":"Buy and hold"},{"day":1340,"growth":0.646,"series":"Buy and hold"},{"day":1350,"growth":0.703,"series":"Buy and hold"},{"day":1360,"growth":0.731,"series":"Buy and hold"},{"day":1370,"growth":0.728,"series":"Buy and hold"},{"day":1380,"growth":0.757,"series":"Buy and hold"},{"day":1390,"growth":0.799,"series":"Buy and hold"},{"day":1400,"growth":0.806,"series":"Buy and hold"},{"day":1410,"growth":0.74,"series":"Buy and hold"},{"day":1420,"growth":0.734,"series":"Buy and hold"},{"day":1430,"growth":0.75,"series":"Buy and hold"},{"day":1440,"growth":0.759,"series":"Buy and hold"},{"day":1450,"growth":0.797,"series":"Buy and hold"},{"day":1460,"growth":0.792,"series":"Buy and hold"},{"day":1470,"growth":0.785,"series":"Buy and hold"},{"day":1480,"growth":0.776,"series":"Buy and hold"},{"day":1490,"growth":0.764,"series":"Buy and hold"},{"day":1500,"growth":0.761,"series":"Buy and hold"},{"day":1510,"growth":0.785,"series":"Buy and hold"},{"day":1520,"growth":0.82,"series":"Buy and hold"},{"day":1530,"growth":0.793,"series":"Buy and hold"},{"day":1540,"growth":0.812,"series":"Buy and hold"},{"day":1550,"growth":0.805,"series":"Buy and hold"},{"day":1560,"growth":0.765,"series":"Buy and hold"},{"day":1570,"growth":0.728,"series":"Buy and hold"},{"day":1580,"growth":0.731,"series":"Buy and hold"},{"day":1590,"growth":0.706,"series":"Buy and hold"},{"day":1600,"growth":0.699,"series":"Buy and hold"},{"day":1610,"growth":0.699,"series":"Buy and hold"},{"day":1620,"growth":0.714,"series":"Buy and hold"},{"day":1630,"growth":0.709,"series":"Buy and hold"},{"day":1640,"growth":0.712,"series":"Buy and hold"},{"day":1650,"growth":0.738,"series":"Buy and hold"},{"day":1660,"growth":0.722,"series":"Buy and hold"},{"day":1670,"growth":0.729,"series":"Buy and hold"},{"day":1680,"growth":0.759,"series":"Buy and hold"},{"day":1690,"growth":0.758,"series":"Buy and hold"},{"day":1700,"growth":0.753,"series":"Buy and hold"},{"day":1710,"growth":0.73,"series":"Buy and hold"},{"day":1720,"growth":0.694,"series":"Buy and hold"},{"day":1730,"growth":0.684,"series":"Buy and hold"},{"day":1740,"growth":0.72,"series":"Buy and hold"}],"metrics":[{"period":"In sample (chosen on)","sharpe":"-2.03","ret":"-21.5%","dd":"65%","turn":"128.4"},{"period":"Out of sample (not seen)","sharpe":"-2.35","ret":"-26.0%","dd":"54%","turn":"125.3"},{"period":"Out of sample, before costs","sharpe":"-0.09","ret":"-1.0%","dd":"22%","turn":"125.3"}]},"root":{"type":"Page","children":[{"type":"Text","props":{"text":"This rule flips its position many times a year. Compare the last two rows of the table: what it earns before costs, and what is left after.","muted":false}},{"type":"Text","props":{"text":"The market is simulated, with no edge planted in it, so a rule that \"finds\" an edge proves the method works, not that this edge exists in a real market. Trading days are counted after warm-up; the first 1050 are in sample.","muted":true}},{"type":"Chart","props":{"title":"Reversion: 5-day, 1 deviations: growth of 1 on a simulated market (no edge)","mark":"line","height":220,"data":{"$state":"/growth"},"encoding":{"x":{"field":"day","type":"quantitative","title":"Trading day"},"y":{"field":"growth","type":"quantitative","title":"Growth of 1 (starts at 1)"},"color":{"field":"series","type":"nominal","title":"Series"}}}},{"type":"Table","props":{"caption":"Reversion: 5-day, 1 deviations, 20 bps per unit traded. Sharpe is annualised; turnover is position changes per year.","columns":[{"key":"period","label":"Period"},{"key":"sharpe","label":"Sharpe","align":"right"},{"key":"ret","label":"Mean yearly return","align":"right"},{"key":"dd","label":"Worst fall","align":"right"},{"key":"turn","label":"Turnover","align":"right"}],"rows":{"$state":"/metrics"}}}]}}}},{"id":"alpha-no-peeking","track":"alpha","title":"A rule only sees the past","summary":"Push every return after a cut-off up by five percent a day, then down, and recompute: the rule's positions up to the cut-off do not move. If they did, the backtest could not be trusted.","principle":"alpha-no-peeking","tags":["alpha","backtest","look-ahead"],"evidence":["lib/alpha/strategies.ts (priceIndex, sma)","lib/playbook/alpha-run.ts (lookaheadClaims, peeking)","tests/unit/alpha.test.ts"],"body":{"kind":"property","claim":"Positions on or before day t depend only on returns before day t.","results":[{"name":"sma-10-60, future changed after day 350","ok":true,"detail":"positions through day 350 are identical"},{"name":"sma-10-60, future changed after day 500","ok":true,"detail":"positions through day 500 are identical"},{"name":"sma-10-60, future changed after day 699","ok":true,"detail":"positions through day 699 are identical"},{"name":"momentum-40, future changed after day 350","ok":true,"detail":"positions through day 350 are identical"},{"name":"momentum-40, future changed after day 500","ok":true,"detail":"positions through day 500 are identical"},{"name":"momentum-40, future changed after day 699","ok":true,"detail":"positions through day 699 are identical"},{"name":"reversion-20-1.5, future changed after day 350","ok":true,"detail":"positions through day 350 are identical"},{"name":"reversion-20-1.5, future changed after day 500","ok":true,"detail":"positions through day 500 are identical"},{"name":"reversion-20-1.5, future changed after day 699","ok":true,"detail":"positions through day 699 are identical"}]}}]}