offbeatoperator
New member
Hey everyone! I've been trying to convert this TTM candle code
https://usethinkscript.com/threads/squeeze-watchlist-column-histrogram-colors-for-thinkorswim.9726/
to paint the first candle only without any luck. Any help would be greatly appreciated! FYI I did change some colors, for instance, I changed the cyan bars to green.
input price = CLOSE;
input length = 20;
input nK = 1.5;
input nBB = 2.0;
input alertLine = 1.0;
def squeezeHistogram = TTM_Squeeze(price, length, nK, nBB, alertLine).Histogram;
plot hist = if squeezeHistogram>= 0 then
if squeezeHistogram> squeezeHistogram[1] then 2 else 1
else if squeezeHistogram < squeezeHistogram[1] then -2 else -1;
assignPriceColor(if squeezeHistogram >= 0 then
if squeezeHistogram > squeezeHistogram[1] then color.GREEN else color.CYAN
else if squeezeHistogram < squeezeHistogram[1] then color.RED else color.YELLOW);
hist.assignvaluecolor(if squeezeHistogram >= 0 then
if squeezeHistogram > squeezeHistogram[1] then color.GREEN else color.CYAN
else if squeezeHistogram < squeezeHistogram[1] then color.RED else color.YELLOW);
https://usethinkscript.com/threads/squeeze-watchlist-column-histrogram-colors-for-thinkorswim.9726/
to paint the first candle only without any luck. Any help would be greatly appreciated! FYI I did change some colors, for instance, I changed the cyan bars to green.
input price = CLOSE;
input length = 20;
input nK = 1.5;
input nBB = 2.0;
input alertLine = 1.0;
def squeezeHistogram = TTM_Squeeze(price, length, nK, nBB, alertLine).Histogram;
plot hist = if squeezeHistogram>= 0 then
if squeezeHistogram> squeezeHistogram[1] then 2 else 1
else if squeezeHistogram < squeezeHistogram[1] then -2 else -1;
assignPriceColor(if squeezeHistogram >= 0 then
if squeezeHistogram > squeezeHistogram[1] then color.GREEN else color.CYAN
else if squeezeHistogram < squeezeHistogram[1] then color.RED else color.YELLOW);
hist.assignvaluecolor(if squeezeHistogram >= 0 then
if squeezeHistogram > squeezeHistogram[1] then color.GREEN else color.CYAN
else if squeezeHistogram < squeezeHistogram[1] then color.RED else color.YELLOW);
Last edited by a moderator: