Jim Dean![]() Sage ![]() ![]() Posts: 3022 Joined: 9/21/2006 Location: L'ville, GA ![]() | Solution uses the "Sum" function to accumulate "votes" for successive condition rules to be valid (-sign is important since it converts the sum of four "trues", each = -1, to a positive number): For shorts, this identifies the run of U+L up's with the most recent bar's Upper having just turned down ... -Sum( (Bol_Upper(9,1.2)[1] > Bol_Upper(9,1.2)[2] and Bol_Lower(9,1.2)[1] > Bol_Lower(9,1.2)[2]), 4) = 4 and Bol_Upper(9,1.2) < Bol_Upper(9,1.2)[1] For longs, this identifies the run of U+L dn's with the most recent bar's Lower having just turned up ... -Sum( (Bol_Upper(9,1.2)[1] < Bol_Upper(9,1.2)[2] and Bol_Lower(9,1.2)[1] < Bol_Lower(9,1.2)[2]), 4) = 4 and Bol_Lower(9,1.2) > Bol_Lower(9,1.2)[1] I'm not clear how you want to integrate a squeeze with this, so I'll leave that to you ... and btw I have not tested this re syntax or validity, but it's pretty straightforward so hopefully you're good to go. |