question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error with df.ta.strategy("All")

See original GitHub issue

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!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:18 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
twopirllccommented, Feb 22, 2021

@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

1reaction
Fredrik81commented, Feb 20, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pandas TA: A Technical Analysis Library in Python 3 - Morioh
The Pandas TA strategy method utilizes multiprocessing for bulk indicator processing of all Strategy types with ONE EXCEPTION! When using the col_names ...
Read more >
Technical Analysis Library in Python 0.1.4 documentation
It is a Technical Analysis library useful to do feature engineering from financial time series datasets (Open, Close, High, Low, Volume). It is...
Read more >
Pandas TA - A Technical Analysis Library in Python 3
A Pandas TA Strategy is a named group of indicators to be run by the strategy method. All Strategies use mulitprocessing except when...
Read more >
Pandas TA Tutorial - YouTube
Like the video? Support the channel by visiting Interactive Brokers: ...
Read more >
Pandas-Ta quick start guide in python - YouTube
We take a look at how pandas- ta works, we cover how to get started, how to find the documentation, and how to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found