QuantConnect / QuantConnect/Lean

Execute to Multiple Brokerages

Open
#832 1 comment 3 reactions 1 assignee View on GitHub

@mchandschuh is already working on this.

Since Apr 5, 2017.

Brokerage feature
Dominant language
C#
Stars
21.7k
Forks
5.3k
Avg merge
2d 22h
Merged PRs (30d)
34

Description

Add the ability to execute to multiple brokerages from within on QCAlgorithm structure. This will allow running cross asset strategies (execute equities on IB, fx on FX brokerage etc).

Inside the API add a SetOrderRouter() method which takes a IOrderRouter class for directing which brokerage an order should go to.

Create a master brokerage which takes an array of brokerages; and passes through the commands as required. When a new order arrives use the order router to determine which brokerage will fill the trade. This master brokerage should always be used even if there is just 1 brokerage.

Inside the SetupHandler set the user defined router in the master brokerage.

BrokerageData could be adjusted so the dictionary keys include the brokerage name.

Need to validate concerns of how the IBrokerage is instantiated given its a singleton in Composer.cs now.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.