Back

Calculating log returns and vol

I just wondering if there is a simple way to calculate log returns for the last a few days and the vol of a list of tickers? I thought this is pretty basic needs, but I looked up quite a few posts in the community, no one mentioned this. Or should I just define 20 queues and track them?
Update Backtest








Hey Travis!

Instead of using a queue and managing the length of it yourself, have a looking at the RollingWindow class, super handy for that. As for computing the log return and vol, they sound like they could be defined as indicators. You can submit an issue at the open source [git hub](https://github.com/QuantConnect/Lean/issues) project to request these to be made. Feel free to implement them too!
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.


Thank you Michael! That definitely pointed a way. Would you be kind enough to provide me a short sample? I think it would be an extremely useful reference for other folks too
0

Travis, check out the already implemented indicators on github. Also, take a peak at the indicator documentation
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.


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