I'm making a CoinBasePro TradingBot and I've got some error with trying to make a position.
class Trader():
def __init__(self):
self.public = 'Public'
self.passphrase = 'Passphrase'
self.secret = 'Secret'
self.auth_client = cbpro.AuthenticatedClient(key= self.public, b64secret= self.secret, passphrase= self.passphrase)
Then, there is some RSI calculation function (float output) and direction function.
Next thing is to make a position function:
def make_pos(self, ticker):
rsi = self.RSI_calc(ticker)
direction = self.set_direction(ticker)
if rsi <= 42 and direction == 'buy':
position = self.auth_client.place_market_order(product_id= ticker, side=direction, size= self.QUANTITY)
print(position)
You know, it should output something like { "id": "d0c5340b-6d6c-49d9-b567-48c4bfca13d2", "price": "0.10000000", "size": "0.01000000", "product_id": "BTC-USD", "side": "buy", "stp": "dc", "type": "limit", "time_in_force": "GTC", "post_only": false, "created_at": "2016-12-08T20:02:28.53864Z", "fill_fees": "0.0000000000000000", "filled_size": "0.00000000", "executed_value": "0.0000000000000000", "status": "pending", "settled": false }
, but it returns {'message': 'Forbidden'}
Any hints please?
My thanks.