Backtesting XGBoost

I need to set some starting parameters for this exercise. First are the trading rules. So I open a trade on a positive prediction of increase over the coming seven days. Fixed position or cumulative? I think I’ll go for cumulative this time. Put in my entire account balance (as much as I’m committing to this exercise anyway) and just continue with whatever the account holds at the time. This is more doable if I’m setting stops at 2% loss as it should prevent large drawdowns.

Exit strategy? I think I’ll go with 2% take profit or 2% stop loss for the moment. I might need to optimize these numbers, but I need a starting point. What about exiting after a set number of days? I guess if the price isn’t moving much either way there’s not much to be gained by doing this.

I need a trained model to produce signals, but can’t backtest on the data used to train the model. I’ve got about six years of data, so maybe train the model on four years of data, and then start backtesting from that point on. I could retrain the model before each trade to include all the data up ’til that point. I’ll see how that works out.

So what could I optimize here? Currently my go/no go signal is determined by whether or not the price increases by more than 1% at any time in the following seven days. I could change the percent, or the number of days. I’ve basically made it a binary classification problem. Maybe that’s not the best approach, but at the moment it seems pretty good to me. Of course the stop loss/take profit percentages might not produce the best results. I’ll play around with those numbers to see what works best on the historical data. Something that I could consider in the future is to increase the number of trading pairs I’m looking at. Or maybe to include some extra input features. For the moment I’ll go with what I’ve got.