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'>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
- 651 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 中文论坛