How to filter out certain trade types

We are using the DataAccess.TimeSeries - in fact our code comes from the TimeSeriesDailyIntervalDemo. Our client has discovered that there are several unwanted trade types that are returned by the API that are not displayed in the standard EIKON price charts. Upon request from Eikon we were advised that:
"Below are the criteria for the FID 1003 to exclude or to filtered out trades from TAS application.
Unique ID IDN Value Description
152526 1_N Next Day Trade
152540 4_B Average Price Trade
152542 4_M Market Center Official Close
152543 4_Q Market Center Official Open
152544 4_H Price Variation Trade
154580 2_9 Official Consolidated Close
152549 4_I Odd Lot trades
152525 1_C Cash Trade (Same Day Clearing)
152527 1_R Seller
152536 3_T Extended Hours Trade
152537 3_U Extended Hours Sold (Out of Sequence)
Can anyone advise how this should be coded in the API. We see a "WithFilter", but do not know the syntax to construct a filter to remove the above.
Thank you
Best Answer
-
FID 1003 is a real-time field.
GV4_TEXT "GV4 TEXT" 1003 NULL ALPHANUMERIC 6 RMTES_STRING 6
It is available when subscribing to a real-time service (IDataService.Realtime).
However, it may not be available in the times series service. You can verify it by checking all fields returned from the time series service. If it is not available, you can't filter it.
According to the response from the Eikon support team, I assume the RHistory function can't return the trade type. Therefore, you are unable to retrieve or filter it via IDataServices.TimeSeries.
Regarding the 5-minute candle charts, please use the CommonInterval.Intraday5Minutes instead to verify the returned data.
0
Answers
-
Refer to the Time series API tutorial, the WithFilter property of either requests or subscriptions can be used to filter results based on numeric or string value of specified fields, or built-in filters for price sources. This functionality is only available for Quotes, Trades and TradeAndQuotes intervals.
For example:
private void Subscribe()
{
_subscription = _timeSeries.SetupDataSubscription("EUR=")
.WithView("BID")
.WithAllFields()
.WithInterval(CommonInterval.Quotes)
.WithNumberOfPoints(50)
.WithFilter(filter => filter.ContributorIn(new[] {"RBSN"}))
.WithFilter(filter => filter.NumericValueOfField("BID").GreaterOrEqual(1.1342))
.OnDataReceived(DataReceivedCallback)
.CreateAndStart();
}The methods of IRequestFilter are:
Could you please share RICs, Interval, View and code used to retreive the data?
0 -
The code which you share above is same what we are calling to get the data. Now we want to know the syntax to filter the list which is mentioned above. can you share us the syntax with Filter to exclude those results. we just want to exclude those results from data.
_subscription = _timeSeries.SetupDataSubscription("EUR=")
.WithView("BID")
.WithAllFields()
.WithInterval(CommonInterval.Quotes)
.WithNumberOfPoints(50)
.WithFilter(filter => filter.ContributorIn(new[] {"RBSN"}))
.WithFilter(filter => filter.NumericValueOfField("BID").GreaterOrEqual(1.1342))
.OnDataReceived(DataReceivedCallback)
.CreateAndStart();0 -
The WithFilter can be used to filter results based on numeric or string value of specified fields, or built-in filters for price sources. There is no built-in filter for trade types.
Moreover, if the trade type field is not available in the returned data, you can't filter it by field values.
I think you should contact the Eikon Excel support team via MyRefinitiv to verify if it is possible to use the RHistory function in Eikon Excel to retrieve the required data or if there is any field returned from the RHistory function which can be used to filter by trade types.
The data returned from ITimeSeriesDataService is similar to the RHistory function.
0 -
We contacted Eikon Excel support, but have been advised that it is best to repost our issue here.
As added information, our application is for US and Canadian equities. So we are typically passing RIC’s such as:
AGU.TO
HON.N
AAPL.O
Our customer has complained that the price data returned by the DataAccess.TimeSeries service is not the same data that is being used in the preparation of day price candle charts such as 5 minute bars on their Eikon terminal.
After reviewing the raw price data we pull, Eikon Support did agree that the data is different. They advised us that to ensure we only perform our custom analysis on the same prices that are used in the price charts for a particular day (say 5 minute candle charts) then we need to impose filters for certain trade types (see the table below)
We are using ThomsonReuters.Desktop.SDK.DataAccess.TimeSeries in a C# application we have written.
Here is the code which we are using to get the data through this SDK ThomsonReuters.Desktop.SDK.DataAccess.TimeSeries.
// DateTime dt = DateTime.ParseExact(argument[1], "yyyy-MM-dd ", CultureInfo.InvariantCulture);
dtStart = DateTime.Parse(string.Format("{0} " + StartingTime , startDate),
CultureInfo.InvariantCulture);
dtEnd = DateTime.Parse(string.Format("{0} " + EndingTime, EndDate),
CultureInfo.InvariantCulture);this.dataSubscription = DataServices.Instance.TimeSeries.SetupDataSubscription(this.Ric)
.WithInterval(CommonInterval.Trades)
.From(dtStart)
.To(dtEnd)
.OnDataReceived(this.OnSubscriptionDataReceived)
.OnDataUpdated(this.OnSubscriptionDataUpdated)
.OnStatusUpdated(status => this.Title = string.Format("Status: {0} Error: {1}", status.State, status.Error))
.CreateAndStart();This is the same code which you have in your Eikon desktop API section on the developer support website. As you can see there is no withFilter in this basic sample.
Add code to filter out these trade types: We have been advised that these FID 1003 criteria in the table below need to be filtered using the withFilter capability in the above mentioned API.
Unique ID IDN Value Description
152526 1_N Next Day Trade
152540 4_B Average Price Trade
152542 4_M Market Center Official Close
152543 4_Q Market Center Official Open
152544 4_H Price Variation Trade
154580 2_9 Official Consolidated Close
152549 4_I Odd Lot trades
152525 1_C Cash Trade (Same Day Clearing)
152527 1_R Seller
152536 3_T Extended Hours Trade
152537 3_U Extended Hours Sold (Out of Sequence)
-------------------------------------------------------------------------------------
We are assuming we would need to add:
.WithFilter(filter => filter.stringValueOfField("TRADETYPE").Equal(“X_X”))
or perhaps
.WithFilter(filter => filter.stringValueOfField("FID 1003").Equal(“X_X”))
I have used the placeholder "X_X" above because I do not know the correct FID 1003 that defines common session trades in any day that would be used to build the candles such as 5 minute bars ofn an Eikon price chart? If such a single FID 1003 exists then we would want to apply that filter only – keeping only those trades and excluding the other ones that are returned by the TimeSeries service.
If a single FID 1003 value for common session trades does not exist this would mean we will have to build a multiple criteria filter. What is the syntax to construct a multi-line query to remove all of the above IDN values listed in the table?
.WithFilter(filter => filter.stringValueOfField("FID 1003").NotEqual(“1_N”))
.WithFilter(filter => filter.stringValueOfField("FID 1003").NotEqual(“4_B”))
etc., etc.
Thank you again.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 37 Alpha
- 167 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 705 Datastream
- 1.5K DSS
- 633 Eikon COM
- 5.2K Eikon Data APIs
- 14 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 6 Trading API
- 3K Elektron
- 1.5K EMA
- 259 ETA
- 569 WebSocket API
- 40 FX Venues
- 16 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 25 Messenger Bot
- 4 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 284 Open PermID
- 47 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 24 RDMS
- 2.2K Refinitiv Data Platform
- 879 Refinitiv Data Platform Libraries
- 5 LSEG Due Diligence
- 1 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
- 123 Open DACS
- 1.1K RFA
- 108 UPA
- 196 TREP Infrastructure
- 232 TRKD
- 919 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 103 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛