Back

SetCash in live test mode

I have set the cash to 30,000 in my code but when I deploy it to live mode it sets it to 100,000. Normally it's not a big deal but it's important to me because I'm trying to calculate the trade cost vs. profit in high number of trades. Moving the cash from 30,000 to 100,000 completely changes the scenario as Interactive Brokers charges a minimum of $1 if the cost per share is less than $1.

Is there any way to override this behavior?

Thanks.

Update Backtest








In QC Paper trading we set the starting cash for a project to $100k and as the algorithm is started and stopped over time the cash is preserved between deployments giving you an appearance of a real live algorithm. In paper trading with IB we pull the cash from IB's API.

Either way; the IB fee models are not affected by the cash balance. You can update the fee models as you wish if they are a problem,

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. So the cash in QC Paper trading is hardcoded and cannot be configured programmatically?

 

0

Try this Patrick; would not recommend it though and your equity plot might look funny:

Portfolio.SetCash(_cash);

 

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