Author |
Topic: Order rejection not captured (4 messages, Page 1 of 1) |
||||
---|---|---|---|---|---|
Moderators: VPfau | |||||
WTeng Posts: 8 Joined: Nov 28, 2014 |
Hi all,
I'm using C# to write my own program. However, when I try sending some invalid orders through the SendOrder method, I did not receive any OrderState.Rejected notification through the OnOrderStateChanged event. Which is the right event to use for capturing order rejections? Thanks. Wu liang Teng |
||||
VPfau Moderator Posts: 164 Joined: |
Hello,
please check out our Basic example here: https://github.com/oecapi/BasicExample On VS console I have this output: OnOrderStateChanged: -2: Unknown -> Sent The order has changed status on OECClient.OnOrderStateChanged event. Does it work for you? Vitaliy Pfau |
||||
WTeng Posts: 8 Joined: Nov 28, 2014 |
Yes, I eventually figured out that in C#, the latest state is stored in the Order.States.Current.OrderState argument rather than the OrderState argument.
The arguments I'm referring to come from the event OnOrderStateChangedEvent(OEC.API.Order order, OEC.Data.OrderState state) Thanks anyway. |
||||
VPfau Moderator Posts: 164 Joined: |
Yes, our documentation has a delegate declaration where the parameter with OrderState type has name "oldOrderState".
public delegate void OnOrderStateChangedEvent( http://futures.gaincapital.com/api/api/html/T_OEC_API_OnOrderStateChangedEvent.htm[\url] Vitaliy Pfau |
||||