twelvedata / twelvedata-python

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

Not enough historical datapoints for MA200 for symbols that have been listed for several years #31

Closed anttironty closed 3 years ago

anttironty commented 3 years ago

Hi, this issue is not limited to your python library. It's more generally an issue with your API.

I'm requesting MA200 for instruments listed in omxh, and several instruments that have been listed in omxh for several years return error that states there is lack of historical datapoints for MA200.

For example, enento:omxh

Works _https://api.twelvedata.com/ma?symbol=enento:omxh&interval=1day&timezone=EET&outputsize=102&time_period=102&apikey=_

Doesn't work _https://api.twelvedata.com/ma?symbol=enento:omxh&interval=1day&timezone=EET&outputsize=200&time_period=200&apikey=_

But I wonder why that is, as enento:omxh should have well over 200 days of datapoints, as it has been listed in omxh since 2015.

I checked the earliest timestamp for enento:omxh using

_https://api.twelvedata.com/earliest_timestamp?symbol=enento:omxh&interval=1day&timezone=EET&apikey=_

And it returns 2020-09-28, which explains why your system doesn't have enough datapoints for ma200 for enento. But then I should be able to do MA request with time_period of 149, right? But the max time period that works is 102.

EDIT: Ah, the time_period of 102 is the max time_period when I take the days omxh is closed (weekends) into consideration. However, is it expected behavior to have only 102 datapoints of instrument that has been listed since 2015?

midasSSS commented 3 years ago

Question is related to the API and not the package. Closing due to irrelevance.