The sixteenth part of the timing series, sharing a timing strategy using the LSTM model to combine short-term reversal and long-term momentum. Traditional timing strategies are difficult to respond quickly when momentum collapses. The strategy in this paper can effectively improve this point, using momentum to grasp long-term trends, and using reversals to capture short-term changes. The author has attached the code along with the article. To get the original text, please reply " Chose Time 16 " in the background of the official account "Quantitative Frontier Express" .
Strategy Overview : Long-term momentum here is represented by 12-month returns, and short-term reversals are expressed as 1-month returns. The idea of strategy construction is relatively simple. The author uses a change point detection model CPD (ChangePoint Dection). Normally, long-term momentum is used to track the trend. When a change point is detected, it switches to a short-term reversal signal and performs mean regression. CPD is a purely statistical model. The role of LSTM here is that the output of CPD is a score of 0-1. The author uses this score and some other price and volume signals as the input of LSTM, and uses the output of the LSTM model as a strategy signal.
CPD part : The algorithm of CPD is skipped, and the description of ChatPDF is attached, see the report for details.
The following figure is an example of CPD for the S&P 500
The CPD model finally outputs two values, the position of the change point and the score of the change point. The author found that the performance and stability of the model were improved after adding these two values.
Policy statement
The traditional time-series momentum can be expressed as follows
Superimpose short-term reversals on top of traditional time-series momentum
The setting of the policy is mainly to determine the value of w.
LSTM part
model input
Loss function: Sharpe ratio
strategy performance
The strategies in the red box are under different window periods. Compared with TSMOM and Long Only strategies, the performance of income, Sharpe ratio and retracement has been significantly improved
The author has tested on multiple varieties, all of which are effective
And it can be seen that the LSTM+CPD version is better than the pure LSTM version
The above is the main content of the full text. The code is a bit long, so I won’t attach it. If you are interested, download and understand it yourself.
Finally, attach the description of ChatPDF
Full text of the above
If you feel good, you can click to watch/like to support it