Add Inverse Futures Brokerage Support#40
Open
Romazes wants to merge 7 commits into
Open
Conversation
- Move Bybit Inverse Futures brokerage and tests to QuantConnect.Brokerages.Bybit namespace for consistency. - Simplify GetWalletBalances to always use "UNIFIED" account type. - Remove unused SwitchPositionMode method from BybitPositionApiEndpoint. - Refactor MarketName and WalletAccountType handling in BybitBrokerage. - Restrict BybitInverseFuturesBrokerage to CryptoFuture/Inverse only. - Override GetBrokerageModel in BybitInverseFuturesBrokerageFactory. - Move PositionMode enum to new namespace. - Update test assertions and using directives. - Remove redundant and unused code for clarity.
11 tasks
test:fix: correct ETHUSD symbol
Removed BybitInverseFuturesBrokerage and its factory, merging all Bybit product support into the main BybitBrokerage class. Updated supported product categories and security types to include inverse futures. Refactored tests and removed redundant test fixtures. Simplifies codebase and centralizes Bybit brokerage logic. fix: add [TestCase] with defaults to ReturnsNullOnInvalidHistoryRequest refactor: bybitBrokerage instantiation and IsSupported method Changed IsSupported to private static in BybitBrokerage. Removed the CreateBrokerage method from BybitBrokerageFactory and replaced its usage with direct instantiation, simplifying the factory logic. revert: bybit factory
7ea947d to
3065d57
Compare
11 tasks
Replaced SupportedBybitProductCategories with GetWorkingProductCategories to select product categories based on brokerage name. Updated GetOpenOrders, GetAccountHoldings, and GetCashBalance to use this logic. GetCashBalance now returns a single USD balance for Inverse category. Added GetWorkingProductCategories method.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds support for Bybit inverse futures contracts by introducing a dedicated
BybitInverseFuturesBrokerageand its factory. Inverse derivatives use a separate account from the Unified Trading Account, so a standalone brokerage class was chosen over extending the existing one.Related PRs
Continues work from #6.
Related Issue
N/a
Motivation and Context
Finishing the current implementation of support for inverse futures.
Requires Documentation Change
N/a
How Has This Been Tested?
Types of changes
Checklist:
bug-<issue#>-<description>orfeature-<issue#>-<description>