list index out of range
My trader program is in such a way that I have to test on several currencies at the same time, but when I query the indicator through the TradingView library, I encounter the following error. Is there a way to fix it?
File "/usr/local/lib/python3.9/site-packages/tradingview_ta/main.py", line 316, in get_indicators indicators_val[indicators[x]] = result[0]["d"][x] IndexError: list index out of range
HI I wish to contribute to the same. Could you help me with the inputs to be provided so can I can test and solve the issue.
Hi Very thanks ........................... def check(market): handler = TA_Handler( screener="crypto", interval= Interval.INTERVAL_5_MINUTES, symbol=market, exchange="COINEX", ) handler.add_indicators([ "Candle.Engulfing.Bearish[1]", "Candle.Engulfing.Bullish[1]", ]) analysis = handler.get_analysis() pattern_count = 0 for key, value in analysis.indicators.items(): if "Candle" in key: if value == 1: a=key pattern_count += 1 if pattern_count == 0: return "no candle","normal" ....................................... I run it once through my own program and there is no problem, but twice for two currencies the error I mentioned occurs
I have tried to run this function provided in the test.py , but it asks me for the market argument when being called. what is the value of market, when you mention twice for two currency what input changes ,
Market=BTCUSDT RUN THIS FUNCTUON FROM WEB FORM Only change market Example : ETHUSDT
Sorry to disturb you this being my initial issue with the project it is still seems unclear to me.
What values are giving you an error.
I have tried this function it seems fine for me
