@Vertox_DF I wrote about it somewhere else, mean reverting strategies generally need wider stop losses, as they capture peaks and troughs but the timing may not be perfect, particularly with peaks that are harder to catch.
Kalman filter is great to boost accuracy or smooth features but annotating everything is pure nightmare. Always great to give a reference to the original paper from the 60s and add: “just check it out there”.
https://t.co/n03JhwFPF3
After working through @ltrd_’s thread a couple of times, I want to try and do my own analysis on a microstructure feature.
In this analysis I will be looking at orderbook imbalance.
Study outliers!
You do not even know how many valuable things can bring you watching and analyzing outliers. A lot of my strategies came from things that firstly happened as an outliers in my time series analysis. You have to know also what is necessary in order to do good job.
How to analyze, visualize and use alpha from the feature? 🧵
I would like to show you methods for analyzing some features that you will find in the data. Everything is used in practice, without fancy words and ML methods. For quants and beginners coming from manual trading.
#MachineLearning in finance, lesson 1: Target variable
Before predicting anything, it is super important to know what EXACTLY you want to predict. There are two main approaches: predicting raw returns (regression) and some events (classification). 1/
#MachineLearning in finance, lesson 2: Data research and engineering
After lesson 1, we now know what we want to predict. Let's say, it's momentum in equities defined as current price outperforming weekly VWAP ex ante. The horizon could be as simple as just a day ahead 1/
Simple trick to boost your return estimates: apply Kalman filter to the difference between the prediction and real return (error) and add the most current Kalman state to your next prediction. Sure, it will be a bit laggy but often works great.
PCA the huge panel features to capture relationship between stocks and their features, feed into the optimizer with a group time series CV, xgboost it, check perf on the holdout set, paper run it for a while, if everything good then deploy.
Best data time series data transformations: fractional differentiation, rolling z-score, demeaning with various windows (require KPSS test for stationarity). IMO, technical indicators best to z-score, and frac. diff. non-stationary data.
I mentioned once that for HFT it’s best to use linear models. Got questions after that which packages are best. Pretty much these: Darts, pyGAM, pycaret, maybe sktime if you are addicted to sklearn. No need to look anywhere else. Also, tsfresh for features.
If you want to apply any regime switching method, e.g., HMM from hmmlearn do it on a rolling basis, as this stuff changes the past. Only for label generation you can overfit and have a look-ahead bias, otherwise roll it each timestep.