How can I get this to work: What I'm trying to do is to change the candle colors to red if the price is below the retracement level and green if it's above with arrows to indicate when the price crosses the retracement level. I can't get this to run
# Fibonacci Candles
input price = close;
input retraceType = {default Fibonacci, Alternate};
input retraceLevel = {default 23.6, 38.2, 50, 61.8, 100};
input PaintBars = yes;
def highest = Highest(price, lookBackLength);
def lowest = Lowest(price, lookBackLength);
def retrace = (highest - lowest) * retraceLevel / 100 + lowest;
plot retraceLevel = retrace;
retraceLevel.SetDefaultColor(GetColor(5));
retraceLevel.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
AssignPriceColor(if PaintBars and price < retrace then CreateColor(204, 0, 51) else Color.GREEN);
plot ArrowDown = price crosses above retraceLevel;
ArrowDown.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
ArrowDown.SetDefaultColor(Color.RED);
ArrowDown.SetLineWeight(3);
plot ArrowUp = price crosses below retraceLevel;
ArrowUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
ArrowUp.SetDefaultColor(Color.GREEN);
ArrowUp.SetLineWeight(3);
# End Code for Fibonacci Candles
Any help would be appreciated. Thanks
# Fibonacci Candles
input price = close;
input retraceType = {default Fibonacci, Alternate};
input retraceLevel = {default 23.6, 38.2, 50, 61.8, 100};
input PaintBars = yes;
def highest = Highest(price, lookBackLength);
def lowest = Lowest(price, lookBackLength);
def retrace = (highest - lowest) * retraceLevel / 100 + lowest;
plot retraceLevel = retrace;
retraceLevel.SetDefaultColor(GetColor(5));
retraceLevel.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
AssignPriceColor(if PaintBars and price < retrace then CreateColor(204, 0, 51) else Color.GREEN);
plot ArrowDown = price crosses above retraceLevel;
ArrowDown.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
ArrowDown.SetDefaultColor(Color.RED);
ArrowDown.SetLineWeight(3);
plot ArrowUp = price crosses below retraceLevel;
ArrowUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
ArrowUp.SetDefaultColor(Color.GREEN);
ArrowUp.SetLineWeight(3);
# End Code for Fibonacci Candles
Any help would be appreciated. Thanks