Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

supertrend exception #2

Open
Sinansi opened this issue Oct 5, 2023 · 0 comments
Open

supertrend exception #2

Sinansi opened this issue Oct 5, 2023 · 0 comments

Comments

@Sinansi
Copy link

Sinansi commented Oct 5, 2023

Python version 3.9

get_supertrend(high, low, close, lookback=10, multiplier=3)
Traceback (most recent call last):
File "C:\Users\Sinan\miniconda3\envs\TradingView\lib\site-packages\pandas\core\indexes\base.py", line 3790, in get_loc
return self._engine.get_loc(casted_key)
File "index.pyx", line 152, in pandas._libs.index.IndexEngine.get_loc
File "index.pyx", line 181, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\hashtable_class_helper.pxi", line 2606, in pandas._libs.hashtable.Int64HashTable.get_item
File "pandas_libs\hashtable_class_helper.pxi", line 2630, in pandas._libs.hashtable.Int64HashTable.get_item
KeyError: 5491
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2023.2\plugins\python\helpers\pydev\pydevconsole.py", line 364, in runcode
coro = func()
File "", line 1, in
File "C:\Galaxy\Project\TradingView\supertrend.py", line 30, in get_supertrend
if (upper_band[i] < final_bands.iloc[i - 1, 0]) | (close[i - 1] > final_bands.iloc[i - 1, 0]):
File "C:\Users\Sinan\miniconda3\envs\TradingView\lib\site-packages\pandas\core\series.py", line 1040, in getitem
return self._get_value(key)
File "C:\Users\Sinan\miniconda3\envs\TradingView\lib\site-packages\pandas\core\series.py", line 1156, in _get_value
loc = self.index.get_loc(label)
File "C:\Users\Sinan\miniconda3\envs\TradingView\lib\site-packages\pandas\core\indexes\base.py", line 3797, in get_loc
raise KeyError(key) from err
KeyError: 5491

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant