Hello All,
I need to redeploy and algorthm after making some tweaks. I would prefer to try and continue where I left off. Is there a way to manually override the strategy average price, starting capital etc?
I guess this could be broker specific as there is no concept of a "position" on crypto exchanges when not using leverage.
When redploying, the strategy has my latest holdings but the intended exit for those holdings was calcuated from the average price.
One method I was thinking was to add a parameter for the average price before termination. Then incorporate that in the calcuation. Is there a better method?
Jared Broad
>I guess this could be broker specific as there is no concept of a "position" on crypto exchanges when not using leverage.
Precisely, we cover this a lot in the discussions about crypto. Sadly until the brokerage starts saving the positions and returning them to us its impossible for QuantConnect to record them.
I'd recommend making a REST service and saving the current holdings.
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.
ThatBlokeDave
Thanks @Jared Broad!
So if I implement a workaround, is there a way to overwrite the average price manually from within the script?
Jared Broad
You can set the cash ledger of holdings on launching the algorithm. See this example of SetCash optional arguments.
Your question is actually - how do you reset virtual positions. Holdings are inside each security class and accessed via the Securities helper.
You can set the quantity of a virtual position like the demonstration below because it has a public setter.
Securities["BTCUSD"].Holding.Quantity = 1000
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.
ThatBlokeDave
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.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!