μ = 0…20 % / yrIf quantitative finance were a garden…
This strategy reveals a pattern. Is it real seeing, or noise?
Five basic shapes of quant finance — return, risk, correlation, cost, overfitting — become five plants you can drag. Move one, and the garden changes.
A toy model for intuition, not a real financial model, not investment advice.
Inspired by the way of seeing in Cézanne’s Realm
Walk into the garden ↓The terrarium
Drag a slider. The tree answers. Drag the glass to walk around it.
drag to turn
Backtest Sharpe 1.2 · Live Sharpe 0.8 · Portfolio volatility 13% · Net return 10%
Season
What you just saw
Drag any plant to see what happens to this strategy tree.
Try this
The Luck Forest
Zero skill can still look like genius. Grow 100 trees from pure coin-flip returns and stand yours among them.
Backtest vs. live
BacktestLive100 luck paths
Three gardens
Skill-up studio
I’ll retell it
Build your own garden
Get the minimal garden.html
Show code
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<title>量化金融花园</title>
<style>
body{font-family:sans-serif;background:#f3efe2;margin:0;padding:20px;color:#3b3a2f}
h1{margin:0 0 4px} .q{color:#7a6a3a;margin-bottom:16px}
.wrap{display:flex;gap:24px;flex-wrap:wrap}
.panel{flex:1;min-width:260px}
label{display:block;margin-top:14px;font-weight:bold}
input[type=range]{width:100%}
canvas{background:#fffdf5;border-radius:12px;border:1px solid #d8d0b0}
#say{margin-top:14px;padding:12px;background:#fff;border-left:4px solid #6a9a4a;border-radius:6px;min-height:48px}
textarea{width:100%;height:70px;margin-top:10px}
</style>
</head>
<body>
<h1>量化金融花园</h1>
<div class="q">山:这个策略赚钱,是真本事,还是运气?</div>
<div class="wrap">
<div class="panel">
<label>收益(土壤)<span id="v0"></span><input id="s0" type="range" min="0" max="100" value="60"></label>
<label>风险(风)<span id="v1"></span><input id="s1" type="range" min="0" max="100" value="40"></label>
<label>相关性(根系)<span id="v2"></span><input id="s2" type="range" min="0" max="100" value="30"></label>
<label>成本(水分流失)<span id="v3"></span><input id="s3" type="range" min="0" max="100" value="20"></label>
<label>过拟合(杂草)<span id="v4"></span><input id="s4" type="range" min="0" max="100" value="30"></label>
<div id="say"></div>
<textarea id="note" placeholder="用你自己的话复述:你刚刚看见了什么?"></textarea>
</div>
<canvas id="c" width="420" height="420"></canvas>
</div>
<script>
const $=id=>document.getElementById(id), c=$('c'), g=c.getContext('2d');
const tips=[
"收益是土壤:土越肥,树越有机会长高,但肥土也可能只是这一季特别好。",
"风险是风:风越大,树晃得越厉害,同样的收益,风小才稳。",
"相关性是根系:根都扎在同一处,一场旱就全枯;分散的根才抗旱。",
"成本是水分流失:交易越频繁,手续费和滑点把水悄悄漏光。",
"过拟合是杂草:你把历史数据调得太完美,看起来很茂盛,其实只适合过去那一块地。"
];
let last=0;
function val(i){return +$('s'+i).value}
function draw(){
const [r,k,o,cost,ov]=[0,1,2,3,4].map(val);
// 真本事分数:高收益、低风险、分散、低成本、低过拟合
const real=Math.max(0,r*0.35-k*0.2-o*0.15-cost*0.2-ov*0.35+60);
const h=Math.min(260,real*2.6);
g.clearRect(0,0,420,420);
// 土壤
g.fillStyle='rgb('+(120-r*0.4)+','+(80+r*0.5)+',50)';
g.fillRect(0,340,420,80);
// 根系:相关性越高越挤在一处
g.strokeStyle='#8a6a3a';
for(let i=0;i<9;i++){
const spread=(100-o)*1.6+10;
g.beginPath();g.moveTo(210,340);
g.lineTo(210+(i-4)*spread/4,340+50+((i*37)%30));g.stroke();
}
// 杂草
g.strokeStyle='#b5a020';
for(let i=0;i<ov/4;i++){
const x=20+(i*53)%380;
g.beginPath();g.moveTo(x,340);g.lineTo(x+(i%2?8:-8),325-(i%5)*4);g.stroke();
}
// 树干与树冠(风越大,晃得越厉害)
const sway=Math.sin(Date.now()/400)*k*0.25;
g.strokeStyle='#6b4a2a';g.lineWidth=8;
g.beginPath();g.moveTo(210,340);g.lineTo(210+sway,340-h);g.stroke();
g.lineWidth=1;
const green=Math.max(40,200-cost*1.5-ov*1.2);
g.fillStyle='rgb(60,'+green+',70)';
g.beginPath();g.arc(210+sway,340-h-20,30+real*0.4,0,7);g.fill();
// 水分流失:成本高,水滴往下漏
g.fillStyle='#5aa0d8';
for(let i=0;i<cost/10;i++){
const y=(Date.now()/10+i*60)%80;
g.beginPath();g.arc(60+i*25,340-y*0.5+30,3,0,7);g.fill();
}
// 判断
[0,1,2,3,4].forEach(i=>$('v'+i).textContent=' '+val(i));
requestAnimationFrame(draw);
}
[0,1,2,3,4].forEach(i=>$('s'+i).addEventListener('input',()=>{$('say').textContent=tips[i];}));
$('say').textContent="拖动任何一个滑块,看这棵策略小树发生什么。";
draw();
</script>
</body>
</html>