Matthew Greenslet![]() Idol ![]() ![]() ![]() ![]() Posts: 2077 Joined: 2/27/2006 ![]() | Duxx, What you can do is define your "pattern" formation in a single boolean statement (occuring if = true) and use a single counter, you dont need 3. If true you reset the counter, Else increase the counter by 1. This will keep track of how many bars have passed since the most recent pattern formed. After your pattern has formed you would then check your trigger condition if the counter is less than or equal to your parameter threshold. I.E. #System #PARAM "NBars", 5, 1, 10 Dim nBarsSincePattern as Integer If L[1] < L[2] And L > L[1] Then nBarsSincePattern = 0 Else nBarsSincePattern += 1 End If If nBarsSincePattern <= NBars Then If C > O and C > H[nBarsSincePattern + 1] Then Signal = LongSignal End If p.s. - I edited your top post to correct the missing comparison signs. The issue is with the spacing between the < and > signs. You must have a whitespace to both the right and left of it or it is treated as HTML. |