Error with Lowest[n] / Highest[n]

Forums ProRealTime English forum ProScreener support Error with Lowest[n] / Highest[n]

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

    Hi all,

     

    I am trying to define a condition referring to the Historic Low of a value (taking into account the limitation of 1024 candles). Lowest[1023](Low).

    The problem arises whith stocks that have traded fewer candles than those indicated in the Lowest command (i.e. IPO occured less than 1023 candles ago). Whith such stocks, ProScreener will directly ignore them ​​from the result, even if all conditions are correct. Note: This problem occurs in Lowest, Highest and other commands that involve earlier candles.

     

    I have simplified a code below for the sake of the example.

    The first two conditions are intended to narrow down the list and only show a specific stock (LDA – Linea Directa) that has been trading in the Spanish market only for a few sessions. This ProScreener should only apply to Stocks in Spain for simplicity, but feel free to do you own testings.

    Then third condition states that the lowest traded value during the last 160 candles must be greater than 0 (obviously the condition will be correct). But because LDA to date has only traded 156 sessions, despite the fact that the 3 conditions are correct, it will not appear in the ProScreener result. If you introuce Lowest[100](Low) however, it will work fine.

    Do you know if  there is a way to fix this error, maybe with a different code?

    I thought about something like: MIN (sessions traded, 1023) but I have not been able to find a way to identify the number of sessions traded to date.

    Thanks.

    #182768

    Try this one:

    1 user thanked author for this post.
    #182772

    Grand master Roberto!

     

    Fantastic solution.

    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