QuantConnect / QuantConnect/Lean

Implement "Assigned by Not Used Buying Power" Restrictions

Open
#4,987 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Expected Behavior

A limit order is placed, the amounts of the currency being sold have been frozen/subtracted. If an order cancels, the amounts of that currency unfreeze.

Actual Behavior

The amount of the currency being sold does not freeze.

Potential Solution

Perhaps modify the order event handler logic in such a way, that it subtracts submitted funds when the order is submitted.
I have found a similar issue #2161 however that's for market orders. For Limit orders, I have the same issue.

What do you guys think, is it an issue at all? Or it's good behavior? I'm new to trading, I'm simply implementing my own GUI client and I see that it might not be the best in terms of UX.

Checklist
  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues

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.

Research direction

Trace the limit-order event handler logic described in the issue, comparing it with the related market-order issue #2161. Determine where submitted selling funds should be frozen and where cancellation should release them; done means limit orders reserve the sold currency and cancellations unfreeze it.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
fintech-quant
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.