Skip to content
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

Bracket orders #156

Open
jajuanm2 opened this issue Mar 25, 2020 · 2 comments
Open

Bracket orders #156

jajuanm2 opened this issue Mar 25, 2020 · 2 comments

Comments

@jajuanm2
Copy link
Contributor

Anyone had any luck with bracket orders. I have it working but when you cancel the parent it does not cancel the two child orders. I set the parent order on the two child orders and that works fine.

@jajuanm2
Copy link
Contributor Author

Looks like the parent ID option is missing for some order types like limit or market.

@jajuanm2
Copy link
Contributor Author

I fixed it buy updating the limit order as follows

module.exports = function (action, quantity, price, transmitOrder, parentId) {
assert(.isString(action), 'Action must be a string.');
assert(
.isNumber(quantity), 'Quantity must be a number.');
assert(_.isNumber(price), 'Price must be a number.');

if (transmitOrder === undefined) {
transmitOrder = true;
}

return {
action: action,
lmtPrice: price,
orderType: 'LMT',
totalQuantity: quantity,
transmit: transmitOrder,
parentId: parentId || 0
};
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant