Giter Site home page Giter Site logo

Comments (1)

methenol avatar methenol commented on September 13, 2024

With a support/resistance indicator, I'm assuming the context comes from the value of the current price in relation to the support/resistance line, similar to a bbands strategy. It might be best to calculate a percentage of where the current price is between the two, or work off true/false if it crosses the line. I don't have a good grasp on what's going on with the price scaling in the environment but anticipate that if they are scaled independently that the relationship between the price and the support/resistance lines would get skewed.

There's a school of thought that you really don't want to feed the network stuff that it can calculate on it's own mathematically (not sure how true this is). For example, if RSI is a mathematical function of price, then feeding it in is just adding more data for it to determine the relevance of and clutters the signal. However, if the value is based on data outside of the window that the LSTM layer is looking at, then there may be value added.

This is on my list of things to try, currently trying to get the environment isolated from hypers to better test things like this.

A really rough implementation of an ema crossover/under that I used in a different environment looks like this, if it helps anyone:

        self.series['emaCrossover'] = np.where(self.series['MA_5'] < self.series['MA_10'], 1, 0)
        self.series['emaCrossunder'] = np.where(self.series['MA_5'] > self.series['MA_10'], 1, 0)

Also, I don't see anything for support/resistance in the talib or jhtalib libraries. However, there's this (I didn't write it) that would be easy to implement:

#Pivot Points, Supports and Resistances
def PPSR(df):
    PP = pd.Series((df['high'] + df['low'] + df['close']) / 3)
    R1 = pd.Series(2 * PP - df['low'])
    S1 = pd.Series(2 * PP - df['high'])
    R2 = pd.Series(PP + df['high'] - df['low'])
    S2 = pd.Series(PP - df['high'] + df['low'])
    R3 = pd.Series(df['high'] + 2 * (PP - df['low']))
    S3 = pd.Series(df['low'] - 2 * (df['high'] - PP))
    psr = {'PP':PP, 'R1':R1, 'S1':S1, 'R2':R2, 'S2':S2, 'R3':R3, 'S3':S3}
    PSR = pd.DataFrame(psr)
    df = df.join(PSR)
    return df

from tforce_btc_trader.

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.