Quote:
Originally Posted by IngvarDagmar
Sorry for my Englsih.
I want count number times condition is true only once per bar. Computer add up many times per bar. What wrong I do?
|
Use a function like this...
PHP Code:
bool NewBar() {
static datetime LastTime = 0;
if (Time[0] != LastTime) {
LastTime = Time[0];
return (true);
} else
return (false);
}
Then put an if statement round your main code, like...
PHP Code:
if(NewBar() == true){
// do the main processing here
}
Hope that helps.
Lux