Hi All,
My Empty4 Platform is performing poorly with my EA in backtesting. I wish to speed things up a bit so i thought i could skip the useless ticks that are in between the high and low of each bar. Could anyone share a functional code for that? I saw on another forum a post that describes a bit of the process but i couldn't figure out the code. Thanks in advance and Here is what i saw..
Code: Select all
//+------------------------------------------------------------------+
//| Skip useless ticks |
//+------------------------------------------------------------------+
double CA.below, CA.above=0; // Export to start
void CallAgain(double when){
if (when>=Bid && CA.above > when) CA.above = when;
if (when<=Bid && CA.below < when)
CA.below = when;
return;
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start(){ static datetime Time0;
bool newBar = Time0 != Time[0], useless = CA.below <= Bid && Bid <= CA.above;
if (useless && !newBar) return(0);
#define INF 9999999
CA.below = 0;
CA.above = INF;
Time0 = Time[0];
if (!useless){
OnTick(); // Will reset CA's
ModifyStops();
OpenNew();
} // Not useless