-
Notifications
You must be signed in to change notification settings - Fork 738
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
Fix creation of stop orders #370
Fix creation of stop orders #370
Conversation
A 'stop' isn't an actual order type but is actually a special flavour of a limit order. The 'stop' and 'stop_price' params need to be set. There are 2 stop types: 1. loss (triggers at or below the stop price) -> this has to be a sell order to be valid (the Coinbase Pro will respond with an error otherwise) 2. entry (trigger at or above the stop price) -> has to be a buy Modified existing and added new test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
running into this as well, please merge
i was able to work around this using the regular .sell with limit function and adding the stop and stop_price args as follows:
|
This looks great! Just one minor thing - in the |
@jacov - So you set the 'price' and 'stop_price' to the desired Stop loss price? Since the Stop_Loss prices is typically below the current price, this will not be a problem with this Limit price? Since you used the 'LIMIT_PRICE' for both 'price and 'stop_price' I was concerned. |
Made a few minor changes to get the merge in. Thanks again. |
Related issue: #368
A 'stop' isn't an actual order type but is actually a special flavour of
a limit order. The 'stop' and 'stop_price' params need to be set.
There are 2 stop types:
order to be valid (the Coinbase Pro will respond with an error
otherwise)
Modified existing test and added new test to check for invalid combinations.