Back

Calculating portfolio turnover (Python)

Hi! I'm new to QuantConnect and have really been enjoying the platform.

I'm wondering if there's a way to add custom metrics, specifically portfolio turnover, in the cloud platform, or would this best be done using LEAN? I see some mention of portfolio turnover in the repo, but these implementations appear to all be in C#. It also seems that this metric is available as an Alpha Stream Scoring Criteria but again I'm not sure how to port this over to a backtest.

 

Thanks!

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.


Hi Serena,

I've attached a sample algorithm which demonstrates how we can calculate the portfolio turnover. As was pointed out, this metric is not on our backtest view page or reports. It could potentially be added though by making a PR to our GitHub repo.

Best,
Derek Melchin

3

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 so much, Derek for the quick reply and clear answer! I'll definitely be adding that into my backtests and love the idea of potentially contributing through making a PR. Thanks!

1

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