ACtually let me clarify:
Basically I"m looking to do something if I know that within the last 10 bars, price has crossed up over the most recent swing high. I'm also looking to do something else if I know that within the last 10 bars, price has crossed below the last swing low. I'm looking to do a third thing when over the last 10 bars, price has not moved past the last swing high, or the last swing low.
For example, price crosses the last swing high and Ninja will execute X - I want x to remain in effect until another Swing high starts printing (which requires a retracement). If during this retracement, price continues to retrace and not cross this swing high for 10 bars, I want Ninja to do something else Y and no longer do X. If during the course of that retracement, it happens to create a Swing Low, and then it happens to cross that Swing low, I want Ninja to do Z and to no longer do Y.
Is this possible? Should I be using a for loop, or will if statements work?
Comment