Price channel breakout since x weeks

Appreciate help to write a code line for a new 20 week price channel breakout since 10 weeks ago.

Is there a quicker method than:
and [weekly close > weekly upper price chan(20)]
And [1 week ago close < 1 week ago upper price chan(20)]
And [2 weeks ago close < 2 weeks ago upper price chan(20)]
Etc...

Thanks

Comments

  • I'm not exactly sure what you are asking. Do you mean that price has been under the 20 week channel for 10 weeks and broke out this week?