I cobbled this together, and believe it works. When all waves are above the zero line you'll see a vertical dark green line on your upper chart. If one one the waves is equal-to, or below I changed the line to black to make it disappear. Is there a better way to do do that?
Code:
# Draw Vertical Signal when All Histogram Waves are above the Zero Line
AddVerticalLine(close, ”” , (if TTM_Wave()."Wave1" >0 and TTM_Wave()."Wave2high" >0 and TTM_Wave()."Wave2low" >0 then Color.DARK_GREEN else Color.BLACK));
post1
i doubt more than one signal will cross on the same bar. Usually you pick 1 signal to look for a cross and the others to see if they are greater than something.
but here is something to try.
input wave_crossing_level = 0;
def ttmw1 = TTM_Wave()."Wave1" ;
def ttmwhi = TTM_Wave()."Wave2high" ;
def ttmwlo = TTM_Wave()."Wave2low";
def allup = if ttmw1 > 0 and ttmwhi > 0 and ttmwlo > 0 then 1 else 0;
AddVerticalLine( allup, "--", color.DARK_GREEN );
# check for ttms crossing a level
def ttmw1x = ttmw1 crosses wave_crossing_level;
def ttmwhix = ttmwhi crosses wave_crossing_level;
def ttmwlox = ttmwlo crosses wave_crossing_level;
def allcross = if ( ttmw1x + ttmwhix + ttmwlox ) == 3 then 1 else 0;
AddVerticalLine( allcross, "cross", color.magenta );
-------------
post2
the 1st parameter of a addverticalline is yes no, to show it or not show. You could add conditions here that would cause the line to be visible or not.
by putting close in there, something that always has a number above 0, it is interpreted as true, and always shows.
If I am pulling external data, I always set it equal to a variable. Then I can reference that variable in multiple places, And not have to read the same external data again.
I try to set up long formulas equal to a variable and then reference the variable in plot formulas.
Separating things out ahead of time makes it a lot easier for understanding the code. it also helps if it needs debugging, plotting values in a bubble, to make sure it has the right value.
def ttmw1 = TTM_Wave()."Wave1" ;
def ttmwhi = TTM_Wave()."Wave2high" ;
def ttmwlo = TTM_Wave()."Wave2low";
def allup = if ttmw1 > 0 and ttmwhi > 0 and ttmwlo > 0 then 1 else 0;
AddVerticalLine( allup, "--", DARK_GREEN );
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddVerticalLine