Back

Redeploying an Algorithm: GDAX Average Price

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? 

Update Backtest







>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.

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 @Jared Broad! 

So if I implement a workaround, is there a way to overwrite the average price manually from within the script?    

0

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
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