QuantConnect / QuantConnect/Lean
Execute to Multiple Brokerages
@mchandschuh is already working on this.
Since Apr 5, 2017.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.