-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Feat/add new order types #7254
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
base: development
Are you sure you want to change the base?
Feat/add new order types #7254
Conversation
@cardosofede FYI |
@nikspz thanks |
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.
This solution might be a good approach to support multiple order types. Just add them to one connector and let QA test. Good work!
# New order types | ||
STOP_LOSS = 4 | ||
TAKE_PROFIT = 5 | ||
TRAILING_STOP = 6 | ||
|
||
def is_limit_type(self): |
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.
I think that we need to review carefully if there is a possibility that the take profit order type is limit for the is_liimit_type condition
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.
On Kraken, TAKE_PROFIT has a different entry form and it executes as a MARKET order when the % or the price difference is matched, same for the other. Kraken does have limit equivalent to these. I will commit my modifications of the Kraken connector then - It will take a bit longer, I need to clean-up and ad tests in this case
Setting review to check on the tests |
PR update:
|
@MementoRC if you can provide a script so @rapcmia can test an advanced order will be cool! |
Yes, I am working on a simplistic position executor for demonstration |
@nikspz @MementoRC |
Next we'll need to add the |
Yep, reproduced on the latest commit b8b0f9d Also reproduced error #7397 using this PR Steps: |
Ok, I understand, but this PR should not include the Kraken part, I added it to help QA for the new order mechanics. I will look into how to add this support in the Kraken connector. It is not a Trade yet after being placed, so we need to intercept the request. Once completed, everything should return to normal |
@nikspz I made a complete mess at my end and mistakenly pushed be fore realizing what had happened, hopefully it's completely cleaned up |
Before submitting this PR, please make sure:
A description of the changes proposed in the pull request:
Adds
**kwargs
to StrategyBase class to enable support for other order type (STOP LIMIT, TAKE PROFIT, TRAILING STOP, etc...)Tests performed by the developer:
Tips for QA testing: