Skip to content

Instantly share code, notes, and snippets.

@rolandkofler
Created March 15, 2024 16:52
Show Gist options
  • Save rolandkofler/a53a580f1ddc62b533137be3ecbddb16 to your computer and use it in GitHub Desktop.
Save rolandkofler/a53a580f1ddc62b533137be3ecbddb16 to your computer and use it in GitHub Desktop.
=== The Buy and Hold Problem under Scrutinity ===
Buy and Hold Performance: 922.16%
Annualized Buy and Hold Performance: 236.70%
MACD strategies have a better than buy and hold annualized performance in the 99.75th percentile.
it is not supported by the Efficient Market Hypothesis (EMH) that the MACD strategy outperforms the buy and hold strategy so consistently.
=== The Statistical Summary of the Results ===
Short Period Long Period Signal Period Max Drawdown Annualized Performance Calmar Ratio Annualized Performance Ratio
count 62320.000000 62320.000000 62320.000000 62320.000000 62320.000000 62320.000000 62320.000000
mean 34.010270 121.472401 5.500000 0.390046 5.687208 16.023788 2.402712
std 14.286517 45.188049 2.291306 0.092928 1.476447 7.211544 0.623764
min 10.000000 40.000000 2.000000 0.205762 1.347864 2.498674 0.569441
25% 22.000000 83.000000 3.750000 0.312647 4.739824 10.460717 2.002464
50% 34.000000 122.000000 5.500000 0.389577 5.437782 14.079130 2.297335
75% 46.000000 161.000000 7.250000 0.462368 6.390630 20.340150 2.699891
max 59.000000 199.000000 9.000000 0.625360 12.755202 45.607827 5.388773
=== The Top 10 Results ===
Short Period Long Period Signal Period Max Drawdown Annualized Performance Calmar Ratio Annualized Performance Ratio
13712 20 154 2 0.319785 12.755202 39.886787 5.388773
13688 20 151 2 0.319785 12.755202 39.886787 5.388773
13696 20 152 2 0.319785 12.755202 39.886787 5.388773
13704 20 153 2 0.319785 12.755202 39.886787 5.388773
13680 20 150 2 0.319785 12.702339 39.721479 5.366440
13672 20 149 2 0.319785 12.702339 39.721479 5.366440
14124 21 45 6 0.390505 12.488078 31.979322 5.275920
18456 24 107 2 0.272719 12.438118 45.607827 5.254813
13728 20 156 2 0.319785 12.391340 38.748955 5.235050
13720 20 155 2 0.319785 12.313579 38.505786 5.202198
=== The Bottom 10 Results ===
Short Period Long Period Signal Period Max Drawdown Annualized Performance Calmar Ratio Annualized Performance Ratio
6400 15 40 2 0.539356 1.532099 2.840608 0.647276
6416 15 42 2 0.539356 1.508122 2.796154 0.637146
6424 15 43 2 0.539356 1.500024 2.781140 0.633725
5144 14 43 2 0.539356 1.495101 2.772011 0.631645
3872 13 44 2 0.545003 1.471760 2.700460 0.621784
3904 13 48 2 0.554552 1.457401 2.628067 0.615718
5136 14 42 2 0.539356 1.453142 2.694217 0.613918
3896 13 47 2 0.554552 1.437719 2.592575 0.607402
3880 13 45 2 0.554552 1.433686 2.585302 0.605699
2560 12 40 2 0.539432 1.347864 2.498674 0.569441
=== Correlation between the === MACD parameters and the Annualized Performance Ratio ===
Short Period Long Period Signal Period Max Drawdown Annualized Performance Calmar Ratio Annualized Performance Ratio
Short Period 1.000000e+00 5.651580e-02 -9.287578e-15 0.578432 -0.371073 -0.517992 -0.371073
Long Period 5.651580e-02 1.000000e+00 -3.355252e-15 0.229713 -0.163754 -0.183171 -0.163754
Signal Period -9.287578e-15 -3.355252e-15 1.000000e+00 -0.163682 -0.190587 -0.060029 -0.190587
Max Drawdown 5.784323e-01 2.297130e-01 -1.636824e-01 1.000000 -0.535165 -0.839822 -0.535165
Annualized Performance -3.710726e-01 -1.637541e-01 -1.905871e-01 -0.535165 1.000000 0.863119 1.000000
Calmar Ratio -5.179917e-01 -1.831711e-01 -6.002950e-02 -0.839822 0.863119 1.000000 0.863119
Annualized Performance Ratio -3.710726e-01 -1.637541e-01 -1.905871e-01 -0.535165 1.000000 0.863119 1.000000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment