Back

Calling Portfolio[symbol].AbsoluteHoldings failed

I cloned QCU Martingale Position Sizing Strategy and failed to compile since the AbsoluteHoldings method could not be found in SecurityHolding class.
How can I fix it?
Update Backtest








Welcome to QC @Zeyu :) Thanks for reporting this - we've been moving too fast & loose with the API recently for live trading. We updated the cash management system a while back so that when you make a trade - the equivalent de-leveraged cash is instantly removed from your account. The side effect of this is that algorithm I think now needs a different way of calculating loss per share.

Also the SetHoldings() file is now part of the underlying QCAlgorithm. So you can delete that entire file from your local version. All orders are also placed synchronously, so the cash and your portfolio are updated instantly.

I'm working on updating the QCU algorithm now :) I'll try publish it by this evening
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.


I've gone through and fixed a number of bugs in the original university code! Please find the updated algorithm here. I will update the QCU algorithm as well.

This new algorithm looks very much like martingale! Look at those crashes! :D
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 @Jared!
0

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