API Support Forum
OEC API > API Support > Subscription limit
Author Topic: Subscription limit
(9 messages, Page 1 of 1)
Moderators: VPfau
AAlan
Posts: 13
Joined: Jun 01, 2010


Posted: Apr 07, 2011 @ 05:28 PM             Msg. 1 of 9
According to information in another message, it seems that OEC API has a subscription limit of 50 quotes, 5 ticks, 10 bars, 5 DOMs.

Is subscription to OECClient.Global.Subscribe(contract) considered as quote subscription.

I encountered a problem. My program would like to monitor around 20 symbols real time. I used the OECClient.Global.Subscribe(contract) to subscribe for realtime quote. However, I normally can only get 11-12 realtime subscription. By tracing the program and looking in the subscription detail using OECClient.Global.Subscriptions. I found that there are some other subscription in the subscription list.

I suspect that the other subscription are generate when my program request for bar backfill using OECClient.Global.RequestBars.

Now, my questions are:
1. Can I have up to 50 OECClient.Global.Subscribe(contract) to monitor 50 realtime symbol?
2. Will OECClient.Global.RequestBars generate subscription and affect the limit of OECClient.Global.Subcribe?
3. How can I remove those subscription created by OECClient.Global.RequestBars?

Thanks

Alan Chau
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Apr 08, 2011 @ 09:07 AM             Msg. 2 of 9
Hello,

do you have any open positions? Each open position generates one additional automatic subscription.

Victor Vins
Software Developer
AAlan
Posts: 13
Joined: Jun 01, 2010


Posted: Apr 08, 2011 @ 05:25 PM             Msg. 3 of 9
Victor,

I don't have any open position.

Alan Chau
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Apr 11, 2011 @ 08:50 AM             Msg. 4 of 9
Alan,

50 quotes limit is a limit for Subscribe(contract) subscriptions and automatic subscription for open positions (or positions that were flatten in the current trading session).

RequestBars does not increment subscription counters, but SubscribeBars does ("10 bars limit" in your example).

Unfortunately, Subscriptions list can contain items after executed RequestBars too, you can ignore them (please see Updatable fieldhttp://www.openecry.com/api/api/OEC.API.Subscription.Updatable.html )

Victor Vins
Software Developer
AAlan
Posts: 13
Joined: Jun 01, 2010


Posted: Apr 11, 2011 @ 09:44 AM             Msg. 5 of 9
Victor,

I only use Subscribe(contract). I didn't use SubscribeBars. So, I don't understand why I cannot get more than 11 subscribe(contract). Are there any event when I hit a subscription limit? Can I check the current subscribe no? I plan to write small routime to dump all the subscriptions to see what happen. Are there any variables that I can add to the dump to help me find out what happen?

Thanks,
Alan

Alan Chau
AAlan
Posts: 13
Joined: Jun 01, 2010


Posted: Apr 11, 2011 @ 09:48 AM             Msg. 6 of 9
Victor,

BTW, my test is on the Forex account. Is the Forex account has a different subscription limit? I didn't test the Future account yet.

Thanks,
Alan

Alan Chau
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Apr 11, 2011 @ 10:02 AM             Msg. 7 of 9
We have a diffent subscription counter for FX contracts.
You need to check "QuoteFX" in Properties list to see your current limit (please see details here - http://www.openecry.com/cfbb/index.cfm?page=topic&topicID=465)

You can calculate the current number of subscriptions from Subscriptions list: every Updatable item in this list increments the counter (and separate them by Subscription.Type)

Victor Vins
Software Developer
AAlan
Posts: 13
Joined: Jun 01, 2010


Posted: Apr 11, 2011 @ 11:43 AM             Msg. 8 of 9
Victor,

Thanks a lot for your help. Finally, I found out a bug in my program and I had fixed it.

BTW. the system keep on rejecting my orders submitted. Are there any way to get the order reject reason?

Thanks,
Alan

Alan Chau
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Apr 27, 2011 @ 01:31 PM             Msg. 9 of 9
Hello,

you need to check http://www.openecry.com/api/api/OEC.API.Command.ResultComments.html for it

Victor Vins
Software Developer