Seeking Time Interval Codes for 20-Minute and 30-Minute Data in Refinitiv DataPlatform
I am currently using the Refinitiv DataPlatform Python library for intraday data analysis. My focus is on equities, and I have successfully implemented a routine to retrieve 1-minute interval data using the following code:
import pandas as pd
import refinitiv.dataplatform as rdp
# Define the datetime range
start_date = '2023-08-18'
end_date = '2023-09-17'
all_data3 = pd.DataFrame()
# Get data
for RIC in rics_list:
response = rdp.HistoricalPricing.get_summaries(
universe=RIC,
interval=rdp.Intervals.ONE_MINUTE,
start=start_date,
end=end_date,
fields=['TRDPRC_1', 'ACVOL_UNS', 'HIGH_1', 'LOW_1', 'BID', 'ASK']
)
if response is not None and response.data.df is not None:
df_bid_ask = response.data.df
df_bid_ask.columns = pd.MultiIndex.from_product([[RIC], df_bid_ask.columns])
df_bid_ask.index = pd.to_datetime(df_bid_ask.index)
# Adjust the time filter for NYSE trading hours
df_bid_ask = df_bid_ask.between_time('14:30', '21:00')
df_bid_ask = df_bid_ask.loc[lambda x: x.index.dayofweek < 5]
if all_data3.empty:
all_data3 = df_bid_ask
else:
all_data3 = pd.concat([all_data3, df_bid_ask], axis=1)
# Display the concatenated data
print(all_data3.tail())
This code has been effective for gathering 1-minute interval data, but I've noticed significant gaps in the data due to the absence of tick data for periods without trades.
To address this, I'm looking to aggregate the data over longer intervals, specifically 20-minute and/or 30-minute periods. However, I am uncertain about the correct interval codes to use for these timeframes in the rdp.HistoricalPricing.get_summaries
function.
Could anyone provide guidance on the appropriate interval codes for 20-minute and 30-minute data retrieval using the Refinitiv DataPlatform Python library? Any additional insights into handling intervals with sparse data would also be greatly appreciated.
Thank you in advance!
Best Answer
-
Thank you for reaching to us.
You can run the help(rdp.Intervals) command to check the available intervals.
| Data and other attributes defined here:
|
| DAILY = <Intervals.DAILY: 'P1D'>
|
| FIVE_MINUTES = <Intervals.FIVE_MINUTES: 'PT5M'>
|
| MONTHLY = <Intervals.MONTHLY: 'P1M'>
|
| ONE_HOUR = <Intervals.ONE_HOUR: 'PT1H'>
|
| ONE_MINUTE = <Intervals.ONE_MINUTE: 'PT1M'>
|
| QUARTERLY = <Intervals.QUARTERLY: 'P3M'>
|
| SEVEN_DAYS = <Intervals.SEVEN_DAYS: 'P7D'>
|
| SIXTY_MINUTES = <Intervals.SIXTY_MINUTES: 'PT60M'>
|
| TEN_MINUTES = <Intervals.TEN_MINUTES: 'PT10M'>
|
| THIRTY_MINUTES = <Intervals.THIRTY_MINUTES: 'PT30M'>
|
| TWELVE_MONTHS = <Intervals.TWELVE_MONTHS: 'P12M'>
|
| WEEKLY = <Intervals.WEEKLY: 'P1W'>
|
| YEARLY = <Intervals.YEARLY: 'P1Y'>1
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛