problem with backtesting

 
Could you please explain me, why attached EA can't be backtested? Above mentioned code is copied from mql4 book (https://book.mql4.com/samples/expert)
Files:
 
shirava2k12:
Could you please explain me, why attached EA can't be backtested?

What makes you think that?

The EA does not adjust for 4/5 digit brokers and for ECN brokers.

 

Well, I've left backtesting turned on for a while with visual mode enabled, and i did not notice any progress - no movement among candles. I have started "plain backesting" without optimization function so that- in my opinion- it shouldn't take too long. I can't see any errors (included in code) in the journal.

In fact, my broker provides 4 digit quotation. However i dont really grasp, what shoould be changed in that code to comply with what my broker requires.

 
shirava2k12:
Could you please explain me, why attached EA can't be backtested? Above mentioned code is copied from mql4 book (https://book.mql4.com/samples/expert)


NO because this EA is normally opening and closing trades in backtest.

So there is no explanation why that EA can't be backtested

Strategy Tester Report
tradingexpert
FinFX-Demo (Build 427)


Symbol GBPUSD (Great Britain Pound vs US Dollar)
Period 1 Hour (H1) 2011.12.01 00:00 - 2012.07.30 23:00 (2011.12.01 - 2012.07.31)
Model Every tick (the most precise method based on all available least timeframes)
Parameters StopLoss=2000; TakeProfit=390; Period_MA_1=11; Period_MA_2=31; Rastvor=28; Lots=0.1; Prots=0.07;
Bars in test 4747 Ticks modelled 11979022 Modelling quality 80.81%
Mismatched charts errors 59
Initial deposit 10000.00
Total net profit -4380.41 Gross profit 5744.76 Gross loss -10125.17
Profit factor 0.57 Expected payoff -11.71
Absolute drawdown 4467.24 Maximal drawdown 4498.24 (44.84%) Relative drawdown 44.84% (4498.24)
Total trades 374 Short positions (won %) 192 (56.77%) Long positions (won %) 182 (54.95%)
Profit trades (% of total) 209 (55.88%) Loss trades (% of total) 165 (44.12%)
Largest profit trade 27.60 loss trade -134.80
Average profit trade 27.49 loss trade -61.36
Maximum consecutive wins (profit in money) 9 (246.42) consecutive losses (loss in money) 7 (-453.88)
Maximal consecutive profit (count of wins) 246.42 (9) consecutive loss (count of losses) -453.88 (7)
Average consecutive wins 2 consecutive losses

 
Sorry for messing you around. I have been using code coppied directly from book, not the one which is in attached file. There were several mistakes regarding to relational operators. The one in cycle from block which evaluates orders accounting impeded backtesting per se.
Reason: