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.

Pandas TA strategy method goes into infinite loop: Windows Freeze Support Error

See original GitHub issue

@twopirllc I was trying to run the below code on a dataframe

df.ta.strategy("Momentum")
print(df)

It goes into infinite loop and consumes all CPU on my windows 10 laptop. Then I need to kill all VSCodium and python exes. Could you please help?

_Originally posted by @rahulmr in https://github.com/twopirllc/pandas-ta/issues/138#issuecomment-751864255_

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
rahulmrcommented, Dec 29, 2020

You can close this issue if you do not want to investigate further, as I have got the solution which is as below: source code


import yfinance as yf
import pandas_ta as ta


def test():
    sbin = yf.Ticker("SBIN.NS")
    df = sbin.history(period="3d", interval="15m")
    df.ta.strategy("Momentum", verbose=True)
    print(df)

if __name__ == '__main__':
    test()

pwsh.exe console output

(venv) PS D:\trading\0sas_algo> cat .\crash.py
import yfinance as yf
import pandas_ta as ta


def test():
    sbin = yf.Ticker("SBIN.NS")
    df = sbin.history(period="3d", interval="15m")
    df.ta.strategy("Momentum", verbose=True)
    print(df)

if __name__ == '__main__':
    test()
(venv) PS D:\trading\0sas_algo> python .\crash.py
[+] Strategy: Momentum
[i] Indicator arguments: {'append': True}
[i] Excluded[10]: above, above_value, below, below_value, cross, cross_value, long_run, short_run, trend_return, vp
[i] Multiprocessing: 8 of 8 cores.
[i] Total indicators: 34
[i] Columns added: 55
                                 open        high         low       close   volume  Dividends  ...  STOCHd_14_3_3  STOCHRSIk_14_14_3_3  STOCHRSId_14_14_3_3  TRIX_30_9  TRIXs_30_9  TSI_13_25
datetime                                                                                       ...
2020-12-24 09:15:00+05:30  265.100006  266.549988  264.700012  266.299988  1653388          0  ...            NaN                  NaN                  NaN        NaN         NaN        NaN
2020-12-24 09:30:00+05:30  266.299988  266.649994  265.500000  266.299988  1346556          0  ...            NaN                  NaN                  NaN        NaN         NaN        NaN
2020-12-24 09:45:00+05:30  266.299988  266.450012  265.500000  266.100006   914542          0  ...            NaN                  NaN                  NaN        NaN         NaN        NaN
2020-12-24 10:00:00+05:30  266.100006  267.649994  266.100006  267.399994  1594715          0  ...            NaN                  NaN                  NaN        NaN         NaN        NaN
2020-12-24 10:15:00+05:30  267.299988  267.799988  266.649994  266.799988  1050138          0  ...            NaN                  NaN                  NaN        NaN         NaN        NaN
...                               ...         ...         ...         ...      ...        ...  ...            ...                  ...                  ...        ...         ...        ...
2020-12-29 14:15:00+05:30  278.000000  278.350006  277.049988  277.399994  1333187          0  ...      69.749927            62.894709            57.654916   1.585756    2.020604  27.573298
2020-12-29 14:30:00+05:30  277.500000  277.899994  276.500000  277.750000  1194604          0  ...      69.690995            54.537582            59.388621   1.498974    1.906078  26.838714
2020-12-29 14:45:00+05:30  277.649994  277.850006  276.850006  276.950012   841302          0  ...      65.919476            29.097088            48.843126   1.417326    1.798951  24.185578
2020-12-29 15:00:00+05:30  277.000000  278.399994  277.000000  277.950012  2298641          0  ...      63.675802            33.053394            38.896021   1.340583    1.698658  23.613085
2020-12-29 15:15:00+05:30  277.950012  278.450012  277.250000  277.750000  2537262          0  ...      62.222375            26.968237            29.706239   1.268367    1.604655  22.658487

[75 rows x 62 columns]
(venv) PS D:\trading\0sas_algo>

2reactions
rahulmrcommented, Dec 28, 2020

Again tried with python 3.9.1 and still getting same issue. Control + C is also not working. Anyways this is not high priority for me. I will concentrate more on the other stuff. Will continue there. Let me know if you are able to reproduce this issue at your end. I can try to uploaded a video if I get time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pandas TA strategy method goes into infinite loop: Windows ...
It is a Python multiprocessing issue and not a Pandas TA Issue. The solution has been presented various places including Issue #176 which...
Read more >
Pandas TA strategy method goes into infinite loop: Windows Freeze ...
It goes into infinite loop and consumes all CPU on my windows 10 laptop. Then I need to kill all VSCodium and python...
Read more >
RuntimeError on windows trying python multiprocessing
RuntimeError : Attempt to start a new process before the current process has finished its bootstrapping phase. This probably means that you are ......
Read more >
Available CRAN Packages By Name
Available CRAN Packages By Name ; ACSWR, A Companion Package for the Book "A Course in Statistics with R" ; act, Aligned Corpus...
Read more >
Awesome Games Done Quick 2023 Online All Submissions
Deathmatch gets into the strategic side of the game, with lots of planning, and a wide variety of weapon skills, as you take...
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