Closed vladvoinescu closed 4 years ago
I've had similar issues. In my case results are unchanged still getting RSI value with timeperiod = 3.
Hi guys, thank you for reporting let us have a look on this
Hi guys @TonyPlayer @vladcvoinescu we have released 1.1.7 to address this issue. Let us know if you guys are still facing it
Hi @nongdenchet, can you please give me example how to use RSI for timeperiod = 14. I'm still getting error when i use argument like below: print(finnhub_client.technical_indicator(symbol=symbol, resolution=5, _from=_from, to=to, indicator='rsi', timeperiod=14))
~\anaconda3\lib\site-packages\finnhub\api\default_api.py in technical_indicator_with_http_info(self, symbol, resolution, _from, to, indicator, **kwargs) 5184 raise ApiTypeError( 5185 "Got an unexpected keyword argument '%s'" -> 5186 " to method technical_indicator" % key 5187 ) 5188 local_var_params[key] = val
ApiTypeError: Got an unexpected keyword argument 'timeperiod' to method technical_indicator
Hi @nongdenchet, can you please give me example how to use RSI for timeperiod = 14. I'm still getting error when i use argument like below: print(finnhub_client.technical_indicator(symbol=symbol, resolution=5, _from=_from, to=to, indicator='rsi', timeperiod=14))
~\anaconda3\lib\site-packages\finnhub\api\default_api.py in technical_indicator_with_http_info(self, symbol, resolution, _from, to, indicator, **kwargs) 5184 raise ApiTypeError( 5185 "Got an unexpected keyword argument '%s'" -> 5186 " to method technical_indicator" % key 5187 ) 5188 local_var_params[key] = val
ApiTypeError: Got an unexpected keyword argument 'timeperiod' to method technical_indicator
Plz try the example shown in the original post: rsiResult = finn.technical_indicator( symbol=STOCK, resolution=CANDLE_SIZE, _from=UNTIL - TIME_FRAME, to=UNTIL, indicator='rsi', indicator_specific_fields={'timeperiod': 14})
Yeah, i've tried that, and got the following error: ApiTypeError: Got an unexpected keyword argument 'indicator_specific_fields' to method technical_indicator
hi team sorry for late response, please try this one
print(finnhub_client.technical_indicator(symbol="AAPL", resolution='D', _from=1583098857, to=1584308457, indicator='rsi', indicator_fields={"timeperiod": 3}))
@TonyPlayer I forget to update README, I have updated it accordingly
Hey,
It seems to me that the indicator_specific_fields param doesn't work for the technical_indicator method. The only way I could make it compile and have the request sent was calling it like this:
rsiResult = finn.technical_indicator( symbol=STOCK, resolution=CANDLE_SIZE, _from=UNTIL - TIME_FRAME, to=UNTIL, indicator='rsi', indicator_specific_fields={'timeperiod': 14})
However, this ends up by sending a request to the url which looks like this:
'https://finnhub.io/api/v1/indicator?symbol=AAPL&resolution=15&from=1592163900&to=1592595900&indicator=rsi&Indicator+specific+fields=%7B%27timeperiod%27%3A+14%7D&token=brmfkpvrh5re15om42ag'
Which is different than the one that the back-end expects:
r = requests.get('https://finnhub.io/api/v1/indicator?symbol=AAPL&resolution=D&from=1583098857&to=1584308457&indicator=sma&timeperiod=3&token=brmfkpvrh5re15om42ag')
Full disclosure: my Python skills are close to none, however I spent almost a day on this and could not make it work 😁
Any sort of help would be appreciated.
Kind regards, Vlad