Skip to content

Instantly share code, notes, and snippets.

@alun
Created September 8, 2022 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alun/80fcedf46e64932a8f4ceb050fcd9a86 to your computer and use it in GitHub Desktop.
Save alun/80fcedf46e64932a8f4ceb050fcd9a86 to your computer and use it in GitHub Desktop.
Stoken comparison
Test stoken_aca , Zorro 2.502
Simulated account AssetsFix
Bar period 24 hours (avg 2089 min)
Total processed 6398 bars
Test period 2006-03-08..2022-08-31 (4149 bars)
Lookback period 252 bars (73 weeks)
Montecarlo cycles 200
Simulation mode Realistic
Capital invested 100000$
Gross win/loss 147166$-6924$, +348577.2p, lr 148201$
Average profit 8509$/year, 709$/month, 32.73$/day
Max drawdown -31591$ 22.5% (MAE -50781$ 36.2%)
Total down time 5% (TAE 90%)
Max down time 30 weeks from Oct 2008
Max open margin 55914$
Max open risk 1016$
Trade volume 156744$ (9510$/year)
Transaction costs -29.12$ spr, 20.24$ slp, 0$ rol
Capital required 28884$
Number of trades 50 (4/year)
Percent winning 88.0%
Max win/loss 19873$ / -4132$
Avg trade profit 2805$ 6971.5p (+8313.4p / -2868.5p)
Avg trade slippage 0.40$ 1.0p (+1.4p / -1.6p)
Avg trade bars 1812 (+639 / -27)
Max trade bars 4149 (1203 weeks)
Time in market 2185%
Max open trades 12
Max loss streak 2 (uncorrelated 2)
Annual growth rate 5.46% (ROI 8.51%)
Profit factor 21.25 (PRR 12.82)
Reward/Risk ratio 4.4
Sharpe ratio 0.55 (Sortino 0.51)
R2 coefficient 0.938
Ulcer index 7.0%
Scholz tax 36989 EUR
Year Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Total
2006 4 3 -2 -1 3 1 -1 4 5 -2 +15
2007 4 -1 -1 2 0 -4 -2 2 5 3 -4 0 +4
2008 1 -0 -1 2 1 -4 0 -2 -2 -18 -3 5 -20
2009 -7 -10 2 11 7 -4 7 6 5 -1 9 -0 +25
2010 -3 3 4 4 -3 -3 3 0 5 3 0 3 +19
2011 -0 3 -0 4 -0 -2 2 1 -7 7 -1 -2 +5
2012 5 0 2 0 -4 3 1 2 1 -1 -0 1 +9
2013 2 -1 2 0 -2 -3 3 -1 1 2 -1 0 +1
2014 1 3 -0 1 0 2 -1 2 -3 2 1 1 +8
2015 2 -1 -0 -1 0 -2 0 -2 -0 3 -1 -0 -1
2016 -1 2 3 1 -1 3 2 -1 -0 -2 -1 1 +5
2017 1 2 -0 1 0 0 1 1 -0 0 1 1 +7
2018 1 -2 0 0 1 0 0 1 -0 -1 1 -2 -2
2019 4 1 1 1 -1 3 1 2 0 1 -0 1 +14
2020 1 -2 -5 4 1 1 3 1 -2 -1 2 2 +6
2021 -1 0 1 3 1 -0 1 1 -2 3 -1 3 +10
2022 -2 0 1 -2 -1 -2 2 -2 -6
Portfolio analysis OptF ProF Win/Loss Wgt%
GLD-US avg ---- 305.31 16/1 31.5
IEF-US avg ---- ---- 0/0 0.0
SPY-US avg ---- 56.58 14/2 39.4
TLT-US avg ---- ---- 0/0 0.0
VNQ-US avg ---- 8.05 14/3 29.1
GLD avg ---- 305.31 16/1 31.5
SPY avg ---- 56.58 14/2 39.4
VNQ avg ---- 8.05 14/3 29.1
GLD-US:GLD:L ---- 305.31 16/1 31.5
SPY-US:SPY:L ---- 56.58 14/2 39.4
VNQ-US:VNQ:L ---- 8.05 14/3 29.1
Test stoken_aca , Zorro 2.502
Simulated account AssetsFix
Bar period 24 hours (avg 2089 min)
Total processed 6398 bars
Test period 2006-03-08..2022-08-31 (4149 bars)
Lookback period 252 bars (73 weeks)
Montecarlo cycles 200
Simulation mode Realistic
Capital invested 100000$
Gross win/loss 199772$-0$, +44850.3p, lr 206896$
Average profit 12121$/year, 1010$/month, 46.62$/day
Max drawdown -22715$ 11.4% (MAE -69950$ 35.0%)
Total down time 4% (TAE 92%)
Max down time 7 weeks from Oct 2008
Max open margin 49937$
Max open risk 1016$
Trade volume 99880$ (6060$/year)
Transaction costs -17.33$ spr, -6.15$ slp, 0$ rol
Capital required 19891$
Number of trades 3 (1/year)
Percent winning 100.0%
Max win/loss 94398$ / -0$
Avg trade profit 66591$ 14950.1p (+14950.1p / -0.0p)
Avg trade slippage -2.05$ -0.5p (+0.0p / -0.0p)
Avg trade bars 4149 (+4149 / -0)
Max trade bars 4149 (1203 weeks)
Time in market 300%
Max open trades 3
Max loss streak 0 (uncorrelated 0)
Annual growth rate 6.89% (ROI 12.12%)
Reward/Risk ratio 8.8
Sharpe ratio 0.47 (Sortino 0.43)
R2 coefficient 0.806
Ulcer index 7.0%
Scholz tax 52690 EUR
Year Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Total
2006 4 3 -2 -1 3 1 -1 4 5 -2 +15
2007 4 -1 -1 2 0 -5 -3 3 6 4 -5 0 +5
2008 2 1 -2 1 1 -4 -0 -3 -1 -20 -1 7 -21
2009 -2 -5 0 4 8 -4 5 3 5 1 10 -3 +24
2010 -3 4 3 5 -1 -1 0 2 5 4 1 3 +24
2011 -3 5 1 7 -1 -2 5 5 -10 8 0 -6 +8
2012 9 -1 1 0 -6 3 1 3 3 -2 -0 -0 +11
2013 2 -2 2 -2 -4 -6 5 0 -1 2 -3 -1 -9
2014 1 5 -1 1 -0 4 -2 2 -5 2 1 1 +10
2015 4 -2 -1 -1 1 -3 -0 -2 -1 5 -3 -0 -3
2016 -1 4 5 1 -1 6 3 -2 -0 -3 -3 1 +10
2017 3 4 -1 1 0 0 2 2 -1 0 2 1 +14
2018 2 -4 0 0 1 -0 1 1 -1 -3 2 -4 -4
2019 7 1 1 1 -2 6 1 3 0 2 -0 3 +26
2020 2 -5 -10 10 3 2 7 3 -4 -2 4 5 +14
2021 -2 -0 3 5 3 -1 3 2 -4 5 -1 5 +19
2022 -5 -0 4 -5 -2 -6 5 -4 -14
Portfolio analysis OptF ProF Win/Loss Wgt%
GLD-US avg ---- ++++ 1/0 32.5
IEF-US avg ---- ---- 0/0 0.0
SPY-US avg ---- ++++ 1/0 47.3
TLT-US avg ---- ---- 0/0 0.0
VNQ-US avg ---- ++++ 1/0 20.2
GLD avg ---- ++++ 1/0 32.5
SPY avg ---- ++++ 1/0 47.3
VNQ avg ---- ++++ 1/0 20.2
GLD-US:GLD:L ---- ++++ 1/0 32.5
SPY-US:SPY:L ---- ++++ 1/0 47.3
VNQ-US:VNQ:L ---- ++++ 1/0 20.2
buy and hold buy and hold w rebalance stoken w rebalance
sharpe ratio 0.47 0.55 0.75
AGR 6.89% 5.46% 5.49%
DD(MAE) 35.0% 36.2% 14.4%
Test stoken_aca , Zorro 2.502
Simulated account AssetsFix
Bar period 24 hours (avg 2089 min)
Total processed 6398 bars
Test period 2006-03-08..2022-08-31 (4149 bars)
Lookback period 252 bars (73 weeks)
Montecarlo cycles 200
Simulation mode Realistic
Capital invested 100000$
Gross win/loss 158317$-17130$, +197815.3p, lr 153742$
Average profit 8566$/year, 714$/month, 32.95$/day
Max drawdown -3365$ 2.4% (MAE -20349$ 14.4%)
Total down time 1% (TAE 90%)
Max down time 25 weeks from Jun 2018
Max open margin 50862$
Max open risk 1017$
Trade volume 1389190$ (84286$/year)
Transaction costs -167$ spr, 136$ slp, 0$ rol
Capital required 21683$
Number of trades 152 (10/year)
Percent winning 78.3%
Max win/loss 11686$ / -3713$
Avg trade profit 929$ 1301.4p (+1864.0p / -727.3p)
Avg trade slippage 0.90$ 1.3p (+1.9p / -1.1p)
Avg trade bars 292 (+147 / -74)
Max trade bars 2140 (620 weeks)
Time in market 1070%
Max open trades 8
Max loss streak 5 (uncorrelated 3)
Annual growth rate 5.49% (ROI 8.57%)
Profit factor 9.24 (PRR 7.15)
Reward/Risk ratio 42.0
Sharpe ratio 0.75 (Sortino 0.70)
R2 coefficient 0.874
Ulcer index 3.9%
Scholz tax 37238 EUR
Year Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Total
2006 3 3 -1 -1 2 1 -1 3 4 -1 +11
2007 4 -1 -1 2 0 -4 -2 1 4 3 -1 2 +7
2008 3 2 -1 -3 -1 2 -0 -1 0 -1 8 6 +13
2009 -5 -1 2 -3 -2 -1 2 4 2 -1 7 -0 +4
2010 -2 3 3 3 -3 -2 2 0 4 3 0 3 +16
2011 -0 3 -0 4 -0 -2 2 0 -6 3 -0 -1 +2
2012 3 0 1 0 -3 1 1 0 -0 -1 0 0 +5
2013 1 1 1 3 -2 -1 1 -2 1 2 -1 0 +4
2014 1 2 0 1 1 1 -0 2 -2 3 2 1 +13
2015 2 -1 0 -1 -0 -2 2 -2 0 2 -0 -0 +0
2016 -0 -0 2 0 -0 3 2 -1 -0 -2 -1 1 +2
2017 0 1 -0 0 0 1 0 1 -0 0 1 0 +6
2018 -0 -1 -0 -0 0 -0 0 1 -1 -2 1 -2 -4
2019 2 -0 2 -0 0 2 0 2 0 1 -0 1 +10
2020 1 -2 -2 1 0 0 2 0 -1 -1 0 2 +1
2021 -1 0 1 2 0 1 2 1 -2 2 -0 2 +9
2022 -2 -1 1 -2 -1 -1 1 -2 -7
Portfolio analysis OptF ProF Win/Loss Wgt%
GLD-US avg ---- 6.11 20/10 24.5
IEF-US avg ---- 14.12 24/5 5.9
SPY-US avg ---- 7.55 26/9 24.2
TLT-US avg ---- 7.73 17/4 10.9
VNQ-US avg ---- 23.06 32/5 34.4
GLD avg ---- 6.52 37/14 35.5
SPY avg ---- 7.44 36/14 26.7
VNQ avg ---- 25.23 46/5 37.8
GLD-US:GLD:L ---- 6.11 20/10 24.5
IEF-US:SPY:L ---- 6.53 10/5 2.5
IEF-US:VNQ:L ---- ++++ 14/0 3.4
SPY-US:SPY:L ---- 7.55 26/9 24.2
TLT-US:GLD:L ---- 7.73 17/4 10.9
VNQ-US:VNQ:L ---- 23.06 32/5 34.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment