Retrieve the level of a past High / Low

Forums ProRealTime English forum ProBuilder support Retrieve the level of a past High / Low

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

    Hello,

    I created a peak and valley indicator for a more complex use.

    The first objective would be to determine if the last peak is higher or lower than the previous one, same thing for the troughs.

    So I would like to know the variable that would allow me to find the price level of the previous trough or peak, that’s the object of my request.

    The other objectives will be simple to implement once this problem is corrected.

    Secondary objective that is not part of the request :
    Determine the average price level over the X last peak
    Create segments on the X last vertex with possible extension

    And maybe other objectives…

    In any case, the idea would be to know the trend in progress via the peaks and troughs or if we are in a row.

    Once the indicator is finished, it will be made available in the library.

    Thank you in advance for your help!
    Translated, sorry for the errors

     

    #146197
    #146224

    Well, I managed to code a channel and points according to my definition of a peak or trough.
    The problem is the following, I would like to draw two lines, a high line that joins the last two peaks and a low line that joins the last two troughs.
    The barindex of the line must be the same as that of the points drawn by the indicator, for my part, I can’t determine the barindex in time .
    I would like to have a hand with this problem x)

    #146225

     

    #146393

    The code has changed, I’ve simplified it, I’ve overworked the definition of a peak or a trough.

    On the other hand, the problem remains the same, how could I flip the bar index of the previous peak or trough?

     

    #146398

    Answer in the learning videos, as much for me…
    Thank you Nicolas

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