API Support Forum
OEC API > API Support > how to unsubscribe from price updates after an order
Author Topic: how to unsubscribe from price updates after an order
(6 messages, Page 1 of 1)
Moderators: VPfau
MMike94
Posts: 13
Joined: Nov 19, 2009


Posted: Feb 25, 2011 @ 10:59 AM             Msg. 1 of 6
I see that after submitting an order for a contract, the server automatically subscribes me for price updates for that contract. This is actually documented in the API.

But how can I stop getting these price updates? Calling OECClient.Unsubscribe() does not stop them.

Oh, the position is that contract is flat.

Thanks

Paul
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Feb 25, 2011 @ 11:26 AM             Msg. 2 of 6
Hello,

OECAPI do not unsubscribe and do not allow unsubscribing such subscriptions. I've placed this issue to our bugisite. Thank you.

Victor Vins
Software Developer
MMike94
Posts: 13
Joined: Nov 19, 2009


Posted: Feb 25, 2011 @ 11:36 AM             Msg. 3 of 6
Victor,
Thank you for the reply.
So to be sure I understand you, there is no way to stop those price updates.
Will your system automatically stop them at some point? ever?

Thanks,
Paul

Paul
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Feb 25, 2011 @ 11:51 AM             Msg. 4 of 6
If you reconnect OECAPI after trading session, flat positions will not be loaded to client-side and, as consequence, OECAPI will not subscribe to it.

Victor Vins
Software Developer
MMike94
Posts: 13
Joined: Nov 19, 2009


Posted: Feb 25, 2011 @ 03:50 PM             Msg. 5 of 6
Victor,
Yesterday I had submitted several orders for ESH1. However by the end of the day, my position was flat. This was prior to 6 PM EST yesterday.

I just started my program for the first time today (3:50 PM EST). I did not subscribe to any contracts, yet I'm getting price updates for ESH1. The API confirms that I have no positions.

Calling Unsubscribe for ESH1 does not stop the price updates.

Paul

Paul
MMike94
Posts: 13
Joined: Nov 19, 2009


Posted: Feb 25, 2011 @ 04:28 PM             Msg. 6 of 6
Interesting. Its now 4:28 PM EST and the price updates have stopped.
Thanks.

Paul