jngy2k
Member
It's been AWHILE but glad the community is still as popular as ever.
Firstly my code runs.
Lastly it doesn't work. lol. The display shows it as purple for some reason so I'm thinking there is a settings problem?
Here's my code to change the Current bar color according to high and low of the Previous Bar:
What am I doing wrong?
edit: I just started working on this code an hour ago from posting so I might figure it out but thought I'd get some input from here in the meanwhile.
Firstly my code runs.
Lastly it doesn't work. lol. The display shows it as purple for some reason so I'm thinking there is a settings problem?
Here's my code to change the Current bar color according to high and low of the Previous Bar:
Code:
declare upper;
def h = high;
def l = low;
def c = close;
def o = open;
def isGreen = c > high[1];
def isRed = c < low[1];
def isYellow = !isGreen and !isRed;
AddChart(high = h,low = l,open = o,close = c,type = ChartType.Bar);
AssignPriceColor(if isGreen then Color.GREEN else if isRed then Color.RED else Color.YELLOW);
What am I doing wrong?
edit: I just started working on this code an hour ago from posting so I might figure it out but thought I'd get some input from here in the meanwhile.