This forum is in read-only mode now. You may discuss your questions on forums of MQL4.community and MQL5.community

seemed the start() function not triggered correcttly


Back to topics list
avatar
14
qiuyg 2005.07.19 14:24 
i write a simple expert adviser "testTigger",like this

//+------------------------------------------------------------------+
//|                                                  testTrigger.mq4 |
//|                                                            qiuyg |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "qiuyg"
#property link      ""

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//---- 
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//---- 
    Print(TimeToStr(CurTime()));
//----
   return(0);
  }
//+------------------------------------------------------------------+ 




then i test it on eur/usd 15min period,i found a problem from log:

18:16:38 testTrigger started for testing
18:16:38 1999.11.02 01:14  testTrigger: 1999.11.02 01:14
18:16:38 1999.11.02 01:29  testTrigger: 1999.11.02 01:29
18:16:38 1999.11.02 01:44  testTrigger: 1999.11.02 01:44
18:16:38 1999.11.02 01:59  testTrigger: 1999.11.02 01:59
18:16:38 1999.11.02 02:14  testTrigger: 1999.11.02 02:14
18:16:38 1999.11.02 02:29  testTrigger: 1999.11.02 02:29
18:16:38 1999.11.02 02:44  testTrigger: 1999.11.02 02:44
18:16:38 1999.11.02 02:59  testTrigger: 1999.11.02 02:59
18:16:38 1999.11.02 03:14  testTrigger: 1999.11.02 03:14
18:16:38 1999.11.02 03:29  testTrigger: 1999.11.02 03:29
18:16:38 1999.11.02 03:44  testTrigger: 1999.11.02 03:44
18:16:38 1999.11.02 03:59  testTrigger: 1999.11.02 03:59
18:16:38 1999.11.02 04:14  testTrigger: 1999.11.02 04:14
18:16:38 1999.11.02 04:29  testTrigger: 1999.11.02 04:29
18:16:38 1999.11.02 04:44  testTrigger: 1999.11.02 04:44
18:16:38 1999.11.02 04:59  testTrigger: 1999.11.02 04:59
18:16:38 1999.11.02 05:14  testTrigger: 1999.11.02 05:14
18:16:38 1999.11.02 05:29  testTrigger: 1999.11.02 05:29
18:16:38 1999.11.02 05:44  testTrigger: 1999.11.02 05:44



why the start() function always triggered at the lastest minute of every 15min period(as 14,29,44,59),i think the start() function must be triggered at least twice if the open<>close, am i right ?

avatar
4464
Slawa 2005.07.19 14:59 
uncheck "use date", check "recalculate" and try again
avatar
4464
Slawa 2005.07.19 16:37 
we've updated article "Strategy Tester: Modes of Modeling during Testing"
see "Using the Range of Dates When Modeling." section
avatar
14
qiuyg 2005.07.19 17:39 
uncheck "use date", check "recalculate" and try again

hi,Slawa
i just tried,but get the same result...
avatar
4464
Slawa 2005.07.19 18:01 
open offline generated file, increase scale, select "candlesticks" mode and see bars evolution.
there may be also if suspected bars have volume 1. check it please.
avatar
14
qiuyg 2005.07.19 18:21 
see from the log , the result become right from 2003.09.05 03:15

21:51:07 2003.09.05 02:29  testTigger: 2003.09.05 02:29
21:51:07 2003.09.05 02:44  testTigger: 2003.09.05 02:44
21:51:07 2003.09.05 02:59  testTigger: 2003.09.05 02:59
21:51:07 2003.09.05 03:14  testTigger: 2003.09.05 03:14
21:51:07 2003.09.05 03:15  testTigger: 2003.09.05 03:15
21:51:07 2003.09.05 03:21  testTigger: 2003.09.05 03:21
21:51:07 2003.09.05 03:23  testTigger: 2003.09.05 03:23
21:51:07 2003.09.05 03:25  testTigger: 2003.09.05 03:25
21:51:07 2003.09.05 03:27  testTigger: 2003.09.05 03:27
21:51:07 2003.09.05 03:28  testTigger: 2003.09.05 03:28


by the way,my eur/usd 15min history data is begin from "1999.11.01 00:00", 1min history data is begin from "2005.07.14 05:31" and 5min history data is begin from "2005.04.28 23:55".

avatar
14
qiuyg 2005.07.19 18:30 
open offline generated file, increase scale, select "candlesticks" mode and see bars evolution.
there may be also if suspected bars have volume 1. check it please.

haha,u are right!

2003.09.05,01:30,1.0939,1.0949,1.0938,1.0945,1
2003.09.05,01:45,1.0939,1.0946,1.0936,1.0945,1
2003.09.05,02:00,1.0934,1.0942,1.0933,1.0940,1
2003.09.05,02:15,1.0933,1.0942,1.0930,1.0935,1
2003.09.05,02:30,1.0929,1.0937,1.0926,1.0935,1
2003.09.05,02:45,1.0927,1.0939,1.0924,1.0936,1
2003.09.05,03:00,1.0931,1.0944,1.0928,1.0934,1
2003.09.05,03:15,1.0933,1.0938,1.0933,1.0934,33
2003.09.05,03:30,1.0934,1.0941,1.0933,1.0941,23
2003.09.05,03:45,1.0940,1.0944,1.0940,1.0941,24
2003.09.05,04:00,1.0940,1.0947,1.0940,1.0947,19
2003.09.05,04:15,1.0947,1.0948,1.0941,1.0948,34


log become right just from 2003.09.05,03:15 when the volume become right.

avatar
14
qiuyg 2005.07.19 18:58 
i change volume from 1 to 5,everything be ok.
thx Slawa.
Back to topics list  
Download MetaTrader 5 (450 Kb, web installer) — a new terminal for financial markets