TTM Squeeze Watchlist Color Coding

B

BayTrader_93

New member
Hey everyone, I have this code I'm using in my watchlist but I wanted to adjust it so that instead of black backgrounds and color words, I wanted to flip flop it so that the background is colored so that way when the squeeze lines up on multiple time frames, I can see it more clearly. Pretty new to coding, and more specifically think script so just reaching out for some help.

Thanks!

Code:
# Simpler Trading Squeeze watchlist column - Eric Purdy 2017

# Shared Link -    https://tos.mx/5cpgKa
#Start
def sqz = !TTM_Squeeze().SqueezeAlert;
def direction = TTM_Squeeze()>TTM_Squeeze()[1];
def count = if sqz and !sqz[1] then 1 else count[1]+1;
def fired = if !sqz and sqz[1] then 1 else 0;
def firedCount = if fired then 1 else firedCount[1]+1;
def firedDirection = if fired then direction else firedDirection[1];
addLabel(yes, if sqz then “Squeeze:” + count else if sum(fired,5) then “Fired:” + firedCOunt + if firedDirection then ” Long” else ” Short” else “-”, if sqz then color.red else if sum(fired,5) and firedDirection then color.green else color.orange);
#Finish
 
V

Vimal Mittal

Member
Hey everyone, I have this code I'm using in my watchlist but I wanted to adjust it so that instead of black backgrounds and color words, I wanted to flip flop it so that the background is colored so that way when the squeeze lines up on multiple time frames, I can see it more clearly. Pretty new to coding, and more specifically think script so just reaching out for some help.

Thanks!

Code:
# Simpler Trading Squeeze watchlist column - Eric Purdy 2017

# Shared Link -    https://tos.mx/5cpgKa
#Start
def sqz = !TTM_Squeeze().SqueezeAlert;
def direction = TTM_Squeeze()>TTM_Squeeze()[1];
def count = if sqz and !sqz[1] then 1 else count[1]+1;
def fired = if !sqz and sqz[1] then 1 else 0;
def firedCount = if fired then 1 else firedCount[1]+1;
def firedDirection = if fired then direction else firedDirection[1];
addLabel(yes, if sqz then “Squeeze:” + count else if sum(fired,5) then “Fired:” + firedCOunt + if firedDirection then ” Long” else ” Short” else “-”, if sqz then color.red else if sum(fired,5) and firedDirection then color.green else color.orange);
#Finish
I see squeeeze "green fired" and "red color squeeze" in my watchlist. However,rest of them are orange "------" with nothing showing ? Can u explain what are those?
Thanks.
 

Similar threads

Top