This is my financial trading using ML.
Momentum prediction and enhancing the strategy with machine learning
-
Financial Data and Bars
- Form time/dollar bars with tick data
-
Get Buy/Sell Signals
- Momentum strategy (RSI..)
- Additional ML regime detector
-
Trading Rules
- Set enter rules with trading signals from classifiers
- Set exit rules with profit-taking, stop-loss rate, and maximum holding period
- (For enhancing the strategy) Label the binary outcome (Profit or Loss)
-
Strategy-Enhancing ML Model
-
Get Features (X)
- Market data & Technical analysis
- Microstructure features
- Macroeconomic variables
- Fundamentals
- news/public sentiments (in progress)
-
Feature Engineering
- Feature selection, dimension reduction
-
Machine Learning Model Optmization
- Cross-validation (time-series cv / Purged k-fold)
- Hyperparameter tuning
- AutoML with autogluon (or simply using ensemble methods such as Random forest, LightGBM, or XGBoost)
- Metrics (accuracy, f1 score, roc-auc)
-
Outcome
- Bet confidence (probability to accept a single trading signal)
-
Trading Decision
- Decide to bet or pass for each trading signal from the momentum strategy. The ML model above will help you.
- Bet sizing with some advanced models (in progress)
-
Backtesting
- Cumulative returns, Sharpe ratio, max drawdown, win ratio
- Advances in Financial Machine Learning, Lopez de Prado (2018)