maximum angle in lookback period.

Forums ProRealTime English forum ProBuilder support maximum angle in lookback period.

Viewing 6 posts - 1 through 6 (of 6 total)
  • #75942

    Hiya,

    I’d like to compare today’s high to each of the highs in a lookback range of 20 bars.  Then divide that number by the bars since that high occured, in order to find the highest angle possible between today’s high and a single high in the lookback period.  Could I have some clues where to start please?

    #75954

    Angles/Slopes are impossible to be measured, this has been extensively discussed here and elsewhere. Some useful links:

    https://www.prorealcode.com/topic/ema-45-degres-uptrend/

    https://www.prorealcode.com/topic/indicator-for-inclination-of-moving-average/

    https://www.prorealcode.com/topic/calculating-the-angle-linear-regression-of-a-line/

    Anyway, to retrieve the BarIndex ID of a bar you can only use loops, since there’s no function returning that info, as of this version of PRT:

     

     

     

    1 user thanked author for this post.
    #75956

    in order to find the highest angle possible between today’s high and a single high in the lookback period

    I guess if you had said … to get a measure of the rate of change between today’s high and a single high in the lookback period ... may be less confusing and might get you the code you need? 🙂

    1 user thanked author for this post.
    #76274

    Thanks for the help Robert and Grahal.

    Grahal, that’s an excellent idea.  Am I geting closer with the following?

     

     

     

     

    #76275

    ok that attempt was no good.

    I’m trying to create a substitute for a downsloping trendline which can be auto-traded by finding (in psuedocode):

    highest angle in lookback = (high[lookback] – today’s high ) / barindex

    then for each bar after today, subtracting that angle to create a trigger price, until the close >trigger.

    Suggestions very welcome!

     

    #76276

    Barindex can be 10000 or more, maybe highest angle in lookback = (high[lookback] – today’s high ) / i would be better, but I did not test it.

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

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