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

Executing detect_wedge() fails #12

Open
alatif-alatif opened this issue Sep 8, 2023 · 0 comments
Open

Executing detect_wedge() fails #12

alatif-alatif opened this issue Sep 8, 2023 · 0 comments

Comments

@alatif-alatif
Copy link

Hi,

thanks a lot for setting up, sharing and maintaining this project. You are doing a very good job!

I have a small question:

I executed detect_wedge(df, window=3): from TradingPatternScanner/tradingpatterns/tradingpatterns.py.

Unfortunately, I get an error:

File ".../lib/python3.10/site-packages/pandas/core/indexes/range.py", line 416, in get_loc
raise KeyError(key) from err
KeyError: -1

This error comes up at this line:

df['trend_high'] = df['High'].rolling(window=roll_window).apply(lambda x: 1 if (x[-1] - x[0]) > 0 else -1 if (x[-1] - x[0]) < 0 else 0)

Am I doing something wrong? Respectively: what do I have to do to get beyond this point?

used versions:

pandas: 2.1.0
python: 3.10.12

Thanks in advance.

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