stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Speed up Backtesting/Skip Useless Ticks
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=1732
Page 1 of 1
Author:  investguy [ Sun Mar 31, 2013 12:41 am ]
Post subject:  Speed up Backtesting/Skip Useless Ticks

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
Author:  Freedom787 [ Sat Apr 20, 2013 4:13 pm ]
Post subject:  Re: Speed up Backtesting/Skip Useless Ticks

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.
Author:  Big Be [ Mon Jun 17, 2013 5:44 pm ]
Post subject:  Re: Speed up Backtesting/Skip Useless Ticks

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
All times are UTC Page 1 of 1