Issue with multi-timeframe

Created at 28 Jan 2014, 17:41
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
Cerunnos's avatar

Cerunnos

Joined 27.06.2013

Issue with multi-timeframe
28 Jan 2014, 17:41


Hi Guys. I would like to extend my robot with a simple multi-timeframe condition. If all conditions are met in 1H-timeframe and in the lower timeframes m30, m15 and m5 a bullish bar is displayed , then my robot should enter a long position. Can anyone help me with experience in multi-timeframe-coding?


         ...
         ...
         timeframe_m30 = MarketData.GetSeries(_m30);
         timeframe_m15 = MarketData.GetSeries(_m15);
         timeframe_m5 = MarketData.GetSeries(_m5);    
            
         ...
         ...                                      
                           
            if(timeframe_m30.Close.LastValue > timeframe_m30.Open.LastValue)
                _m30_bullish = true;
            else
                _m30_baerish = false;
            
            if(timeframe_m15.Close.LastValue > timeframe_m15.Open.LastValue)
                _m15_bullish = true;
            else
                _m15_baerish = false;
            
            if(timeframe_m5.Close.LastValue > timeframe_m5.Open.LastValue)
                _m5_bullish = true;
            else
                _m5_baerish = false;
                
            if(_m30_bullish && _m15_bullish && _m5_bullish && ...)
               Print("Go LONG!");
            ...

            else if(_m30_baerish && _m15_baerish && _m30_baerish && ...)
               Print("Go Short!");
            ...

 


@Cerunnos
Replies

David
18 Feb 2014, 00:02

RE:

Hello Cerunnos,

Did you get the problem resolved? And if so, would you mind sharing your solution to the problem? Thank you. - David

Cerunnos said:

Hi Guys. I would like to extend my robot with a simple multi-timeframe condition. If all conditions are met in 1H-timeframe and in the lower timeframes m30, m15 and m5 a bullish bar is displayed , then my robot should enter a long position. Can anyone help me with experience in multi-timeframe-coding?



@David

emeeder
11 Oct 2014, 06:31

I am assuming you have resolved this issue somehow.

There are quite a few threads on here that show how to add multi Time frame to a Cbot.

MY question is:

How can anyone successfully back test such a cbot??

If robot is run in 5 min timeframe. I think the indicators used in the robot that run in a higher time frame ie 1HR. I think these show the same result for the complete hour. And then update at the close of every 1Hr bar. Is this correct??

I think that is why I get terrible results when trying to backtest multi-timeframe robots.

Have you had any luck?