Giter Site home page Giter Site logo

breakout method about pysystemtrade HOT 3 CLOSED

robcarver17 avatar robcarver17 commented on June 28, 2024
breakout method

from pysystemtrade.

Comments (3)

robcarver17 avatar robcarver17 commented on June 28, 2024

I plan to incorporate the breakout method into pysystemtrade and it would be quicker for me to do that than to try and fix your code, so please be patient. I'll leave this open until then.

from pysystemtrade.

 avatar commented on June 28, 2024

I noticed that if I replace the above-mentioned code with:

def breakout(x, ws):
    maxs = pd.rolling_max(x, ws, min_periods=min(len(x.index), int(ws/2)))
    mins = pd.rolling_min(x, ws, min_periods=min(len(x.index), int(ws/2)))
    avg = (maxs+mins)/2
    bo = 40*((x - avg)/(maxs-mins))
    bo = pd.ewma(bo, span = int(ws/4.0), min_periods = int(ws/8.0))
    return bo

and add a series of breakout rules to the config and in rules.py, the breakout rule works. The issue with indexing is related to the second function (breakout_one_row(idx, x, max_x, min_x)), which is not required, unless I am mistaken.

from pysystemtrade.

robcarver17 avatar robcarver17 commented on June 28, 2024

breakout is now in the latest version. See https://github.com/robcarver17/pysystemtrade/blob/master/systems/provided/moretradingrules/morerules.py

from pysystemtrade.

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.