Color candles grey for no trade when dmi and adx are below 25 = COLOR YELLOW when adx START to decline
I would also like the candles to follow the trend, but I don't know how to add the script for trending candles.
This is the script I used
I would also like the candles to follow the trend, but I don't know how to add the script for trending candles.
This is the script I used
Code:
# ADX Candle Coloring Upper Indicator
# Colors candles based on ADX + trend direction
declare upper;
input length = 14;
input averageType = AverageType.WILDERS;
def hi = high;
def lo = low;
def cl = close;
def diPlus = DMI(length, averageType)."DI+";
def diMinus = DMI(length, averageType)."DI-";
def adx = DMI(length, averageType)."ADX";
def adxDeclining = adx < adx[1];
def adxBelow25 = adx < 25;
# Basic trend coloring
def bullish = cl > cl[1];
def bearish = cl < cl[1];
AssignPriceColor(
if adxBelow25 then Color.GRAY
else if adxDeclining then Color.YELLOW
else if bullish then Color.GREEN
else if bearish then Color.RED
else Color.CURRENT
);
Attachments
Last edited by a moderator: