Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • TREP APIs /
  • RFA /
avatar image
Question by tmorgan · Feb 03, 2017 at 05:37 PM · rfa c++time and salesexampletas

Time & Sales example

Can anyone point me at an RFA example dealing with Time & Sales requests and processing? I'm using the C++ v8.0.1 libraries.

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Reply

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by jirapongse.phuriphanvichai · Feb 06, 2017 at 02:54 AM

You can modify StarterConsumer in RFA C++ package to subscribe to Time & Sales RICs, such as tIBM.N.

To request a Time & Sales RIC, the application needs to use a snapshot request.

rfa::common::Handle* sendItemRequest(
   const rfa::common::RFA_String& itemName, 
   const rfa::common::RFA_String& serviceName,
   rfa::common::UInt8 indicationMask = 0,
   rfa::common::UInt8 msgModelType = rfa::rdm::MMT_MARKET_PRICE,
   //  rfa::common::Int32 interType = rfa::message::ReqMsg::InitialImageFlag | rfa::message::ReqMsg::InterestAfterRefreshFlag);
   rfa::common::Int32 interType = rfa::message::ReqMsg::InitialImageFlag);

The Time & Sales data is available in SEG_TEXT field which represents:

The 255-byte text field which can contain up to four log entries. There are embedded New Line control characters within this field to assist in displaying the log information.

To retrieve the next log segment, the application must subscribe to a RIC in NEXT_LR field.

if(respMsg.getHintMask() & RespMsg::PayloadFlag)
	{
	//	_pDecoder->decodeData(respMsg.getPayload());
		const rfa::common::Data& data = respMsg.getPayload();


		if (!data.isBlank())
		{
			if (data.getDataType() == FieldListEnum){
				const rfa::data::FieldList& input = static_cast<const rfa::data::FieldList&>(data);
				FieldEntry fEntry;


				if (input.find(258, DataBuffer::StringRMTESEnum, fEntry)){ //SEG_TEXT
					const rfa::common::Data& data = fEntry.getData(DataBuffer::StringRMTESEnum);
					if (!data.isBlank())
					{
						const DataBuffer& dataBuf = static_cast<const DataBuffer&>(data);
						printf("%s\n", dataBuf.getAsString().c_str());


					}
				}
				if (input.find(238, DataBuffer::StringAsciiEnum, fEntry)){ //NEXT_LR


					const rfa::common::Data& data = fEntry.getData(DataBuffer::StringAsciiEnum);
					if (!data.isBlank())
					{
						const DataBuffer& dataBuf = static_cast<const DataBuffer&>(data);
						printf("NEXT_LR: %s\n", dataBuf.getAsString().c_str());
						sendItemRequest(dataBuf.getAsString(), _cfgVars.serviceName);
					}


				}
			}
		}
	}

Please see the modified code in the attached file: starterconsumer.zip.

The output of the application looks like:

2017 Feb 06 14:51:11.206 ST GMT+07:00 3B40 2B1C   441 INFO
    <- Received Event Stream Closed Event, event type: OMMItemEvent handle: 0000
000008A386E0.
2017 Feb 06 14:51:11.991 ST GMT+07:00 3B40 2B1C   597 TRACE <- Received MMT_MARK
ET_PRICE Refresh tou:$9l#*C
    serviceName : API_ELEKTRON_EPD_RSSL
    symbolName  : tou:$9l#*C
    streamState : NonStreaming
    dataState   : Ok
    statusCode  : None
    statusText  : All is well.
15:59:57.240              37 X 175.7300   03FEB    1648726     1065


15:59:56.859             100 X 175.7300   03FEB    1648473     M_SWEEP


15:59:56.416             100 X 175.7400   03FEB    1648308     M_SWEEP




NEXT_LR: tou:$9l#*@
2017 Feb 06 14:51:12.001 ST GMT+07:00 3B40 2B1C   413 TRACE Create Item Request
    itemName        : tou:$9l#*@
    serviceName     : API_ELEKTRON_EPD_RSSL
    indicationMask  : 0
    msgModelType    : 6 : MarketPrice
    interactionType : 1 : InitialImageFlag.
********************** INFO ************************ INFO **********************


2017 Feb 06 14:51:12.005 ST GMT+07:00 3B40 2B1C   441 INFO
    <- Received Event Stream Closed Event, event type: OMMItemEvent handle: 0000
000008A38810.
2017 Feb 06 14:51:12.753 ST GMT+07:00 3B40 2B1C   597 TRACE <- Received MMT_MARK
ET_PRICE Refresh tou:$9l#*@
    serviceName : API_ELEKTRON_EPD_RSSL
    symbolName  : tou:$9l#*@
    streamState : NonStreaming
    dataState   : Ok
    statusCode  : None
    statusText  : All is well.
15:59:56.409             200   175.7400   03FEB    1648304


15:59:55.880             100 X 175.8300   03FEB    1648075     M_SWEEP


15:59:55.859             100 X 175.8300   03FEB    1647965     M_SWEEP




NEXT_LR: tou:$9l#*=

To interpret the data in SEG_TEXT, you need to refer to WORLD/TAS1 page.


starterconsumer.zip (7.0 KiB)
Comment
zoya.farberov

People who like this

1 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
7 People are following this question.

Related Questions

Reference Data Request Rejected: Request message payload not supported on non-private streams

How to encode / decode? Create RespMsg objects from Buffer?

RFA C++ client hung

Hi, Which version of RFA C++ should we use that supports MarketFeed & 64-bit OS ? Thank you.

Running multiple apps with different RFA C++ API versions on same machine

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges