Highlighting 1 min candle if the candle length (high-low) is less than 1 point (4 ticks) for ES futures
I don't know why it's not highlighting anything. I am on 1 minute chart and want to highlight candles that are equal or less than 4 ticks candle length. This is the code I have.
I don't know why it's not highlighting anything. I am on 1 minute chart and want to highlight candles that are equal or less than 4 ticks candle length. This is the code I have.
Code:
# ES 1-Minute Candle Length Highlighter
# Highlights bars where the 1-min candle range is <= 4 ticks (1 point)
def candleHigh = high(period = AggregationPeriod.MIN);
def candleLow = low(period = AggregationPeriod.MIN);
def candleRange = candleHigh - candleLow;
def isSmallBar = candleRange <= 1.25; # 4 ticks = 1 point
AssignBackgroundColor(if isSmallBar then Color.YELLOW else Color.CURRENT);
Last edited by a moderator: