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

FutureWarning #339

Open
jeffkingsley12 opened this issue Apr 20, 2024 · 2 comments
Open

FutureWarning #339

jeffkingsley12 opened this issue Apr 20, 2024 · 2 comments

Comments

@jeffkingsley12
Copy link

FutureWarning: Series.setitem treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To set a value by position, use ser.iloc[pos] = value
self._psar[i] = high2

@jeffkingsley12
Copy link
Author

high1 = self._high.iloc[i - 1]
high2 = self._high.iloc[i - 2]
if high2 > self._psar.iloc[i]:
#self._psar[i] = high2
self._psar.iloc[i] = high2
elif high1 > self._psar.iloc[i]:
self._psar.iloc[i] = high1

@HomingHamster
Copy link

This error is related:

/home/felix/PycharmProjects/llava_trader/venv/lib/python3.12/site-packages/ta/wrapper.py:181: SettingWithCopyWarning:

A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

This bug happens also when using the ta library with backtesting.py (or using any DataFrame slice), sounds like downgrading the Pandas library might help, but I haven't tried this yet personally. Please ta do update the code and thank you for what you have given us already.

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

2 participants