I'm using WebSocket API to subscribe fx rate from refinitiv.
I subscribe "ASK", "BID" for price and "QUOTE_DATE", "QUOTIM_MS" indicate rate event time.
Why some message I received only contains "ASK", "BID" fields?
Hello @joelxzhang
Views feature that you use allows the client application to request specific fields. After the feed/exchange sends the fields to the server, the server will filter out the fields which you do not request so only requested fields sent to you. Hence, the feature does not guarantee that every message contains all fields you specific. This depends on the feed which generates/sends the fields of each message to the server. In your case the feed did not generate QUOTE_DATE and QUOTIM_MS in every message that why's you received only ASK and BID which you specific in the request.
This is data question that the feed does not send "QUOTE_DATE", "QUOTIM_MS" with ASK and BID in every message. I would suggest you reach out to the Refinitiv Helpdesk as they have feed/data specialists who can help you on this.
But I need to know when the data generated by refinitiv, and someone told me that these two fields express the time point the data create. Or you can suggest me another field to the usage?
If you are using a streaming request, it is an expected behavior as mention by my colleague (Pimchaya). The only to way to let TREP/Elektron always returns all requested fields is to use a snapshot request.
A snapshot request is a request for one response without the intent to receive updates. The data stream is considered closed after the data is received by the consumer because the request has been fulfilled. You can send a snapshot request via the Elektron WebSocket API with "Streaming" : false attribute in the request message.
{ "ID": 2, "Key": { "Name": "EUR=" }, "View": [ "BID", "ASK", "QUOTE_DATE", "QUOTIM_MS" ], "Streaming": false}
Hi @joelxzhang
The most likely reason why some updates do not contain QUOTE related fields is because that update is for a Trade type event - rather than a Quote type event. For Trade type events the Trade related fields e.g. TRADE_DATE would be sent.
However, as mentioned by my colleague it is best to check with the Content Helpdesk for your particular instruments/RICs.