Is there a way to make this line shorter? There's a lot of repetition and only one value is changed.
(Ref(close,1)/close >=1.2 OR Ref(close,2)/close >=1.2 OR Ref(close,3)/close >=1.2 OR Ref(close,4)/close >=1.2 OR Ref(close,5)/close >=1.2) OR Ref(close,6)/close >=1.2 OR Ref(close,7)/close >=1.2 OR Ref(close,8)/close >=1.2))
How about: hhv(close, 9)/close >= 1.2
assuming that you really wish to look back and not forward as your original string was written. If you really do wish to look into the future, you can try '-' sign for period (I haven't tried it).