-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add inverse support #6
base: master
Are you sure you want to change the base?
Conversation
0bfd8f3
to
27b3f59
Compare
27b3f59
to
2c3e33c
Compare
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.
Nice! Thanks for the contribution 🚀 Leaving minor comments.
/// <param name="category">The product category</param> | ||
/// <param name="symbol">The symbol for which the mode should be changed</param> | ||
/// <param name="mode">The mode which should be set</param> | ||
public void SwitchPositionMode(BybitProductCategory category, Symbol symbol, PositionMode mode) |
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.
How/where is this going to be used?
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.
It's not used but the question is if it should. Hedge mode is currently not supported and for inverse the default mode is hege which can only be changed to normal mode by using the API.
So should this be done automatically or is the user responsible for that, if so is there a way to make this function available to the user in any way. It would definitely need to be documented.
QuantConnect.BybitBrokerage.Tests/BybitInverseFuturesBrokerageHistoryProviderTests.cs
Outdated
Show resolved
Hide resolved
QuantConnect.BybitBrokerage.Tests/BybitInverseFuturesBrokerageTests.cs
Outdated
Show resolved
Hide resolved
Another comment, trading inverse contracts with the Unified Trading Account will use the Inverse Derivatives account, so balance and margin will be used from the Inverse Derivatives account.
|
@jhonabreul |
b54823a
to
85cf70f
Compare
Yes it seems that's the case. Will add a new brokerage factory and adjust the Brokerage again so it can be inherited from. |
85cf70f
to
e6bcfe7
Compare
e6bcfe7
to
65cd35f
Compare
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.
New changes look good, thank you!
Approved on my side. We can wait for @Martin-Molinero to give it a look too.
Description
Add missing support for inverse
I'm currently investigating if there are changes required in the brokerage model due to a slightly different order handling. But this should only affect backtests.
Related Issue
Part of QuantConnect/Lean#5898
Depends on #5
How Has This Been Tested?
Types of changes
Checklist:
bug-<issue#>-<description>
orfeature-<issue#>-<description>