Author |
Topic: OCO and OSO order (4 messages, Page 1 of 1) |
||||
---|---|---|---|---|---|
Moderators: VPfau | |||||
CBabula4045 Posts: 11 Joined: Oct 19, 2015 |
Hello there,
I would like to send from C# API 2 entry orders, one long and one short that would cancel each other when either is filled. Additionally I want to send the take profit and stop loss orders for position closing when one of the above orders are executed. Is there any way I could create this kind of order linking? How would I achieve this? Thanks! Cristian nicanor Babula |
||||
NShine Posts: 36 Joined: |
Hello,
Please see our FAQ in our API documentation. http://www.gainfutures.com/api/api/ Quote: How to send OCO (or OSO)? http://www.gainfutures.com/api/api/html/9900566b-260a-4247-8326-9698b013e7b8.htm#SubSecOSO http://www.gainfutures.com/api/api/html/M_OEC_API_OECClient_SendOCOOrders.htm Edited by NShine on Mar 24, 2016 at 11:00:14 |
||||
CBabula4045 Posts: 11 Joined: Oct 19, 2015 |
Thank you very much for the reply.
I already used those APIs. The problem is that I cannot combine them to obtain a slightly more complex result. Here's what I need: In the typical scenario I want to send the following orders as OCO:
But if we zoom in a little bit, they are also OSO orders with the takeProfit/stopLoss orders linked to them as follows:
* - EntryLong1TakeProfit and EntryLong1Stoploss must be Held until EntryLong1 gets filled ** - EntryShort1TakeProfit and EntryShort1StopLoss must be held until EntryShort1 gets filled In other words I would need to call twice SendLinkedOrders, where the main orders are linked with OCO between each other. Hope this clarifies my needs a bit. Thanks! Cristian nicanor Babula |
||||
NShine Posts: 36 Joined: |
Sorry, I now understand what you are trying to accomplish. Unfortunately, we do not support linking two OSO orders together in this way. Depending on how important this is to you, your best bet would be to build this all client side. You already seem to understand how to use our SendLinkedOrders method, so your code would simply cancel whichever order doesn't execute first. The biggest downsides would be...
2. the exchange could complete both faster than your code can send the cancel request |
||||