-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
order is removed due to no enough cash/margin, however, it's a sell order #328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
(I am not familiar with the codebase, I am a new user)
Actually I think we need "some" cash as we need to pay a commission. |
The commission is already accounted for with spread at trade entry. If we're just selling (buying) some units we already have (owe), we should not be checking available cash. |
@kernc, just for the sake of my understanding:
I understand that there is a commission when we enter a trade (e.g. buy a stock), but we should also pay a commission when we are selling. At elast for Interactive Brokers, we pay commission when closing a position. (And as I know this is the same for most of the cases). In theory I could not sell my shares on IB if I would not have enough money to pay the commission at "sell time". |
Ah, this already came up in #149. The idea then was to just pass
I don't think that's correct. You pay the commission when and upon exchanging the asset for whatever it's priced. |
The recommended way of closing existing trades is via Alternatively, if after the initial long trade you call |
Uh oh!
There was an error while loading. Please reload this page.
Currently position is long and there's buy trade in queue:
Now a sell signal is triggerred, and a sell order is placed, however, the order is removed/cancelled in
_process_orders
due to no cash/margin:logger is added by me.
Since this is a sell order, why we need cash/margin?
Expected Behavior
if the order is for sell, we need to check if we hold long position; otherwise, check if cash is enough.
Actual Behavior
the sell order is discarded due to no cash/margin. Thus no more buy/sell even buy/sell signals are fired.
Steps to Reproduce
Additional info
The text was updated successfully, but these errors were encountered: