QuantConnect / Lean.Brokerages.ByBit

ByBit Brokerage Integration to LEAN
4 stars 5 forks source link

Add inverse support #6

Open arodus opened 8 months ago

arodus commented 8 months ago

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 https://github.com/QuantConnect/Lean/issues/5898 Depends on https://github.com/QuantConnect/Lean.Brokerages.ByBit/pull/5

How Has This Been Tested?

Types of changes

Checklist:

jhonabreul commented 7 months ago

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.

arodus commented 7 months ago

@jhonabreul Will double check the different wallet-balance endpoints.

arodus commented 7 months ago

@jhonabreul

How will the we know which account to used? Do we need a different brokerage class for this case for inverse contracts trading only? If so, would we need a new brokerage factory as well?

Yes it seems that's the case. Will add a new brokerage factory and adjust the Brokerage again so it can be inherited from.