twelvedata / twelvedata-python

Twelve Data Python Client - Financial data API & WebSocket
https://twelvedata.com
MIT License
390 stars 57 forks source link

different time frame for different tickers[Bug] #56

Closed UmarIgan closed 1 year ago

UmarIgan commented 1 year ago

Problem So I trying randomly get some ticker data with outputsize=1000 and 5 minute time frame but it seems that one of the ticker starts from date: 2022-11-30 10:40:00 while other starts from date: 2022-10-17 11:35:00. I am wondering if this about that there were no trades during those times? Here what I want to to do is get 5 tickers close values and join them on the same date index. The tickers I tested belongs to nasdaq. I am sure this is not a bug but how can avoid such things here, can I take missed values too as null values?

SMTC: this ticker starts from 2022-11-30 10:40:00 CCRD: this ticker starts from 2022-10-17 11:35:00 Reproduce

import pandas as pd
from twelvedata import TDClient
td = TDClient(apikey="")
symbol = 'SMTC'
interval = '5m'
df = td.time_series(symbol=symbol, interval='5min', outputsize=1000).as_pandas()
symbol2 = 'CCRD'
df2 = td.time_series(symbol=symbol2, interval='5min', outputsize=1000).as_pandas()

Expected behavior A clear and concise description of what you expected to happen.

Screenshots

Screen Shot 2022-12-18 at 16 42 14 Screen Shot 2022-12-18 at 16 42 20
midasSSS commented 1 year ago

If there are no trades during the candle (i.e. 5min interval), then we don't add it. As can be seen, CCRD has low volumes and therefore contains less data.