On tick in tester not covering a full day

 

I have a very simple EA which just outputs an alert each ontick or each ontimer event, with the 2 stochastic values.

int OnInit()
  {
   EventSetTimer(1);
  }

void OnTick()
  {
   Alert("Tick ",Hour(),":",
Minute(),"  ",iStochastic(NULL,0,5,3,3,0,0,0,0),",",iStochastic(NULL,0,5,3,3,0,0,1,0));  
  }

void OnTimer()
  {
   Alert("Timer ",chour,":",cmin,"  ",iStochastic(NULL,0,5,3,3,0,0,0,0),",",iStochastic(NULL,0,5,3,3,0,0,1,0));   
  }

When I run this in tester for a single day at M15, I find I get a group of alerts at some random time, then the next group is at 23:55 or thereabouts, followed by multiple alerts per minute up to 23:59. On different runs the random time has been 3:13, 10:39 and 23:29.

How can I run the simulation so that I get all the ticks ?

My attempts to use onTimer with period 1 second returns no alerts at all

When I turned on visualisation, I got multiple ticks per minute starting from 0:01, which is what I want, but the visualisation process is very slow and took several minutes to get to 0:45. Simulating several months would take hours or even days.




BTW the purpose of this exercise was the disparity between the stochastics values returned by the iStochatisc function compared to the chart.


Thanks


Kymberley

 

Does OnTimer work in the strategy tester?

You are creating so many alerts that the journal window can't keep up

Open the actual log and you will probably see all that is missing from the journal window. 

 

Thanks GumRai

I looked at the examples again and see they used Print, rather than Alert to see what is happening.

After changing top Print, I now see the whole day.

On the values bit, I see that there can be multiple ticks per minute, so when we get these values they may not match the chart/data window value for that time.

Does that make sense?

 
Look at the actual log (right click on journal)
 

When I looked at downloading in the history centre, I was informed the download was from the developers data, which may be different than the trader's. Would this explain the difference?

If I look at stochastics on the chart at 2:00 on 12 th May, the values were 35.8 and 29.7


In the log, there are 72 values with a time of 2:00. The highest of these 72 values is 33.1 and 28.8, both lower than the values from the chart 

0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  5.306122448973674,19.5193849897665
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Alert: Trading starts 2:00
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Alert: ADX SELL on Trend 32.50335014410466, Buyer 11.25747438493466, Seller 29.97292741492116
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  26.12244897958675,26.45816049997086
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  27.75510204081291,27.00237818704625
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  30.20408163264761,27.81870471765781
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  32.24489795918256,28.4989768265028
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  32.65306122448683,28.63503124827089
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  32.24489795918256,28.4989768265028
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  32.65306122448683,28.63503124827089
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  32.24489795918256,28.4989768265028
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  32.65306122448683,28.63503124827089
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  33.06122448979111,28.77108567003898
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  32.65306122448683,28.63503124827089
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  33.06122448979111,28.77108567003898
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  32.65306122448683,28.63503124827089
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  33.06122448979111,28.77108567003898
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  32.65306122448683,28.63503124827089
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  32.24489795918256,28.4989768265028
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  31.83673469387376,28.3629224047332
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  31.42857142856948,28.2268679829651
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  31.02040816326068,28.09081356119551
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  30.61224489795641,27.95475913942741
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  30.20408163264761,27.81870471765781
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  29.79591836734333,27.68265029588973
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  29.38775510203906,27.54659587412163
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  29.79591836734333,27.68265029588973
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  29.38775510203906,27.54659587412163
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  29.79591836734333,27.68265029588973
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  29.38775510203906,27.54659587412163
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  29.79591836734333,27.68265029588973
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  30.20408163264761,27.81870471765781
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  29.79591836734333,27.68265029588973
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  30.20408163264761,27.81870471765781
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  29.79591836734333,27.68265029588973
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  30.20408163264761,27.81870471765781
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  29.79591836734333,27.68265029588973
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  29.38775510203906,27.54659587412163
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  28.97959183673026,27.41054145235203
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  28.57142857142598,27.27448703058394
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  28.16326530611718,27.13843260881434
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  27.75510204081291,27.00237818704625
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  27.34693877550863,26.86632376527816
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  26.93877551019983,26.73026934350855
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  26.53061224489556,26.59421492174046
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  26.12244897958675,26.45816049997086
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  26.53061224489556,26.59421492174046
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  26.12244897958675,26.45816049997086
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  26.93877551019983,26.73026934350855
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  26.53061224489556,26.59421492174046
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  26.93877551019983,26.73026934350855
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  27.34693877550863,26.86632376527816
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  26.93877551019983,26.73026934350855
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  27.75510204081291,27.00237818704625
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  27.34693877550863,26.86632376527816
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  27.75510204081291,27.00237818704625
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  27.34693877550863,26.86632376527816
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  27.75510204081291,27.00237818704625
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  27.34693877550863,26.86632376527816
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  27.75510204081291,27.00237818704625
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  27.34693877550863,26.86632376527816
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  27.75510204081291,27.00237818704625
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  26.93877551019983,26.73026934350855
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  27.34693877550863,26.86632376527816
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  26.93877551019983,26.73026934350855
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  27.34693877550863,26.86632376527816
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  26.93877551019983,26.73026934350855
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  27.34693877550863,26.86632376527816
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  26.93877551019983,26.73026934350855
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  27.34693877550863,26.86632376527816
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  27.75510204081291,27.00237818704625
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  28.16326530611718,27.13843260881434
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  28.57142857142598,27.27448703058394
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  28.97959183673026,27.41054145235203
0    18:23:06    2015.05.12 02:00  Strategy 4 AUDUSD,M15: Tick 2:0  29.38775510203906,27.54659587412163
0    18:23:06    2015.05.12 02:01  Strategy 4 AUDUSD,M15: Tick 2:1  26.93877551019983,26.73026934350855

 
The value on the chart is at candle close, you are showing values just after the candle opened.
 

So the 2:00 value at M15  is actually at 2:14:59?

I checked the log and that actually matches.

Thanks for the explanation, now it makes sense.