-3

i have a question on which I can not find any answer on web sources.

I need my strategy to check 80 previous bars for criteria x.

Can I shorten the code instead of writing like these: (below example of my code)

Thank you so much for your help Like this:

x = y[1]>low or y[2]>low.....

  • Hi welcome to SO! please read this [article](https://stackoverflow.com/help/minimal-reproducible-example) about how to ask questions on the site. – moshevi Feb 16 '21 at 09:21

1 Answers1

0

The simplest solution

var x = false
for i=1 to 80
    x := x or y[i]>low
AnyDozer
  • 2,236
  • 2
  • 5
  • 22