@magenta-grimer There are 2 things you might want to change:
1: the lookback_period is 365 but you want a 400-day SMA. This will only produce NaNs, so the boolean array sma20 < sma20_crypto will be False everywhere resulting in -1 weights. 2*365 as lookback does the trick for these settings.
2: Bitcoin is trading 24/7, futures aren't. Better use crypto.time.values instead of futures.time.values for the output of load_data.
There might be something else that I didn't catch but the resulting sharpe is at least close to what would be expected (1.109 with 5 and 385)