The strategy below generates suprisingly good test results on EUR/USD, GBP/USD, USD/JPY.

So good in fact I set it up running against a demo account - actual results were very different.

I have since come across the TICKS parameter and the backtest results have been cured of their optimism.

It's not clear to me why TICKS had such a profound effect on the results (especially considering that I only have M1 data, not tick data). I am also wondering when - if ever - testing should be done without TICKS given the misleading results.

During testing what is the logic for simulating execution prices and times given entry stop & limit prices, stop prices and take profits?

-K

Code:
//
// no_ticks_skys_the_limit
//
	function run() {
	BarPeriod   = 30;
	Hedge       = 0;
	Weekend     = 2;
	StartDate   = 2010;
	EndDate     = 20160930;
	Lots        = 10000;

	vars prices = series(price());
	var  ema    = EMA(prices, 7);
	var  atr    = ATR(7);

	Entry       = -ema;
	TakeProfit  = atr*0.5;
	Stop        = atr*5;

	if (priceLow()  > ema && NumOpenLong  <= 0)	{ enterLong (); }
	if (priceHigh() < ema && NumOpenShort <= 0)	{ enterShort(); }
}



Code:
Test no_ticks_skys_the_limit EUR/USD

Simulated account   AssetsFix 
Bar period          30 min (avg 43 min)
Test period         05.01.2010-01.10.2016 (81755 bars)
Lookback period     80 bars (40 hours)
Monte Carlo cycles  200
Simulation mode     Realistic (slippage 5.0 sec)
Spread              1.1 pips (roll -0.10/-0.11)
Contracts per lot   1.0

Gross win/loss      41691$ / -16674$ (+28109p)
Average profit      3714$/year, 309$/month, 14$/day
Max drawdown        -263$ 1% (MAE -263$ 1%)
Total down time     47% (TAE 17%)
Max down time       27 days from Oct 2014
Max open margin     264$
Max open risk       348$
Trade volume        102405046$ (15202334$/year)
Transaction costs   -8846$ spr, -235$ slp, -8.53$ rol
Capital required    440$

Number of trades    9036 (1342/year, 26/week, 6/day)
Percent winning     87.7%
Max win/loss        33$ / -151$
Avg trade profit    2.77$ 3.1p (+5.9p / -16.8p)
Avg trade slippage  -0.03$ -0.0p (+0.3p / -2.1p)
Avg trade bars      1 (+1 / -5)
Max trade bars      43 (21 hours)
Time in market      20%
Max open trades     1
Max loss streak     4 (uncorrelated 4)

Annual return       845%
Profit factor       2.50 (PRR 2.40)
Sharpe ratio        9.33
Kelly criterion     10.31
R2 coefficient      0.890
Ulcer index         0.1%

Confidence level     AR   DDMax  Capital

 10%                900%   222$  413$
 20%                881%   236$  422$
 30%                872%   242$  426$
 40%                861%   250$  431$
 50%                855%   255$  434$
 60%                849%   259$  437$
 70%                843%   264$  440$
 80%                837%   269$  444$
 90%                826%   278$  450$
 95%                812%   289$  457$
100%                712%   386$  522$

Portfolio analysis  OptF  ProF  Win/Loss  Wgt%

EUR/USD             .999  2.50  7921/1115  100.0  
EUR/USD:L           .999  2.39  3886/585   47.2  
EUR/USD:S           .999  2.62  4035/530   52.8