Automated Trading Championshio 2007: Common Errors in Expert Advisors - page 3

 

Hello everybody

I am using metatrader 4.

I would really appreciate the help of any of you since I have not found any explanation to my doubts yet. I am using MetaTrader 4.00.

I am stuck with a message that is returned to me on the Journal tab of the Tester window when I am optimizing expert advisors with a big input data set. To be precise, when I run the optimization for the MACD Sample expert advisor with the Inputs shown on the first page of the file attached screens.doc, I get the following message on the Journal tab of the Tester window as it can be shown on the second page of the same file, screens.doc:

"MACD Sample: optimization stopped, 993 cache records used, 973 cache records rejected. "

What does this message really mean? Does anybody know? What records that this sentence mean? What does it mean that some of them are rejected?

To continue with, after running the optimization process with the input data set shown on the first page of the file attached screens.doc, I can read three numbers below on the Setings tab of the Tester window, one of which i understand. However, I would like to know the meaning of the other two numbers:

1088 / 1280 (15991)

What do those numbers mean? As far as i know, the third number, that is to say, 15991 is the size of the input data set for the optimization process calculated as: (80000-50)/5 + 1 . However, I do not know what the numbers 1088 and 1280 mean and where they come from. Could please anybody explain that to me?

To end with, I would like to know why in this case shown on the third page of the file attached screens.doc, according to the Optimization Results tab of the Tester window it seems that the expert advisor is run just for a few of the data inputs from the whole input data set, to be precise, 115 data inpunts. However, I think the Optmization Results tab should include 15991 results since that is the size of the whole input data set according to the inputs tab shown in the first page of the file screens.doc

I look forward to seeing your reply as soon as possible.

Thanks a lot in advance

 

This is from the journal:

568 2007.06.22 14:20 close at stop 221 0.10 1.3459 1. 3459 1. 3349 -59. 62 9506. 03
569 2007.06.22 14:20 close at stop 219 0.10 1.3459 1. 3459 1. 3349 -59. 62 9446. 41

and this is from the user guide:

Testing Results

......

Results

........

  • Type — type of the operation (sell, buy, s/l, t/p, modify, close at stop, etc.);

What is the meaning of "close at stop"? What is the difference between "close at stop" and "s/l"? Is "close at stop" a margin call? Thanks for any help.

 

All positions closed forcedly when tester stopped. It is "close at stop"

 
stringo:

All positions closed forcedly when tester stopped. It is "close at stop"

Hi stringo,

Thank you for your reply. I took a deep look into my EA.

It outputs hundreds of OrderSend 130 erros, starting from one exact point in time.

I picked the date and time the EA stops trading and ran it in visual mode until the problem occurs.

The code is extremely simple. It inexplicably deletes a pending order and that causes the EA to send new SELL STOP orders to replace the deleted order, falling into the STOPS TOO TIGHT condition.

There is only 1 point in the code where the DeletePending function is called and there is only 1 condition in which this point is reached. It runs fine through this point 3 or 4 times. Then suddenly the problem occurs. There is no market special condition taking place.

There is no explanation in the code logic for operation #32 (delete pending) shown below.

1 2007.01.02 00:00 sell 1 0.10 1.3205 1.3266 1. 3156 0. 00 10000. 00
2 2007.01.02 00:00 buy stop 2 0.80 1.3215 1.3154 1. 3264 0. 00 10000. 00
3 2007.01.02 00:15 buy 2 0.80 1.3215 1.3154 1. 3264 0. 00 10000. 00
4 2007.01.02 00:15 sell stop 3 4.80 1.3205 1.3266 1. 3156 0. 00 10000. 00
5 2007.01.02 08:43 s/l 1 0.10 1.3266 1.3266 1. 3156 -61. 00 9939. 00
6 2007.01.02 08:43 t/p 2 0.80 1.3264 1.3154 1. 3264 392. 00 10331. 00
7 2007.01.02 08:43 delete 3 4.80 1.3205 1.3266 1. 3156 0. 00 10331. 00
8 2007.01.02 08:44 buy 4 0.10 1.3267 1.3206 1. 3316 0. 00 10331. 00
9 2007.01.02 08:44 sell stop 5 0.80 1.3257 1.3318 1. 3208 0. 00 10331. 00
10 2007.01.02 09:03 sell 5 0.80 1.3257 1.3318 1. 3208 0. 00 10331. 00
11 2007.01.02 09:03 buy stop 6 4.80 1.3267 1.3206 1. 3316 0. 00 10331. 00
12 2007.01.02 09:26 buy 6 4.80 1.3267 1.3206 1. 3316 0. 00 10331. 00
13 2007.01.03 16:01 s/l 4 0.10 1.3206 1.3206 1. 3316 -61. 66 10269. 34
14 2007.01.03 16:01 t/p 5 0.80 1.3208 1.3318 1. 3208 393. 84 10663. 18
15 2007.01.03 16:01 s/l 6 4.80 1.3206 1.3206 1. 3316 -2959. 68 7703. 50
16 2007.01.03 16:01 sell 7 0.10 1.3206 1.3267 1. 3157 0. 00 7703. 50
17 2007.01.03 16:01 buy stop 8 0.80 1.3216 1.3155 1. 3265 0. 00 7703. 50
18 2007.01.03 18:24 t/p 7 0.10 1.3157 1.3267 1. 3157 49. 00 7752. 50
19 2007.01.03 18:24 delete 8 0.80 1.3216 1.3155 1. 3265 0. 00 7752. 50
20 2007.01.03 18:24 buy 9 0.10 1.3155 1.3094 1. 3204 0. 00 7752. 50
21 2007.01.03 18:24 sell stop 10 0.80 1.3145 1.3206 1. 3096 0. 00 7752. 50
22 2007.01.04 09:14 sell 10 0.80 1.3145 1.3206 1. 3096 0. 00 7752. 50
23 2007.01.04 09:14 buy stop 11 4.80 1.3155 1.3094 1. 3204 0. 00 7752. 50
24 2007.01.04 09:18 buy 11 4.80 1.3155 1.3094 1. 3204 0. 00 7752. 50
25 2007.01.04 11:50 s/l 9 0.10 1.3094 1.3094 1. 3204 -62. 98 7689. 52
26 2007.01.04 11:50 t/p 10 0.80 1.3096 1.3206 1. 3096 392. 00 8081. 52
27 2007.01.04 11:50 s/l 11 4.80 1.3094 1.3094 1. 3204 -2928. 00 5153. 52
28 2007.01.04 11:50 sell 12 0.10 1.3094 1.3155 1. 3045 0. 00 5153. 52
29 2007.01.04 11:50 buy stop 13 0.80 1.3104 1.3043 1. 3153 0. 00 5153. 52
30 2007.01.04 12:21 buy 13 0.80 1.3104 1.3043 1. 3153 0. 00 5153. 52
31 2007.01.04 12:21 sell stop 14 4.80 1.3094 1.3155 1. 3045 0. 00 5153. 52
32 2007.01.04 15:13 delete 14 4.80 1.3094 1.3155 1. 3045 0. 00 5153. 52
33 2007.01.04 15:13 close at stop 13 0.80 1.3094 1. 3043 1. 3153 -80. 00 5073. 52
34 2007.01.04 15:13 close at stop 12 0.10 1.3096 1. 3155 1. 3045 -2. 00 5071. 52

The code for the DeletePending function being called is:

if (OrdersTotal()==1)
{
OrderSelect(0,SELECT_BY_POS, MODE_TRADES);
if (OrderType()==OP_BUY)
{
BuyPrice=OrderOpenPrice();
SellPrice=NormalizeDouble(BuyPrice-BandW*Point, Digits);
Lots=Mult1*LotsIni;
SendSellStop();
}
if (OrderType()==OP_SELL)
{
SellPrice=OrderOpenPrice();
BuyPrice=NormalizeDouble(SellPrice+BandW*Point, Digits);
Lots=Mult1*LotsIni;
SendBuyStop();
}
if (OrderType()==OP_BUYSTOP||OrderType()==OP_SELLSTOP)DeletePending();
}

Since OrdersTotal for the time the EA stops trading is 3, the DeletePending clause should never have been met.

I see no other explanation than a bug in MT4 platform.

I have upload the full source code to my profile.

Thank you for your support.

 
Pendings can be deleted also by tester because free margin is over. See tester log.
 
Hi,

How will we be able to monitor how our EA is doing relative to the others and view the graphs during the championship?
 
driesvt:
Hi,

How will we be able to monitor how our EA is doing relative to the others and view the graphs during the championship?

Hi! As soon as the Championship starts, you will see your and others' progress in the Participants section of the Championship website. You will be able to see the charts and all other info if you are registered at the Championship. You will also be able to see details in your own Profile and in other Participants' Profiles.
Best regards,
 

I wonder why this statement is reported - because the EA and Indicator works fine in my Strategy Tester.

The verification of your Expert Advisor is complete. Expert Advisor checking report:
-----------------------
2007.09.21 01:37 loading
compilation 'indicatorstdrpr.mq4'
compilation 'fs_v2.3.mq4'
fs_v2.3 on EURJPY:60
0 kb of log files (must be less than 64 000 kb)
there are no trading operations
0 min 16 seconds
Errors: 1

Could somebody please give me a hint how to solve this problem.
THX Ines
 
Ines:

fs_v2.3 on EURJPY:60
0 kb of log files (must be less than 64 000 kb)
there are no trading operations
Probably your EA is not for EURJPY with hourly timeframe?
Reason: