Calculating the Angle / Linear Regression of a line

Forums ProRealTime English forum ProOrder support Calculating the Angle / Linear Regression of a line

Viewing 3 posts - 1 through 3 (of 3 total)
  • #10487

    I’d like to be able to calculate the angle (linear regression?) of any line i.e. a moving average, a standard deviation

    For example.. if the angle of the Average[500] reaches X degrees positive/negative then buy/sell (means: don’t trade when it’s flat)

    What is the best way to calculate/code that?

    Regards

    Steve

    #10488

    IMO it’s useless since angle degree depends of the height/width of your chart/computer screen. You’d better look at price percentage change over x periods, I think it’s more accurate 🙂

    #11606

    Just browsing the forum as i noticed this post… as i’m using ema-trend as a trade filter, i’m happy to share a guite simple code:

     

     

    this simply compares if the tradeema rises or falls within the last 2 bars.

    you could also check if the difference of tradeema[2] & tradeema[1] if positive but smaller than the diff of tradeema[1] and tradeema -> which would mean it’s getting steeper.

    getting a angle value is useless imho as there’s the need for a absolute x & y scale. but based on the difference you could use a treshold value to check if the slope is steep enough…

    Brgds, Martin.

     

     

    1 user thanked author for this post.
Viewing 3 posts - 1 through 3 (of 3 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login