Regarding data

In my code where I receive data from Reuters, I am giving a milliseconds of 500. So at intervals of 500 milliseconds, it reads the data. Are we missing any data if we increase the time?
Best Answer
-
@liyarthomas your code does not show the event dispatch and callback handler. Application has to receive data from EMA not poll it. If the ticks are not removed from EMA fast enough, then queue will fill up and application will run out of heap memory.
0
Answers
-
Hi @liyarthomas
Depending on the volatility of the instruments you are consuming and the service you are consuming from, there could well be much higher update rates.
Are you using streaming requests or snapshot requests?
Can you confirm what you mean by 'at intervals of 500ms it reads the data' - how exactly are you controlling this?
The event callback handlers in EMA (onRefreshMsg, onUpdateMsg etc) are event driven and called as & when any new updates arrive from the server - provided that you are continuously dispatching events.
Are you limiting the calls to dispatch() to once every 500ms? If so, any updates received from the server could start building up in a queue and your callbacks will only receive the next one in the queue as and when dispatch is called. If you do not call dispatch often enough for a instrument that updates more frequently - you may not get all the updates...
Please explain how your interval reading is working....
0 -
We are using an Asynchronous server here which reads the data store every 200 milliseconds and publishing it into the zero MQ.
The event callback handlers in EMA are event driven and are called as and when any new updates arrives from server.
I have attached here just two files which does the following. But I have not attached the event driven appclient.
So what we wanted to know is that, as we are reading the datastore every 200ms, are we missing any ticks?
using namespace thomsonreuters::ema::access;
using namespace thomsonreuters::ema::rdm;
using namespace std;
int main(int argc, char* argv[])
{
try {
// instantiate callback client
mdsdemo::DataStore ds;
mdsdemo::AppClient client(ds);
//ip, port, interval, datastore
mdsdemo::AsyncServer as("*", 40000, 1000, ds );
cout << "Connecting to market data server" << endl;
// create OMM consumer
OmmConsumer consumer(
OmmConsumerConfig()
.host("159.220.108.133:14002")
.username("NJ2_03_RHB_SWVPNTRIAL01")
);
cout << "Subscribing to market data" << endl;
std::vector<string> rics = {
"USDEUR=R","JPYUSD=R","USDGBP=R","USDAUD=R","CHFUSD=R", "CADUSD=R"
};
for (const auto ric : rics)
{
//first setup datastore for the ric
ds.AddStorage(ric, new mdsdemo::FxData());
// subscribe to Level1 market data
consumer.registerClient(
ReqMsg()
// default subscription domain is MMT_MARKET_PRICE
.serviceName("hEDD")
.name(ric.c_str()),
client);
}
//run asynchronously reading the data store every 1000 milliseconds and publishing into the
//queue
as.RunForEver();
}
catch (const OmmException& excp) {
cout << "Exception subscribing to market data: " << excp << endl;
}
return 0;
}#include <sstream>
#include <iostream>
#include <boost/bind.hpp>
#include "AsyncServer.h"
using std::cout;
using std::endl;
namespace mdsdemo
{
AsyncServer::AsyncServer(string ip, int port, long interval, DataStore & ds)
:context_(1), pub_(context_, ZMQ_PUB), interval_(interval), ds_(ds)
{
std::stringstream ss;
ss << "tcp://" << ip << ":" << port;
pub_.bind(ss.str());
}
AsyncServer::~AsyncServer()
{
}
void AsyncServer::RunForEver()
{
boost::asio::deadline_timer t(io_, boost::posix_time::millisec(interval_));
t.async_wait(boost::bind(&AsyncServer::OnTimer, this,
boost::asio::placeholders::error, &t));
io_.run();
}
void AsyncServer::Publish()
{
try {
std::string jsonData = "full ";
jsonData +=
ds_.ToJsonFull();
zmq::message_t msg(jsonData.begin(), jsonData.end());
pub_.send(msg);
cout << jsonData << endl;
}
catch (const std::exception & exp)
{
//TODO log errors
}
}
void AsyncServer::OnTimer(const boost::system::error_code& /*e*/,
boost::asio::deadline_timer* t)
{
Publish();
t->expires_at(t->expires_at() + boost::posix_time::millisec(interval_));
t->async_wait(boost::bind(&AsyncServer::OnTimer, this,
boost::asio::placeholders::error, t));
}
}0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 685 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 252 ETA
- 556 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 652 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛