Code Monkey home page Code Monkey logo

Comments (4)

twopirllc avatar twopirllc commented on May 28, 2024

Hello @shingtat2,

This is a known Issue and is described in Issue #181 which is a pinned Issue at the TOP of the Issue list.

Kind Regards
KJ

from pandas-ta.

shingtat2 avatar shingtat2 commented on May 28, 2024

Hello @shingtat2,

This is a known Issue and is described in Issue #181 which is a pinned Issue at the TOP of the Issue list.

Kind Regards KJ

Yes I have read the post and solution to use main and my codes is already in def main(): but the issue still exist. Any other ways or tips to get it working?

def main():
    freeze_support()
    # Save the current warning settings
    current_warnings = warnings.filters.copy()
    # Suppress all warnings
    warnings.filterwarnings('ignore')
    # Redirect standard output to null
    sys.stdout = open(os.devnull, 'w')
    # Suppress logging
    logger = logging.getLogger()
    original_level = logger.getEffectiveLevel()
    logger.setLevel(logging.CRITICAL + 1)
    # Suppress only FutureWarnings
    warnings.simplefilter(action='ignore', category=FutureWarning)
    warnings.simplefilter(action='ignore', category=all)
    warnings.filterwarnings('ignore')

    try:
        df.ta.strategy(verbose=True, append=True)
    except Exception as e:
        # Handle any exception that might be raised
        print(f"An error occurred: {e}")
        
    # Restore the original warning settings
    warnings.filters = current_warnings
    

    print(df)

if __name__ == '__main__':
    main()

from pandas-ta.

twopirllc avatar twopirllc commented on May 28, 2024

@shingtat2

For one thing, you should be using the development version for many reasons I will not include here.

Also, append=True is redundant when using df.ta.strategy() (or df.ta.study() in development). Either automatically appends to the DataFrame.

So change: df.ta.strategy(verbose=True, append=True) to df.ta.study(cores=0, verbose=True) (after installing the development branch.

Lastly, I recommend not using multiprocessing because it most cases it is not more performant.

from pandas-ta.

twopirllc avatar twopirllc commented on May 28, 2024

Hello @shingtat2

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

from pandas-ta.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.