TTM Squeeze Conditions

B

boogieG

New member
I'm trying to add two TTM Squeeze conditions to a strategy. I want the entry condition to be an or statement of the two conditions. The first condition I want to be squeeze has not fired (red dot) 3 bars ago and the next condition is squeeze has not fired on current bar. For some reason positions are being entered when squeeze has fired (green dot.
Code:
def squeeze = TTM_Squeeze().SqueezeAlert [-3] is false;
def squeeze1 = TTM_Squeeze().SqueezeAlert is false;
def ttmsqueeze1 = !IsNaN(squeeze);
def ttmsqueeze2 = !IsNan(squeeze1);
def ttmsqueeze = ttmsqueeze1 or ttmsqueeze2 is true;

Thanks in advance for any help on fixing the code
 

Similar threads

Top