danpaquin / coinbasepro-python

The unofficial Python client for the Coinbase Pro API
MIT License
1.82k stars 732 forks source link

Stop Orders? #293

Closed ghost closed 6 years ago

ghost commented 6 years ago

How to place a STOP order? gdax_client.sell() doesn't like the 'stop' or 'stop_price' keywords.

errors: sell() got an unexpected keyword argument 'stop' sell() got an unexpected keyword argument 'stop_price'

Please provide a BUY and SELL example, with a limit price too. Thanks.

nalepae commented 6 years ago

Hello,

Without limit price:

The equivalent of following picture image

is the following code:

auth_client.buy(stop_price="9000", product_id="BTC-EUR", stop_type="entry", type="market", funds="1000")

The equivalent of following picture image

is the following code:

auth_client.sell(stop_price="6000", product_id="BTC-EUR", stop="loss", type="market", size="0.02")

With limit price:

The equivalent of following picutre image is the following code: auth_client.sell(stop_price="6000", product_id="BTC-EUR", stop="loss", size="0.02", price="5900")

Is that OK for you ?

ghost commented 6 years ago

Yes, excellent, thank you.