QuantConnect / QuantConnect/Lean
ImmediateExecutionModel.py feature enhancement request
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 21.7k
- Forks
- 5.3k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 34
Description
Expected Behavior
In live cash account, when rebalance the holdings (portfolio with 100% holding + 0% cash) including sell order and buy order. The order should be first execute the sell order and then buy order.
if execute not in that order, the broker will report not enough cash error
Actual Behavior
The order execution does not do sell order first, then buy order.
Potential Solution
Execute sell order first, upon completion, execute buy order
Checklist
- [Y] I have completely filled out this template
- [Y] I have confirmed that this issue exists on the current
masterbranch - [Y] I have confirmed that this is not a duplicate issue by searching issues
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.
Research direction
Start with ImmediateExecutionModel.py and trace how rebalance orders are submitted and completed. Reproduce a live cash-account rebalance containing both sells and buys, then verify that all sell orders complete before buy orders are submitted and that the insufficient-cash broker error no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- fintech-quant
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100