Different result on different timeframe

 

Hello.

I made an EA for MT4 where I combine indicators for multiple timeframes (for example EMA for 1W period and RSI for 1D period). These timeframes are hardcoded in my source code, so it should not affect what timeframe I choose in tester. This is partially true, because when I choose timeframes from M1 to H4, the results are the same. But when I pick daily timeframe, the result for the test is different from the other tests.

I use tick data downloaded by Tickstory. I checked all timeframes when exporting the tick data to MT4 (from M1 to Weekly) and I launch MT4 from Tickstory. I do not use any optimization, spread in strategy tester is set on "current" and I am modeling every tick in strategy tester.

Where could be the problem?

 
Tycek:

Hello.

I made an EA for MT4 where I combine indicators for multiple timeframes (for example EMA for 1W period and RSI for 1D period). These timeframes are hardcoded in my source code, so it should not affect what timeframe I choose in tester. This is partially true, because when I choose timeframes from M1 to H4, the results are the same. But when I pick daily timeframe, the result for the test is different from the other tests.

I use tick data downloaded by Tickstory. I checked all timeframes when exporting the tick data to MT4 (from M1 to Weekly) and I launch MT4 from Tickstory. I do not use any optimization, spread in strategy tester is set on "current" and I am modeling every tick in strategy tester.

Where could be the problem?

please share the line that defines RSI and EMA.  for example, result = iRSI(_Symbol,....);

 
Kaleem Haider:

please share the line that defines RSI and EMA.  for example, result = iRSI(_Symbol,....);

double RSI = iRSI(NULL,PERIOD_D1,14,PRICE_CLOSE,1);
double ema = iMA(NULL,PERIOD_W1,10,0,MODE_EMA,PRICE_CLOSE,1);


 
Tycek:


there is nothing wrong with the code.  I may be due to the way you are running the strategy tester (tick vs. on close) or how stop loss or target profit work.  You may have to test it visually to see what is going on.

 
Kaleem Haider:

there is nothing wrong with the code.  I may be due to the way you are running the strategy tester (tick vs. on close) or how stop loss or target profit work.  You may have to test it visually to see what is going on.

I am running the tester the same way (every tick). When I run it visually it even opens different positions on daily and 4H timeframe with the same settings for opening the trade. It seems, like that the indicator data on different timeframes are different.
 
Never trust strategy tester and ALWAYS ALWAYS you will have different results on different timeframes and brokers, no matter what you are doing. This is why strategies must be made more resilient. In live trading everything might look different but if you backtest you will have different results. Learning/Knowing this lesson is essential
Reason: