Avoid return of a value when “0”

Forums ProRealTime English forum ProRealTime platform support Avoid return of a value when “0”

Viewing 8 posts - 1 through 8 (of 8 total)
  • #228285

    Hello
    I had a custom indicator that worked in the past –
    The idea was when the value of a variable was “0” the value was not to be returned. something like:
    if (close > open)
    v = close
    else
    v= 0
    return v AS “MY”

    this worked well , but now I see that the chart plots a transition from “0”
    Is there a way to still not distort the chart by values of “0” ?

    Thanks

    #228286

    There you go:

     

    #228325

    Hi,
    Thanks a lot for you answer !
    it helped , but problem is still not resolved –
    The way that is is drawn now is you see a line connected between a candle that had “t=0” and  a candle with “t=255” .
    As you can see in your drawing a transition is plotted (marked in yellow) on the graph .
    is there a way to avoid drawing this transition and actually start the drawing from the candle that has “t=255” ?
    Thanks,
    Lior

    #228335

    I can’t see any yellow line.

     

    #228341

    I am trying to attach a drawing, but  its not uploaded

    #228342

    if you look at the picture you sent out –
    there is a transition shown between the candle at 14:00 and the one at 15:00
    the candle at 14:00 has t=0 and the one at 15:00 has t=255, so I would expect the drawing to start for the candle at 15:00
    why is there a connecting line before the candle at 15:00  (the one joining the candle at 14:00 with the one at 15:00) and is there a way to avoid this ?
    Thanks

    #228346
    JS

    It’s just a simple change in the formula…

    1 user thanked author for this post.
    #228352

    Thanks a  lot !!

    1 user thanked author for this post.
    avatar JS
Viewing 8 posts - 1 through 8 (of 8 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login