Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AuthenticatedClient.place_stop_order Returning Invalid #450

Open
ForrestHerman opened this issue Jun 30, 2021 · 3 comments
Open

AuthenticatedClient.place_stop_order Returning Invalid #450

ForrestHerman opened this issue Jun 30, 2021 · 3 comments

Comments

@ForrestHerman
Copy link

Currently using the below line of code to try and place a stop order

print(client.place_stop_order('ETH-USD','loss',1000.0,size=.001))

The resulting console output can be seen below

{'message': 'Invalid order_type stop'}

Checking my orders on Coinbase Pro confirms that no orders were placed.

The following two lines of code do however work

print(client.place_limit_order('ETH-USD','sell',4000.0,.001))

print(client.place_market_order('ETH-USD','sell',.001))

pip list shows cbpro as being version 1.1.4

@scumola
Copy link

scumola commented Aug 2, 2021

Also seeing this same behavior using:
cbpro-notbroken v1.1.5
or
cbpro v1.1.4

@scumola
Copy link

scumola commented Aug 2, 2021

Fixed in another repo. Remove this cbpro and:
pip install git+git://github.com/coin-tracker/coinbasepro-python.git
should give you the working version - the stop order syntax has changed slightly, so need to adjust. The new repo has updated README, so use that example.

@fajtak
Copy link

fajtak commented Aug 19, 2021

There is this very "stupid" but very simple workarround:

instead of ussing place_stop_order() you can use place_order() with the parameters that would be used for place_stop_order(). It worked for me.

params = {'product_id': pair,
'side': "sell",
'price': new_price,
'order_type': "limit",
'stop': "loss",
'stop_price': new_price,
'size': new_size,
'funds': None,
'client_oid': None,
'stp': None,
'overdraft_enabled': None,
'funding_amount': None}
params = dict((k, v) for k, v in params.items() if v is not None)

out = client.place_order(**params)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants