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: 9
    • Posts: 14

    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: 317
    • Posts: 322

    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: 32
    • Replies: 1,593
    • Posts: 1,625

    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: 9
    • Posts: 14

    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: 317
    • Posts: 322

    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: 9
    • Posts: 14

    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

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close