Hi Team, Client is using below script and 18th of Jan is not captured on the data pull.
Tested on Workspace app and data is showing as needed. Appears to be an issue specific to API. Can the team check? Attached is a sample pull for Bid, behavior is the same for ask.
import pandas as pd
def _get_timedelta_for_frequency(frequency):
freq_map = {
'tick': 'S', 'tas': 'S', 'taq': 'S',
'minute': 'T', '1min': 'T', '5min': '5T', '10min': '10T', '30min': '30T',
'60min': '60T', 'hourly': 'H', '1h': 'H',
'daily': 'D', '1d': 'D', '1D': 'D',
'7D': '7D', '7d': '7D', 'weekly': '7D', '1W': '7D',
'monthly': 'M', '1M': 'M',
'quarterly': 'Q', '3M': 'Q',
'6M': '6M',
'yearly': 'A', '12M': 'A', '1Y': 'A'
}
Use 'min' instead of 'T' for future compatibility
return freq_map.get(frequency, 'min' if frequency in ['minute', '1min'] else 'T')
import math
import math
import pandas as pd
def batch_data_all(tickers, frequency, fields, start_date, end_date, ticks_per_day=685, chunk_size=10000):
all_data = []
freq_delta = _get_timedelta_for_frequency(frequency)
current_start = pd.to_datetime(start_date)
global_end = pd.to_datetime(end_date)
max_days_per_chunk = chunk_size // ticks_per_day
while current_start < global_end:
Calculate dynamic batch end
batch_end = current_start + pd.Timedelta(days=max_days_per_chunk)
if batch_end > global_end:
batch_end = global_end
hdf = ld.get_history(
universe=tickers,
fields=fields,
interval=frequency,
start=current_start.strftime("%Y-%m-%dT%H:%M:%S"),
end=batch_end.strftime("%Y-%m-%dT%H:%M:%S"),
count=chunk_size
)
if hdf is None or len(hdf) == 0:
print(f"No more data returned for {current_start} to {batch_end}.")
break
print(f"Fetched {len(hdf)} rows, last time: {hdf.index[-1]}")
all_data.append(hdf)
last_time = hdf.index[-1]
Move to the next interval after last_time
if isinstance(last_time, pd.Timestamp):
current_start = last_time + pd.tseries.frequencies.to_offset(freq_delta)
else:
current_start = pd.to_datetime(last_time)
If we overshoot the batch_end, set to batch_end for next loop
if current_start < batch_end:
current_start = batch_end
if all_data:
return pd.concat(all_data)
else:
print("No data fetched for the given parameters.")
return pd.DataFrame()
df = batch_data_all(
frequency='1min',
tickers=['ESv1'],#,'NQcv1'],
fields=['BID', 'ASK'],
start_date="2026-01-14T00:00:00",
end_date="2026-01-19T23:59:00'",
ticks_per_day=685 # Adjust as needed for your market/frequency
)