Author |
Topic: how to get current bid/ask without waiting for onPriceChanged Event. (27 messages, Page 1 of 2) |
||||
---|---|---|---|---|---|
Moderators: VPfau | |||||
BBrandon Posts: 24 Joined: Dec 08, 2010 |
Hi,
I want to get the current market for a future without having to wait for an onPriceChanged event. This is relevant for illiquid securities for which markets are not updated that often. How can I do this ? Apologies for cross posting, but I realized that the question is more relevant in this. Thanks in advance, Brandon Brandon |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
Hello,
The first time after subscribing OnPriceChanged will be called immediately with the latest snapshot of quote that we have received from our data provider. Victor Vins Software Developer |
||||
BBrandon Posts: 24 Joined: Dec 08, 2010 |
hmm,
That would seem reasonable. However it doesnt always seem to happen that way, for both the api and the prod environment. I have found lag times of at least 20seconds for some securities. Is there some way to manually trigger the update ? thanks, Brandon Brandon |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
Please specify timestamp and symbols of the issues, we will research the reason of lag.
Victor Vins Software Developer |
||||
BBrandon Posts: 24 Joined: Dec 08, 2010 |
for example, CLTM1, I subscribed at 2:26:30 est and got the first onPriceChanged event at about 2:26:49pm est, yesterday 28th feb 2011.
On feb25th I subscribed to sb-m-sh1 at at about 13:25 est and did not get any updates ( the market closed 13:30pm). Strange thing is that I have traded that contract in the past, so even though flat, I think I automatlcally subscribe to this. This seems to be intermittent. Can you think of any way to force a refresh ? Thanks Brandon |
||||
BBrandon Posts: 24 Joined: Dec 08, 2010 |
PS. These examples are both for the production server.
Brandon |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
If you have even flat position, you are subscribed automatically for these contracts. In this case, you got the snapshot immediately after connecting to OEC and Contract.CurrentPrice should contain this snapshot. Could you please check it?
Victor Vins Software Developer |
||||
BBrandon Posts: 24 Joined: Dec 08, 2010 |
Hi,
Thanks for the suggestion. I was able to get the data I needed from Contract.CurrentPrice. As am asoed the contracts I mentioned earlier however still seem to behaving strangely. They dont seem to update any new trades (via lastPrice, lastDatetime and lastVol), just changes in the bid/ask quotes --- even though I have executed trades, the new trade is not reported in the OnPriceChanged event. Brandon |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
Hello,
could you send me order id that was not reported back via quotes? btw, the most reliable way to get all trades is to use tick subscription, not quote subscription. Victor Vins Software Developer |
||||
BBrandon Posts: 24 Joined: Dec 08, 2010 |
Will tick subscription provide the bid ask quotes ?
I traded 38528322 which was not reported back to via an onchangedPrice event. This stream did not seem to update any trades after subscription ... Thanks, Brandon Brandon |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
If you are using the latest version of OECAPI, yes, ticks contain bid/ask info too.
The issue with TAS ticks has been localized and developers have been notified. Thank you for details! Victor Vins Software Developer |
||||
BBrandon Posts: 24 Joined: Dec 08, 2010 |
I was not aware you could do that.
Just to be clear. I see three ways of subscribing to OEC data: 1) SubscribeTicks 2) Subscribe and having OnPriceChangedEvent feeding OnPriceChanged handler. 3) Subscribe and having OnPriceTick feeding OnPriceChanged handler. Are you referring to option 1) ? What events does this trigger - OnPriceTicks ? Currently I am using 3.5.0.0 of the API and version 3.5.022 of the OEC Trader Developer and 3.5.0.21 of the OEC Trader. Brandon |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
OnTicksReceived is a event for SubscribeTicks.
API from OEC Trader 3.5.0.21 has this functionality. Victor Vins Software Developer |
||||
BBrandon Posts: 24 Joined: Dec 08, 2010 |
The API that comes with my 3.5.0.21 of OEC Trader (i.e. in the OEC API COM 3.5 branch of the OEC Trader installation) has a version of 3.5.0.0 under c# properties. I just want to make sure I have the most up to date versio of the API. If not, then where do I get it ?
Thanks again, Brandon Brandon |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
All versions of OECAPI for one branch has the same version number - 3.5.0.0. This is confusing, but we have to go this way.
Victor Vins Software Developer |
||||
BBrandon Posts: 24 Joined: Dec 08, 2010 |
The API which is packaged with OEC Trader 3.5.0.21 (the most recent LIVE trading platform I could find) does NOT have that functionality.
The API which is packaged with OEC Trader Developer 3.5.0.22 (the most recent DEMO trading platform I could find) does have that functionality. I want to trade LIVE. Can I use the API from the demo trading platform for live trading ? Brandon |
||||
BBrandon Posts: 24 Joined: Dec 08, 2010 |
Nevermind. I was looking at an outdated file. Where should we be downloading the API files from for updates ?
Brandon |
||||
BBrandon Posts: 24 Joined: Dec 08, 2010 |
Hi,
I have been playing with the Tick subscription and I have a few questions. 1.This does not provide me with bid/ask volumes, correct ? 2.This only fires when an actual trade occurs ? For my application I need to track the bid/asks, so it would seem that quote subcription triggered by OnPriceTick might be better. but what did you mean when you said tick subscription was more reliable in capturing trades ? Thanks, Brandon Brandon |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
Hello,
1. Right, there are no bid/ask volumes 2. Right, it triggers only when actual trade occures. The difference with quotes - tick event triggers for every trade, quote subscription is throttled one and some trades can be missed on client side. Victor Vins Software Developer |
||||
BBrandon Posts: 24 Joined: Dec 08, 2010 |
Hi,
Thanks for the clarification. If I use OnPriceTick with OnChangedEvent handler and set the batchInterval throttle to 0, I am still not guaranteed to get all the trades ? I.e. Tick subscription is still superior to that method ? Will subscribing to ticks as well as to quotes count against my subscription limit ? I am thinking of complementing both data feeds. Thanks, Brandon |
||||