Love the product! Great work.
I am designing a strategy that looks at several indicators. The strategy looks for certain characteristics in each indicator.
I plan to write some code that will set a variable each time that the certain condition relevant to each indicator is met.
However, often these flags dont coincide on the same bar. So what I wanted to do was design a function that will place the flags into a dataseries, and then have a function that will look at if all the conditions are met within X amount of bars.
For example some rough pseudocode:
WHILE Trend is Up
IF indicator1 = somecondition THEN set flag indicator1flag=1 into a
dataseries
IF indicator2 = othercondition THEN set flag idicator2flag=1 into a
dataseries
IF indicator1flag + indicator2flag in LAST X AMOUNT OF BARS = 2 then enter a long position.
.....
So essentially I want to have an array of values for each indicator:
Indicator1: 0 0 0 0 0 0 1 0 0
Indicator2: 0 0 0 0 0 0 0 1 0
Then the order entry function will check all arrays and be true when the value is set within X amount of bars for all indicators.
I hope you follow my concept. Would really appreciate if one of the forum gurus could suggest a nice structure for such a design.
By the way I have also found using a while loop causes NT to crash every time. Is there a special syntax that I am missing or does anyone know what might be causing it?
Cheers,
Stephen

Comment