Jump to content
Medved Trader Forums
Sign in to follow this  
Mike Medved

Coming up - easier looping

Recommended Posts

In advanced code... will be able do something like:


if (Any(1,5, Close>Open && Close>Close[1]))
  ... do something


which would mean if any of the candles from 1 back to 5 back are positive and close higher than previous one....

of course, if the condition doesn't fit exactly into an expression, can also do full code like this:

if (Close.Any(1, 5, (i, x) =>

                    {
                       if (Close<=Open) return false;
                       return (Close>Close[i+1]);
                    }
                  );)
... do something


but that is more complex.

  • Thanks 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×