How to find relative minimums (maximums)

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #215788 quote
    Owl888
    Participant
    New

    Hi,

    I know the HIGHEST[n] function that gives the highest price for the last n candles.

    Is it possible to get the HIGHEST price between 2 candles, say the nth and the mth, something like HIGHEST[n,m] ?

    How to get the candle index corresponding to the HIGHEST output ?

    Thanks

    Fred

    #215794 quote
    robertogozzi
    Moderator
    Master

    HIGHEST[n,m] is not supported, but you can use:

    HIGHEST[n](source[m])  //source can be anything, CLOSE, HIGH, etc...
    #215820 quote
    JS
    Participant
    Veteran

    Hi,

    You can search between two different candles for example between candle n and candle m:

    HH = Highest[m-n+1](High[n])

    To find the index of HH you make a loop through the relevant candles with HH as reference.

    For example: HH between candle 3 and 10

    HH = Highest[10-3+1](High[3])

    For i=3 to 10-1

    If High[i] = HH then

    HHBarIndex=BarIndex[i]

    EndIf

    Next

    Nicolas thanked this post
    #215904 quote
    Owl888
    Participant
    New
    ok, thanks ; I was trying to avoid the loop which can create perf issue if I’m not careful about the range..
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

How to find relative minimums (maximums)


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
Owl888 @owl888 Participant
Summary

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

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 06/07/2023
Status: Active
Attachments: No files
Logo Logo
Loading...