Speed up Backtesting/Skip Useless Ticks

Post Reply
investguy
Posts: 7
Joined: Wed Apr 18, 2012 5:17 am

Speed up Backtesting/Skip Useless Ticks

Post by investguy »

Speed up Backtesting/Skip Useless Ticks
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
User avatar
Freedom787
Trader
Posts: 30
Joined: Wed Mar 13, 2013 3:46 pm
Location: United States

Re: Speed up Backtesting/Skip Useless Ticks

Post by Freedom787 »

I may be wrong, but isn't that how the "control points" setting more or less works. It uses the high and low of the timeframe below it to create less ticks? so for an m15, you would have the high and low of 3 m5 bars, or 6 ticks.
Big Be
Trader
Posts: 52
Joined: Thu Nov 01, 2012 6:12 pm

Re: Speed up Backtesting/Skip Useless Ticks

Post by Big Be »

See post 10 of my thread on TSD:
http://www.forex-tsd.com/Empty4-pro ... ht-me.html
The speed I achieved is mentioned in post 1. That was on a computer of half a dozen years ago.

Brandon
"Big Be"
Post Reply

Return to “Coders Hangout”