pandas-ta: Error with df.ta.strategy("All")

Which version are you running? The lastest version is on Github. Pip is for major releases.

Python: 3.8.6
pandas-ta: 0.2.23b0

Upgrade.

done

Describe the bug A clear and concise description of what the bug is.

These examples fails on the latest version:

The Default Strategy is the ta.AllStrategy. The following are equivalent:

df.ta.strategy() df.ta.strategy(“All”) df.ta.strategy(ta.AllStrategy)

Specifying specific categories work ([‘candles’, ‘momentum’, ‘overlap’, ‘performance’, ‘statistics’, ‘trend’, ‘volatility’, ‘volume’])

These have no effect on the result: dataframe.ta.mp = True dataframe.ta.mp = False

Error:

multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "/opt/tradebot/freqtrade/.env/lib/python3.8/site-packages/pandas_ta/core.py", line 432, in _mp_worker
    return getattr(self, method)(*args, **kwargs)
TypeError: crossed() got an unexpected keyword argument 'append'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./.env/lib/python3.8/site-packages/pandas_ta/core.py", line 682, in strategy
    [self._post_process(r, **kwargs) for r in results]
  File "./.env/lib/python3.8/site-packages/pandas_ta/core.py", line 682, in <listcomp>
    [self._post_process(r, **kwargs) for r in results]
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 448, in <genexpr>
    return (item for chunk in result for item in chunk)
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 868, in next
    raise value
TypeError: crossed() got an unexpected keyword argument 'append'

To Reproduce Download sample data and try the above examples.

Expected behavior All indicators added to dataframe.

Thanks for using Pandas TA! Thanks for a great TA library!

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 19 (10 by maintainers)

Most upvoted comments

@Fredrik81,

Well why i’m switching is because pandas-ta seems to have better performance and feels a bit more light weight than ta-lib. What i’m working on at the moment is combining freqtrade, tensorflow and stable_baselines to see how i can get re-enforced learning to work with it.

Gotcha

If i could wish for one thing it would be namings of the pandas columns like “[indicator]_[settings]”. I see the point of the way it’s implemented in pandas-ta but it can be acting strange in atomization etc. perhaps there is already a way to make it take away the _[settings] part in the name creation but at the moment i just do this to take out some of the characters that become a problem for me:

Yeah I understand. For the resultant column names, “[indicator]_[settings]” seemed to be the least problematic and yet descriptive way to identify them. Obviously the “.” column names from indicators with float parameters makes the process less smooth in the AI/ML pipeline. I am open to suggestions for better column naming.

Yes, this works and is a simple command to adjust column names in the feature generation post-processing phase of the pipeline. I have thought about adding something similar to Pandas TA but unsure if it is needed as post-processing requirements may vary.

dataframe.columns = dataframe.columns.str.replace('[#,@,&,.]', '')

Kind Regards, KJ

yeah that did the tick now it’s working perfectly!