Open Menox10 opened 5 years ago
The correct use is: time_in_force='GTT', cancel_after='min'
To cancel after 2 or 3 minutes use a timer in your loop and then send a cancel message after the elapsed time. If you are getting into the fine details of time and candles then it can be helpful to use public_client.get_time() in order to get the most accurate coinbase time and build a stopwatch from that.
Also I would highly recommend using a more recent version of python!
Thanks noah222 for your prompt reply and advise. I tried it with your suggestion but still it fails. Maybe my python version is too old. I will use my self timed cancel order function. This is also more flexible in the time you would like to wait.
Traceback (most recent call last):
File "cbpro-basis.py", line 95, in GTT
This is very odd. You basically only get this error if you provide the cancel_after
kwarg without also providing time_in_force='GTT'
I was not able to reproduce this on my end. I copied and pasted your call and it works on my end. Are you still seeing this issue?
command: b=auth_client.place_order(product_id='ETC-EUR', order_type='limit', side='buy', price='4.23', size='1', time_in_force='GTT', cancel_after='1min')
*** response
ValueError Traceback (most recent call last)