Back

Momentum and Reversal Combined with Volatility Effect in Stocks

Hi Folks,

I have implemented a quantpedia.com strategy “Momentum and Reversal Combined with Volatility Effect in Stocks”.  In one line the strategy can be explained as “Long stocks with high market capital, high momentum and high volatility keep them for six months and then Liquidate”.

According to Wei’s research paper titled “Do Momentum and Reversal Coexist?”, a large capital stock with high volatility shows Momentum if invested for a time period of around six months. This happens because momentum is generated by gradual information diffusion and/or investor under reaction. The investors under react to stocks with vague information i.e. stocks with higher volatility, so it takes time for the correct price to be found.

Implementation:

  1. Universe Selection:
    1. Select top 100 stocks based on market capital.
    2. The stock price should be more than 10 dollars to prevent this is a standard method used in various researches to exclude unexpected results.
  2. Selection Data for stocks:
    1. I have stored momentum and volatility in a separate class. And then I have created ConcurrentDictionary to store selection data corresponding to every symbol, with symbol as the key.

    2. Selection data also contains some other fields used by the program to keep momentum and volatility seven days behind the current date. This is done to avoid bias due to microstructure issues. ( I know this is against SOLID principle of object oriented programming. I will improve this next time.)
  3. Buying / Selling stocks:
    1. On the starting of every month. I liquidate all the stocks which are 6 months old.
    2. Than I look for the most volatile stocks in the current universe.
    3. Out of these stocks I choose the stock with highest momentum and invest 1/6th part of my cash into this stock.

I have implemented this algorithm using inbuilt classes Momentum and StandardDeviation. Momentum is used for quantify momentum and StandardDeviation is used to quantify volatility.


This algorithm can be further extended to short large capital stocks with high volatility and low momentum. I have tried to do that but the results were not promising, maybe I don’t understand shorting that well or maybe @StephenOehler is right in his post “Thoughts on the risk of shorting”.

https://www.quantconnect.com/forum/discussion/1012/thoughts-on-the-risks-of-shorting/p1
Update Backtest








Hey Anshul,

Well done! Thanks for sharing.

The implementation is great, at first sight I had some suggestion like use RollingWindow instead of Queue of use IndicatorDataPoint instead the timePrice struct; I even thought in inject the indicators in the SelectionData class with a weekly consolidator. But at the end all those suggestions do not improve the performance nor makes the code more readable ... so I'll K.I.S.S.

Respect to the performance, the 81% win rate is awesome, but in the other hand is a long strategy in a period with a – mostly – bullish market. Maybe implementing a Kelly criterion for sizing can improve the strategy behavior.

0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Thanks
1

Hi Folks,

Dear @JayJayD Thanks for the suggestions I will keep them in mind from next time onwards. It will be awesome if you can enlighten me on Kelly criterion. Specifically, how can we apply it in current scenario. 

Please have a look at the following video presentation I made for this strategy. Video

0

Anshul,

In its simplest form, the Kelly criteria says that the optimal bet (and leverage) you can make in a basket of asset is given by:

Where:

S is a column vector with the optimal allocation for each one of the assets and the sum of the elements of S is the optimal leverage.

C is the variance-covariance matrix of the returns.

M is the vector of the returns.

In this particular case, instead of a fixed leverage and equal weight, you can use the Kelly optimal leverage and sizing every time the strategy rebalances the portfolio.

1

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed