Welcome to the BEST forum for traders

Did you know we're sharing tons of exclusive content here?
Our community is growing quickly. Take a look around and say "Hello".

color code not working

Sep 5, 2021 - 4:48 PM

Viewed 287 times

https://best-trading-indicator.com/community/bti/forums/4180/topics/25837 COPY
  • Here is my script. It just changes bars to blue and yellow. Though i see there are candles which satisfy green and red. Please can anyone help? Thanks in advanace

    if (close > open) and ((high-low/2) < (close - open))
    c:=color.green
    else if (close > open) and ((high-low/2) > (close - open))
    c:=color.blue
    else if (close < open) and ((high-low/2) < (open - close))
    c:=color.red
    else if (close < open) and ((high-low/2) > (open - close))
    c:=color.yellow

    barcolor(c)

    0
  • Hello

    Are you sure?
    If the candles are never green for example, it means the (high-low)/2 is never lower than the (close - open)

    You should calculate/display the (high - low/ 2) and (close - open) on your charts to debug

    0
CONTENTS