How to check a rule within last n bars?
Posted: Fri Dec 23, 2022 7:30 am
How to check if a core rule returned true within last n bars?
For example:
I have a core rule testing if some multi conditions are met together.
It is rather long - just for example (close > MA14) and (close > MA200) and (close > open) and (indicator1 > indicator 2) and ... and ... and ...
If all the conditions are met, it returns true.
Could you help me with any idea how could I check if the rule was true anywhere within last 10 bars?
For example:
I have a core rule testing if some multi conditions are met together.
It is rather long - just for example (close > MA14) and (close > MA200) and (close > open) and (indicator1 > indicator 2) and ... and ... and ...
If all the conditions are met, it returns true.
Could you help me with any idea how could I check if the rule was true anywhere within last 10 bars?