Strategy Tester Custom Start

Back to topics list To post a new topic, please log in or register
avatar
1
mj023 2016.06.10 07:59
 

Hi everyone,

I would like to know if it is possible to set strategy tester to always start testing on the last completed bar on the chart, like Daily period if we choose today date to start. I need it especially for 5 and 15 min time frame. I have already try to set max bars in the chart to 1 or 2 in chart options, but strategy tester doesn't work then,it's probably too less bars to test I guess. Please let me know if there is any EA or script or any other way to do that. If there is no way to do that maybe there is a way to set custom start date like 04.05.2016 17:45 min. I would really appreciate any ideas.

avatar
1215
FMIC 2016.06.10 09:32 #
 
mj023:

Hi everyone,

I would like to know if it is possible to set strategy tester to always start testing on the last completed bar on the chart, like Daily period if we choose today date to start. I need it especially for 5 and 15 min time frame. I have already try to set max bars in the chart to 1 or 2 in chart options, but strategy tester doesn't work then,it's probably too less bars to test I guess. Please let me know if there is any EA or script or any other way to do that. If there is no way to do that maybe there is a way to set custom start date like 04.05.2016 17:45 min. I would really appreciate any ideas.

In the Strategy Tester, you cannot specify the starting bar, only the Starting Date (thus it will always start on the first bar of that day).

However, you can just place a very simple condition in your "OnTick()" event so that it only starts processing after a certain start date/time like so:

#property strict

input datetime dtStartTesting = D'2016.05.04 17:45';

void OnTick()
{
   if( TimeCurrent() < dtStartTesting ) return;

   // Rest of code ...
   
}
Back to topics list  

To add comments, please log in or register