[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Indicator code execution



PureBytes Links

Trading Reference Links

Im working on some seasonal indicator but had problems with it.
I stripped the code to the problem related part, see below.
It counts the number of years within a symbol. As soon as i click
on apply indicator it displays the correct year count, but then
everything disappears and the yc is set back to 1. Looks like
the code is executed twice for some reason. Any help?

yc = 0; //Yearcount
yeer = Year();
for(i=1; i<BarCount; i++) {
	if(yeer[i] != yeer[i-1]) {   // year change
		yc++;
		printf("yc %f", yc);
	}
}