Back

(Paper Trading, Python) Coinbase Pro/GDAX cash amount does not update.

self.Portfolio.GetBuyingPower("USD") does not work for Coinbase Pro. How do I update my dollar value after an order? My starting cash is self.SetCash(1000). It keeps trying to put through buy orders even after one has been filled, I'm guessing because it can't see my updated cash amount or I'm using the incorrect statement. I get the "Insufficient buying power" error. Here is my if statement (( if rsi_value <= 30 and self.Portfolio.Cash > 200: )) Thanks in advance.

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.


Also is it possible for me to make it trade once per day and wait until the next day to trade again?

0

Hi Wesley,

Thank you for the questions.

For your first question, it's hard for us to reproduce the issue without a full algorithm. Since it's a live trading algorithm, please send your question with a backtest or a complete code snippet through support tab in QC Terminal.

For the follow-up question, it's possible to put a flag to control the trading frequency. You could start with the code snippet as below:

def Initialize(self):
self.lastTradeDay = -1

def OnData(self, data):
if self.Time.day == self.lastTradeDay:
return
# insert trading logic
# ...
# if (trading condition is met):
# trade
# self.lastTradeDay = self.Time.day

I hope this helps. 

Xin

1

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, I'll try out that code and see how it works. I found another thread and used code that keeps up to date on the USD amount. So it is no longer putting through too many orders.

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