Whenever I send market price query continuously to the ADS server, server always replies the same price. The type of the response messages are always REFRESH. I also don’t know if it is normal that I never get UPDATE or STATUS type response messages.
I use the below code to query the ADS server. The code is called in a while loop continuously.
What can be wrong? Could you plese help?Thanks in advance
ReqMsg reqMsg = new ReqMsg(); AttribInfo attribInfo = new AttribInfo(); reqMsg.MsgModelType = ThomsonReuters.RFA.RDM.RDM.MESSAGE_MODEL_TYPES.MMT_MARKET_PRICE; reqMsg.InteractionType = ReqMsg.InteractionTypeFlag.InitialImage | ReqMsg.InteractionTypeFlag.InterestAfterRefresh; attribInfo.NameType = ThomsonReuters.RFA.RDM.RDM.INSTRUMENT_NAME_TYPES.INSTRUMENT_NAME_RIC; attribInfo.Name = new RFA_String("TRYTOM=D3"); attribInfo.ServiceName = new RFA_String("IDN_RDF"); reqMsg.AttribInfo = attribInfo; OMMItemIntSpec ommItemIntSpec = new OMMItemIntSpec(); ommItemIntSpec.Msg = reqMsg; long itemHandle = this.ommConsumer.RegisterClient(this.marketPriceEventQueue, ommItemIntSpec, this); int dispatchReturn = this.marketPriceEventQueue.Dispatch(10);
You have specified an Interaction type of ReqMsg.InteractionTypeFlag.InitialImage | ReqMsg.InteractionTypeFlag.InterestAfterRefresh
This means you are requesting an Initial Image (Refresh) followed by any further events that occur after the Refresh - such as Updates or change in State/Status.
You don't need to keep requesting the same instrument - just request once and then call the dispatch() method in the loop. Your ProcessEvent handler should then receive a Refresh, followed by any Updates as and when they occur.
I recommend you work through the short Tutorials on this page to get a better understanding of how the RFA API works Robust Foundation API .Net Tutorial
The behaviour you are seeing is completely normal. You will only see changes in the price if market conditions change. If you are viewing a symbol that is inactive or viewing it outside market trading hours, you won't see changes that frequently.
Try a symbol that you know is very active and one that is actively trading and you should see the values changing. You will also see UPDATE messages when market conditions change for this symbol.