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

Ways to speed up ta.strategy #489

Closed
bizso09 opened this issue Feb 14, 2022 · 2 comments
Closed

Ways to speed up ta.strategy #489

bizso09 opened this issue Feb 14, 2022 · 2 comments
Labels
info Informational

Comments

@bizso09
Copy link
Contributor

bizso09 commented Feb 14, 2022

I've read #466 (comment)
and see that ta.strategy runs in 1s on your machine. I'm getting on the other hand 2s.

Do you have recommendations for speeding up performance?

I installed Python 3.10 and VS Build Tools 2019 for linking Ta-Lib. Then installed packages with pip.

CPU specs
Processor 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz, 1690 Mhz, 4 Core(s), 8 Logical Processor(s)
Installed Physical Memory (RAM) 32.0 GB

[i] Runtime: 2127.5418 ms (2.1275 s)
                  Open        High  ...   ZL_EMA_10     ZS_30
Date                                ...                      
2021-02-16  134.689475  135.206391  ...         NaN       NaN
2021-02-17  130.474522  131.438792  ...         NaN       NaN
2021-02-18  128.436638  129.231914  ...         NaN       NaN
2021-02-19  129.470485  129.937710  ...         NaN       NaN
2021-02-22  127.253658  128.953561  ...         NaN       NaN
...                ...         ...  ...         ...       ...
2022-02-08  171.729996  175.350006  ...  173.417466  0.518299
2022-02-09  176.050003  176.649994  ...  174.592473  0.777294
2022-02-10  174.139999  175.479996  ...  174.093840  0.141745
2022-02-11  172.330002  173.080002  ...  172.553141 -0.396170
2022-02-14  167.369995  169.571396  ...  170.803480 -0.313026

[253 rows x 285 columns]
Index(['Open', 'High', 'Low', 'Close', 'Volume', 'Dividends', 'Stock Splits',
       'ABER_ZG_5_15', 'ABER_SG_5_15', 'ABER_XG_5_15',
       ...
       'VIDYA_14', 'VTXP_14', 'VTXM_14', 'VWAP_D', 'VWMA_10', 'WCP',
       'WILLR_14', 'WMA_10', 'ZL_EMA_10', 'ZS_30'],
      dtype='object', length=285)
@bizso09 bizso09 added the enhancement New feature or request label Feb 14, 2022
@twopirllc
Copy link
Owner

twopirllc commented Feb 15, 2022

Hello @bizso09,

First I would upgrade to the development branch. There are many bug fixes, speed improvements, documentation and typing.

$ pip install -U git+https://github.com/twopirllc/pandas-ta.git@development

Second, you might you can adjust your cores. I recommend starting with zero cores and increasing it if it improves the performance.

import pandas as pd
import pandas_ta as ta

df = pd.DataFrame()
df = df.ta.ticker("aapl", period="1y")
df.ta.study(cores=0, timed=True)

print(df)
print(df.columns)

Here is the corresponding readme.

Kind Regards,
KJ

@twopirllc twopirllc added info Informational and removed enhancement New feature or request labels Feb 15, 2022
@twopirllc
Copy link
Owner

Hello @bizso09,

I assume by no response that the solution provided was sufficient. Thus I will be closing this issue in a few days.

Kind Regards,
KJ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info Informational
Projects
None yet
Development

No branches or pull requests

2 participants