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.

Apply TA Strategy is Slow over 7 Seconds.

See original GitHub issue
    jays_ta = [
            {"prefix":"stochrsi","kind": "stochrsi"} #,{"prefix":"stochrsi","kind": "stochrsi"}
    ]
        start_time = time.time()
        my_strategy = ta.Strategy(name="jay's strategy", ta=jays_ta.copy())
        dframe.ta.strategy(my_strategy)
        print("--- %s seconds ---" % (time.time() - start_time))

It is print out over 7 seconds Dataframe is only 25 row. I do repeat my ticker so over 750 tickers x 7 second = 5.250 seconds = 87 Minute…

Please help, how to speed up ? Thank You,

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
phicha20224commented, May 1, 2021

I run on another, notebook which only have 2 core/4thread lower than this pc which 4 core/8thread, but it faster… Thank You. I just read the docs, latest version have so many upgrade. its cool.

1reaction
phicha20224commented, May 1, 2021

D:>pip show pandas_ta Name: pandas-ta Version: 0.2.75b0

[+] Strategy: jay's strategy
[i] Indicator arguments: {'append': True}
[i] Multiprocessing 4 indicators with 7 chunks and 8/8 cpus.
********************** it slow here *********************
[i] Total indicators: 4
[i] Columns added: 10
[i] Last Run: Saturday May 1, 2021, NYSE: 8:20:16, Local: 12:20:16 SE Asia Standard Time, Day 121/365 (33.00%)
--- 4.706642150878906 seconds ---

put this

dframe.ta.cores = 0  # You might need to set this to zero to get a speed boost

and its fastest. Thank You…

[+] Strategy: jay's strategy
[i] Indicator arguments: {'append': True}
[i] No mulitproccessing (cores = 0).
[i] Progress: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 4/4 [00:00<00:00, 109.05it/s]
[i] Total indicators: 4
[i] Columns added: 10
[i] Last Run: Saturday May 1, 2021, NYSE: 8:21:55, Local: 12:21:55 SE Asia Standard Time, Day 121/365 (33.00%)
--- 0.043682098388671875 seconds ---
Read more comments on GitHub >

github_iconTop Results From Across the Web

Top Reasons Why Your Mobile App is Slow and How to Fix it
However, according to a study by Akamai research, for every additional second that the app consumes, the conversion rate declines by 7%.
Read more >
Extending the Silence - Edutopia
One solution is for teachers to pause for five to 15 seconds before calling on students. The silence for some may feel unbearably...
Read more >
How to Fix It When an Android Tablet Is Running Slow or ...
Quick solutions for how to fix lag and freezing on a slow Android tablet and make it run faster when using apps, games,...
Read more >
PC running slow? Here's how to speed things up - CNET
Watch for apps that shoot up to the top of the list, then disappear a few seconds later. Look for processes that stay...
Read more >
Momentum Day Trading Strategies for Beginners: A Step by ...
Learn the momentum day trading strategies that we use everyday to profit from the markets in this detailed step-by-step guide.
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