Testing a Martingale-Hedged Strategy on Bitcoin with Python

Опубликовано: 08 Декабрь 2024
на канале: Andrew
996
14

Disclaimer : Not financial advice
The Author is not endorsing the Martingale strategy nor any strategy explained or showcased in the Media. The Author shall not be held liable or responsible for any errors or omissions on this site, nor for any damage you may suffer as a result of failing to seek competent financial advice from a professional who is familiar with your situation.

Colab notebook: https://colab.research.google.com/dri...

YouTube videos:
Section 1 of notebook:    • Import and Plot Crypto Charts with Py...  
Section 2 ## this video ##:    • Testing a Martingale-Hedged Strategy ...  
Martingale on coin flips (2022):    • 2022 Martingale on Coin Flip Games wi...  

-- TIMESTAMPS --
0:50 - Not financial advice
2:30 - Continuity -- video builds up on other Media (see above)
4:13 - Section 1: Importing Cryptocurrency Data and chart plotting.
5:18 - Section 2: Backtesting
Functions for backtest() function
6:00 - MACD rolling statistics and buy-sell-hold regimes
10:14 - Computing Return using cumulative log returns
16:23 - Putting everything together -- backtest() function
17:50 - Loading coin pair into df dataframe
18:18 - backtest() function on base MACD strategy
21:08 - Coupled Martingale Strategy
21:39 - Regime-building function for Martingale-hedged MACD strategy (long)
46:12 - modify backtest() function and run
47:02 - Comparing base strategy with Martingale-hedged strategy
49:00 - Running other coins to test code
50:52 - Why Martingale on sell loss may under-perform
55:06 - err. "Computers are just as smart as we make them" is actually my own quote [after a Google search]
55:28 - The "non-greedy" constraint
1:02:16 - This was fun
1:02:59 - Acknowledgements
1:03:44 - PDF