To get a feeling of SVM performance in trading, I run different setups on the S&P 500 historical data from … the 50s. The main motif behind using this decade was to decide what parameters to vary and what to keep steady prior to running the most important tests. Treat it as an “in-sample” test to avoid (further;)) over-fitting. First the performance chart:
Very nice! Using the 5 lagged daily returns shows similar performance to the ARMA+GARCH strategy, which I found very promising. If you wonder why I am so excited about this fact, it’s because here we are in the area where ARMA+GARCH is best, and yet, SVMs show comparable performance.
The indicators for the tested methods are: the ARMA+GARCH indicator, the SVM with statistics indicator, the SVM on the last 5 daily returns indicator and the SVM on the last 5 daily returns with greedy feature selection indicator.
The statistics are also impressive:
|Buy and Hold||ARMA+GARCH||SVM Lags||SVM Lags Greedy||SVM Stats|
While writing this post, I found another effort to use SVMs in trading by Quantum Financier. His approach uses RSI of different length as input to the SVM, but it also uses classification (maps the returns to two values, short or long) instead of regression. Since I was planning to try classification anyways, his post inspired me to implement it and run an additional comparison, regression vs classification:
What can I say – they both seem to work perfectly. As a reader suggested in the comments, the Classification does exhibit more consistent returns.
Looking at the table, the classification cut in half the maximum drawdown, but interestingly, it didn’t improve the Sharpe ratio significantly. Nothing conclusive here though, it was a quick run of the fastest (in terms of running time) strategies.
There is still a long list of topics to explore, just to give you an idea, in no particular order:
- Add other features. Mostly thinking of adding some Fed-related series, this data goes back to 1960, so it’s coming soon.:)
- Try other svm parameters: other regressions, other classifications, other kerenls, etc. This is more like a stability test.
- Try other error functions. The default is to use the mean square error, but in the case of regression, why not use Sharpe Ratio (in-sample)? The regression case is simpler, since we have the actual returns – check the input of tune.control.
- Try longer periods instead of days. Weekly is a start, but ideally I’d like to implement two or three day periods.
- Vary the loopback period.
- Use more classes with classification: large days, medium days, etc.
This will take time. As always, feedback and comments are welcome.