-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
🚧 ClientOrderId propagation 🚧 #617
Comments
@Slacquer, I have one question about this issue. We're speaking about client order identifiers for the leg orders (take profit and stop loss) of the bracket order, right? Right now you can specify only one client order ID per order request and this order ID will be assigned to the main (market) order of the compound bracket order. The workaround is to get the main order with both legs and change the auto-assigned client order ID for each leg using the order modification request. It will require 3 additional API calls but if you want to track the execution of your orders via streaming API this is only the option. If you'll confirm that I understand the problem correctly I can prepare a code snippet that will do all the needed work for you and maybe I'll even include this code in the Extensions library. |
Yes correct, the leg orders have a random guid, not the one I assigned, in fact all clientOrderIds are random when a target or stoploss is hit, NOT my id. I have since reworked my code to only create a single bracket order, i would ideally like to have 2 targets. Any suggestions would be very helpful. |
After some research and discussing the problem with Alpaca technical support, I can confirm that it's impossible to solve this problem right now. There are two possible options to specify the The current API for order placement supports only one According to Aplaca API developers, the rule about preventing orders change in the As a temporary workaround, you can maintain the map between your expected |
Hello, I am using the ClientOrderId for propagation to help me determine bracket success and failures. I have noticed that when i set the ClientOrderId in a BracketOrder.WithClientOrderId, this value DOES NOT end up anywhere in the streamingClient.OnTradeUpdate. I either just simply do not understand its purpose or there is a bug. The ITradeUpdate.Order object does not contain the value that i specified, it does have a random Guid, but not the value i added., For example the value i specified was like this "TSLA-[SOME GUID]-T1" this allowed me to know that my target 1 of a bracket order had been hit. Upon further investigation, it should be noted this is ONLY a problem when a target or stoploss is hit, that is when a seemingly random id is generated for the ClientOrderId, and not MY specified ClientOrderId. my code looks at this if (tu.PositionQuantity == 0) (tu being ITradeUpdate)
The text was updated successfully, but these errors were encountered: