Limit event to first ocurrence
Posted: Thu Sep 28, 2017 4:20 pm
Hi
There are a number of system scans in Edgerater that refer to an existing condition, rather than a crossover.
One example is High Close which generates an event if the close price is higher than every prior close price over the last N bars.
The problem I am having is to code this so that only the first instance is recorded, not every consecutive high close. If we set N equal to 5 and the close price keeps going up, there would also be an event for the 6th, 7th 8th etc for as long as the trend keeps going up.
I have not been able to come up with a solution although something similar is done with the SIM_2_20EMA upside breakout. I have not been able to transfer that concept to the High Close Scan.
Help would be appreciated.
Dan
There are a number of system scans in Edgerater that refer to an existing condition, rather than a crossover.
One example is High Close which generates an event if the close price is higher than every prior close price over the last N bars.
The problem I am having is to code this so that only the first instance is recorded, not every consecutive high close. If we set N equal to 5 and the close price keeps going up, there would also be an event for the 6th, 7th 8th etc for as long as the trend keeps going up.
I have not been able to come up with a solution although something similar is done with the SIM_2_20EMA upside breakout. I have not been able to transfer that concept to the High Close Scan.
Help would be appreciated.
Dan