-
Notifications
You must be signed in to change notification settings - Fork 133
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
[feature request] Add support for Trailing Stop Limit Order via CLIENT_VERSION Upgrade #145
Comments
From looking at the code further, the primary in-depth change needed to make this work is to support the node-ib/ref/client/EClient.java Lines 1829 to 1879 in 85305c7
|
You don't need to use /lib/orders, those are just for your convenience. You can construct the order by yourself, which is what I do.
The important here is the transmit and parentId keys. |
Thanks for the suggestion @nemozny. I tried manually building the order as
well before, and was able to send other types of order that way. The issue
is that the “lmtPriceOffset” field doesn’t get transmitted since
outgoing.js doesn’t have code to handle it.
…On Mon, Aug 19, 2019 at 12:16 PM nemozny ***@***.***> wrote:
You don't need to use /lib/orders, those are just for your convenience.
You can construct the order by yourself, which is what I do.
const parent = orderId++
ib.placeOrder(parent, contract, {
action : "BUY",
orderType : "MKT",
transmit : false
})
ib.placeOrder(orderId++, contract, {
action : "SELL",
orderType : "TRAIL",
auxPrice : 10,
parentId : parent,
transmit : true
})
The important here is the transmit and parentId keys.
Similarly you can build your TRAIL LIMIT.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#145?email_source=notifications&email_token=ACE2MM6N4FUUM55P3TEYOOTQFLBNJA5CNFSM4IKYFK62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4TPVJQ#issuecomment-522648230>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACE2MMYK7XYGJBBDWC5K3FDQFLBNJANCNFSM4IKYFK6Q>
.
|
Update: Upon closer inspection, it appears that adding these fields was probably part of the jump from API version (Compare what the Java client supports)
(to what the JS code implements)
Adding support for newer versions of the client would address these sibling issues:
I have a hunch about how to adjust this part of the code with |
@pilwon: how can we add fields to the code that deserializes them from the server? For example, in I tried adding |
@tredondo @hydrosquall - you are late to the party, we have everything here https://github.com/stoqey/ib, @pilwon you must update the readme and point to this new version, clearly, this node-ib is very outdated and you barely merge changes, which is very misleading to other developers |
This is such a genius project, I want to join in!! I'm currently using your program and if I find any bugs, I will provide feedback on the open-source platform!!! The author is incredible!!! Please give me the PayPal of the owner, I want to make a donation!!!! My email is [email protected] |
This is the order type documented under the
Trailing Stop Limit
heading here, with the code ofTRAIL LIMIT
. It would have fields forI imagine this would be added as a new file inside of
./lib/order
with a name liketrailLimit.js
.The text was updated successfully, but these errors were encountered: