Page 1 of 1

Bactest multiple timeframe

Posted: Sat Dec 21, 2013 3:26 pm
by ea.maxpro.vn
Hi all,

I want to backtest Multiple timeframe with tickdata.
My EA for backtest tries to get RSI on M5, M15 and M30 at a time.
It's ok for value of RSI M5. But result is 0 for all RSI of other timeframe M15 and M30.
I already exported data of M5, M15 and M30 to Mt4.

Please support! Thanks!

Re: Bactest multiple timeframe

Posted: Fri Jan 03, 2014 12:15 am
by tickstory
Hi Ea.maxpro.vn,

We have tried the following code and it works fine:

Code: Select all

   double rsi5;
   double rsi15;
   double rsi60;
   rsi5 = iRSI(NULL,5,14,PRICE_CLOSE,0);
   rsi15 = iRSI(NULL,15,14,PRICE_CLOSE,0);
   rsi60 = iRSI(NULL,60,14,PRICE_CLOSE,0);
   Print("RSI 5m: " + DoubleToStr(rsi5, 4) + ", RSI 15m: " + DoubleToStr(rsi15, 4) + ", RSI 60m: " + DoubleToStr(rsi60, 4));
Regards.

Re: Bactest multiple timeframe

Posted: Thu Jan 09, 2014 3:26 am
by ea.maxpro.vn
Thanks!

It works for me now!

Re: Bactest multiple timeframe

Posted: Tue Feb 11, 2014 9:55 pm
by experienced_tester
Hi

In what way should we use that code?
Should it be inserted into the EA code?
Thanks a lot.

Re: Bactest multiple timeframe

Posted: Tue Feb 11, 2014 10:13 pm
by tickstory
Hi Experienced_tester,

Put the code into the main start() block of your EA.

Thanks.