LOWESTLOW of custom indicator

Optuma Forums Optuma Scripting LOWESTLOW of custom indicator

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #59115
    AvatarSimon
    • Topics: 5
    • Replies: 10
    • Posts: 15

    Hello, I have tested below with many custom indicators with same inconsistent results. I believe my error lies somewhere else but going through many, many variations are unable to detect it. If someone could please assist with below:

    Requiring:
    Current low of custom indicator is lower than the lowest low of custom indicator over the last 50 bars.

    This is what I have:

    #59116
    MatthewMatthew
    • Topics: 5
    • Replies: 366
    • Posts: 371

    Hi,

    Here is an example using a basic custom value:

    This is how it appears on the chart:

    Ex3

    Anytime the blue line drops below the red line, a true result is returned by the script.

    #59121
    MathewMathew
    • Topics: 36
    • Replies: 1,806
    • Posts: 1,842

    Hi Simon,

    Just to add to what Matt Humphreys wrote, the LOWESTLOW and HIGHESTHIGH functions have a “Use Last Bar” value which is off by default. That switch is specifically for scripting so that you do not need to do the L1[1] offset. The reason for this is that we can not get a break if today’s low value is included in the lowestlow calculation.

    All the best

    Mathew

    #59123
    AvatarSimon
    • Topics: 5
    • Replies: 10
    • Posts: 15

    Thank you, in your example:

    how would you ignore any V1 result that returned zero. I tried adding a:

    V1B = V1>0 and substituting the other V1’s for for V1B’s though were unsuccessful?

    #59126
    MatthewMatthew
    • Topics: 5
    • Replies: 366
    • Posts: 371

    So in the case of a script where a zero value can be returned, for example:

    You can wrap the last line in a NonZero() function. When that is done, in instances where a zero would be returned, the previous days value is used instead…

    Ex10

    #59127
    AvatarSimon
    • Topics: 5
    • Replies: 10
    • Posts: 15

    Thank you very much.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Pin It on Pinterest