I've been trying to have three bars based on the different conditions in the script but I'm only get one bar. How can I edit the script to get separate bars based on the conditions?
This is the script:
declare lower;
def EMA5 = ExpAverage(close, 5);
def EMA13 = ExpAverage(close, 13);
def EMA20 = ExpAverage(close, 20);
def cond1 = (EMA5 > EMA13);
def cond2 = (EMA13 > EMA20);
def cond3 = (EMA5 < EMA13);
def cond4 = (EMA13 < EMA20);
plot dot = if IsNaN(close) then Double.NaN else 1;
dot.SetStyle(Curve.POINTS);
dot.SetLineWeight(5);
dot.AssignValueColor(if cond1 and cond2 then Color.GREEN
else if cond3 and cond4 then Color.RED
else color.YELLOW);
Thanks