- Breakout strat with combined signals from different breakout criteria.
- Look Back Straddle Deltas MA Cross Over strat
- Returns prediction using ML for seasonality detection fed into a random forest for prediction. (unsupervised-to-supervised learning methods)
- Backtester from 1969 to 2023 with rolling_table and performance analysis
Equally weighted portfolio of all commodities in the dataset.
Breakout trading is a popular and dynamic trading strategy employed by traders. It revolves around identifying and capitalizing on significant price movements that occur when an asset's price breaks through a well-defined level of support or resistance.
"Buy a higher high, sell a lower low, and hold the position to make a profit."
- Long if today’s return is the highest of all the returns in the window.
- Short if today’s return is the lowest of all the returns in the window.
- Else, hold.
- Long when return is higher than mean +1 * std
- Short when return is below the mean -1 * std
- Else, hold.
Many ways of doing so. Assuming no tx fees, one solution is to compute the equally weighted average of both signals.
We assume the first day price is one and compute the subsequent price based on. We then compute that 5 day Moving Average of the delta. We choose to use the delta’s MA rather than the price volatility since it can catch up the reversal more quickly, as shown in the figure below.
Thus, it would be helpful to limit our loss.
The signals are generated as follow:
- If the current delta crosses the 5 Day delta MA to go down, we sell.
- If the current delta crosses the 5 Day delta MA to go up, we buy.
According to both performance graphs, it is clear that although the strategy generated is better than the benchmark, further computation is required in order to define how well the strategy does in comparison to the others. A similar computation with other signals cannot be done within less than 6 hours at least which is why the trategy is backtested on 5 months data only.
First, the prophet model was used to decompose the returns into different time intervals, according to the signals seasonalities and patterns (such as harvesing cycles for agricultural commodities, for instance).
Then, these variables are fed in a random forest model for future return predictions.
MSE: 0.0346 R^2: 0.000305.
The MSE is small however, the R^2 suggests that the model requires further improvements.