Reply To: Multiple criteria over several bars

Optuma Forums Optuma Scripting Multiple criteria over several bars Reply To: Multiple criteria over several bars

#53799
MathewMathew
  • Topics: 28
  • Replies: 1,445
  • Posts: 1,473

Hi Steve,

You can use the “TimeSinceSignal()” function to get how many bars since the event occurred. So with this we just need to make sure that each TimeSince is less than 4 bars.

eg

Sig1 = {Signal Script 1};
Sig2 = {Signal Script 2};

(TimeSinceSignal(Sig1) < 4) AND (TimeSinceSignal(Sig2) < 4)

This will only trigger if they are both within 3 days of each other. Note that you may get multiple results. If that is the case you can use a NoRepeat() function to limit it to 1.

See https://help.optuma.com/kb/faq.php?id=1030 for more info on the function.

Hope that helps

Mathew

Pin It on Pinterest

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close