Strategy Tester - page 2

 
Rosiman:

I would like to make also backtesting having in results all hourly time frames but isn't yet clear for me.

I have inside my Expert the following code. How should I change it? Thank you.

As you already have an input parameter for Timeframe, the easiest solution is probably to replace "Period()" with Signal_NonLagMA_TimeFrameMA and then to optimize using this parameter.
 
wonderful. i got it now. thank you Angevoyageur
 

I think, this is wrong option to test.

For example, when you test one timeframe in one run, if the results have 5000 passes averagelly.

And when you test all timeframe in one run, if the results will be have 5000 passes averagelly.

So, there may be missed the profitable result when you test all timeframe in one run. Am I wrong?

 

Hi, 

I am having the following issue while optimization in MQL5. For the optimization settings, I have selected M5 as Period for Fast Generic Based Algorith with Complex Criterion Max with 1 minute OHLC modelling. 

For the Input Parameters, I have selected starting timeframe "current" and stop timeframe 15 Minutes.



In side the code, my default input parameter for ENUM_TIMEFRAMES is PERIOD_M15.

input ENUM_TIMEFRAMES inpIchimokuTF = PERIOD_M15;
input int   inpTenkanSen = 9; // TenkanSen
input int inpKijunSen = 26; // KijunSen
input int inpSenekuSpanB = 26; // SenekuSpanB   

For indicator data, i have used following code: 

if(inpUseIchimoku || inpTradeEntryCriteria == TRADE_OPEN_CRITERA_ICHIMOKU) {
        IchimokuIndicator = new CiIchimoku();
        if(!IchimokuIndicator.Create(_Symbol, inpIchimokuTF, inpTenkanSen, inpKijunSen, inpSenekuSpanB)) {
                PrintFormat("Failed to generate IchimokuIndicator handle. Error code %d",
                GetLastError());
                return (false);
        }        
        ResetLastError();
}

Because, i have selected M5 timeframe from the settings tab and choosen starting timeframe "current" to stop timeframe "15 minutes", optimization should be run, as per my understanding, from 5 Minutes to 15 minutes time frame. But, in reality optimization was run on 1 min time frame:

Any idea or solution would be highly appreciated, I would like this optimization to run from M5 to higher time frame.


Thnks in advace.

 

Look at this part:




This will optimize your code from PERIOD_CURRENT to PERIOD_M15, which corresponds to all timeframes between M1 and M15 (you can see in the right-bottom corner where it optimizes 10 times). To avoid this, just set the start column to the initial timeframe you want to optimize. If you want to supress any timeframes, create an ENUM inside your code where the values are exactly equal to the timeframes you wanna optimize. For example, if I wanted to optimize from M5 to M15 and skip M12 (which would be optimized with the original ENUM_TIMEFRAMES), I can just do like this:


enum ENUM_CUSTOM_TIMEFRAMES
{
        CUSTOM_M5=PERIOD_M5, // 5 minutes
        CUSTOM_M10=PERIOD_M10, // 10 minutes
        CUSTOM_M15=PERIOD_M15 // 15 minutes
};

 

And then specify ENUM_CUSTOM_TIMEFRAMES as the EA parameter instead of ENUM_TIMEFRAMES.

Also, in the strategy tester settings, always set the timeframe to M1. When optimizing in the M1 timeframe, the tester can build charts in any other timeframe specified in the EA inputs; however, if you set a different timeframe in the settings, you may face issues.

Take the example where you set the M5 timeframe in the tester settings, but define the M12 timeframe in the EA input. It isn't possible to create a 12 minute candle with 5 minute candles. On the other hand, if you set the settings to M1, it will be possible, considering you need 12 candles of 1 minute to create a 12 minute candle.

Reason: