I've decided to try and add greater functionality to my little strategy as I've recently noticed an opportunity I'd like to capitalize on.
Here's what I'd like NinjaScript to capture (instead of "n" bars back, I'd like to capture a specific series events in a specific order):
1. Within the last "n" bars, the indicator crossed below 5.
2. Then, the indicator crossed back above 5.
3. The indicator then climbed to 30.
4. The indicator then crossed back below 20 (but never went past 15).
5. Now, the indicator is on the way back up again. (essentially a "failure swing," where the indicator has made a higher low).
Thanks to all the great assistance I've been receiving here on the forum, I've learned how to tell the strategy to look back a certain number of bars.
I also now know (thanks to your wonderful "nudges") how to tell the strategy to check "within" a certain number of bars for an event.
What I'm wondering, is how to tell the strategy about a "sequence" of events which happened in a particular order. (without necessarily having to specify the number of bars within which the event happened).
So, (within the wizard of course), I'm trying to tell the strategy that "recently" a series of events occurred this specific order... the first was a cross below 5, the second was a cross above 5, the third was a cross above 30, the fourth was a cross below 20, etc..
I've been trying a string of "crossabove" and "crossbelow" commands, but this has been cumbersome and inefficient, and I suspect there is a more elegant, and efficient way to accomplish exactly my goal.
It would be wonderful to have someone again point me in the right direction for the correct NinjaScript method to use to accomplish this.
Any thoughts?
-V

Comment