finnhubio / Finnhub-API

Finnhub API provides institutional-grade financial data to investors, fintech startups and investment firms. We support real-time stock price, global fundamentals and alternative data. https://finnhub.io/docs/api
96 stars 6 forks source link

Error retrieving technical indicator information from Finnhub #425

Open eecagomes opened 3 years ago

eecagomes commented 3 years ago

Hello

When trying to consult the information for a technical indicator it gave out this error:"Timeperiod is too long for series. Please increase from and to range"

link=https://finnhub.io/api/v1/indicator?symbol=TSLA&resolution=5&from=1615504500&to=1615507200&indicator=sma&timeperiod=9&token=""

Can someone tell me why the error appears and what is wrong? I've tried to increase the data interval but still the error still gives out the same.

Thanks

finnhubio commented 3 years ago

Hi, you will need to either increase the from and to range or decrease the "timeperiod" to a smaller number for this to work. The way indicator endpoint works is that we will request the data between "from" and "to" and then calculate the indicator from that retrieved data. If there is not enough data in the period, we will throw an error.