Main function is executed for EVERY tick coming in.
This distorts the results for any study that saves results from previous bars to be used in current bar.
Example:
var myVar;
PreMain{ ... }
Main{
.....
myVar = myVar + something;
.....
return(myVar);
}
will update "myVar" EVERY TICK (!?!) when watched in real time.
Is there an option to run Main only ONCE per each bar?
NOTE: This problem shows ONLY for bars that are watched in real time. Historical calculations are correct.
Thank you.
Mihai Buta
This distorts the results for any study that saves results from previous bars to be used in current bar.
Example:
var myVar;
PreMain{ ... }
Main{
.....
myVar = myVar + something;
.....
return(myVar);
}
will update "myVar" EVERY TICK (!?!) when watched in real time.
Is there an option to run Main only ONCE per each bar?
NOTE: This problem shows ONLY for bars that are watched in real time. Historical calculations are correct.
Thank you.
Mihai Buta
Comment