Mobius sent me the script on reddit, and it's exactly what I was looking for.
In case anyone else is looking for this, here's the TOS link for it... https://tos.mx/Y3Nzy4V
In case anyone else is looking for this, here's the TOS link for it... https://tos.mx/Y3Nzy4V
Ruby:
# Candles Colored By Bollinger Bandwidth
# Mobius
input averageType = AverageType.Simple;
input price = close;
input length = 20;
input Num_Dev = 2.0;
def mean = MovingAverage(averageType, price, length);
def sd = stDev(price, length) * Num_Dev;
def upper = mean + sd;
def lower = mean - sd;
def width = (upper - lower) / mean;
assignPriceColor(if width > width[1] then createColor(255,255,255) else color.current);
# End Code
Last edited by a moderator: