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

Add parameter "exclude_ta_features" from add_all_ta_features. #306

Open
arturdaraujo opened this issue Oct 17, 2022 · 0 comments
Open

Add parameter "exclude_ta_features" from add_all_ta_features. #306

arturdaraujo opened this issue Oct 17, 2022 · 0 comments

Comments

@arturdaraujo
Copy link

arturdaraujo commented Oct 17, 2022

When coming across an error, I would be able to just remove the feature that was causing the error and process the rest.

df_window = add_all_ta_features(
df_window,
open="open",
high="high",
low="low",
close="close",
volume="volume",
)

Would be something like this:

df_window = add_all_ta_features(
df_window,
open="open",
high="high",
low="low",
close="close",
volume="volume",
exclude_ta_features=["trend_dpo", "momentum_stoch_rsi"]
)

I'm getting this error below, so I would simply remove the feature that is causing it. In my case is probably indicator_adx or add_trend_ta is the feature probably causing it. That's why I think a parameter to pick which feature to process would be helpful.


Traceback (most recent call last):

  File "C:\Users\artur\AppData\Local\Temp\ipykernel_7992\260366147.py", line 1, in <cell line: 1>
    df_window_pandas = add_all_ta_features(

  File "C:\Users\artur\miniforge3\envs\env_tsflex\lib\site-packages\ta\wrapper.py", line 585, in add_all_ta_features
    df = add_trend_ta(

  File "C:\Users\artur\miniforge3\envs\env_tsflex\lib\site-packages\ta\wrapper.py", line 343, in add_trend_ta
    df[f"{colprefix}trend_adx"] = indicator_adx.adx()

  File "C:\Users\artur\miniforge3\envs\env_tsflex\lib\site-packages\ta\trend.py", line 790, in adx
    adx_series[self._window] = directional_index[0: self._window].mean()

IndexError: index 14 is out of bounds for axis 0 with size 9
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