1st and 2nd etc lowest lows in a data set

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #209164 quote
    robert123
    Participant
    Master

    Hi All,

    Whilst I understand how to find the lowest low in a data set (bounded oscillator), is it, and if it is possible, how do I find the second or third lowest low?

    TIA

    Robert

    #209174 quote
    JS
    Participant
    Senior
    Hi @Robert123

    Perhaps not the most elegant way…    

    DefParam DrawOnLastBarOnly=true
    
    For i=0 to 20
    $Low[i]=Low[i]
    Next
    
    ArraySort($Low,Ascend)
    Low1=$Low[0]
    Low2=$Low[1]
    Low3=$Low[2]
    
    DrawText("Low1=#Low1#",BarIndex,High+30)
    DrawText("Low2=#Low2#",BarIndex,High+20)
    DrawText("Low3=#Low3#",BarIndex,High+10)
    
    Return
    

    #209207 quote
    JS
    Participant
    Senior

    Hi Robert,

    A small explanation (if necessary)…

    You fill the array $Low with the last 20 “Lows”…

    You sort the array $Low ascending so that the “smallest lows” are at the front…

    After this you can use the obtained values as you wish…

    #209209 quote
    robert123
    Participant
    Master
    JS, Thank you very much works perfectly- after several coffees! Again thanks for your help. RR
    JS thanked this post
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

1st and 2nd etc lowest lows in a data set


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
robert123 @robert123 Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by robert123
3 years ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 02/05/2023
Status: Active
Attachments: 1 files
Logo Logo
Loading...