Here's an example (abridged) indicator:
// Local variable
int counter = 0;
// On Bar update
if (Close[0] >= Low[1])
counter = counter + 1;
Value.Set(counter);
The above indicator essentially keeps count of the times a bar closes above its previous low. Let's say going into today, the number (on a daily basis) is 30.
If I put into a column of the market analyzer the above indicator on daily data, and set Calculate on Bar Close to true, it'll read 30, the number at previous day's close.
If I set Calculate on Bar Close to false, I'm hoping that if the latest tick is above yesterday's low, it'll read 31 and if it isn't, it'll read 30.
Instead, it appears that the local counter variable continues to increase with every tick as long as the latest tick is above yesterday's low. The indicator ends up reading several thousand (or however many ticks) instead of 30 or 31.
Is there a way to get what I originally desired, ie. 30 or 31 depending on incoming tick?
Comment