MACD and different time frames.

Created at 10 Dec 2016, 19:14
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!
kdcp999's avatar

kdcp999

Joined 09.10.2016

MACD and different time frames.
10 Dec 2016, 19:14


I am trying ti figureout how to initialise multipl MACDCrossover Indicators for differen timeframes?

Because the MacdCrossover indicator takes a DataSeries which doesn't seem to be created based on any given time frame how do you acheive this?
 

      DataSeries _data_series = Robot.CreateDataSeries();
   
       MacdCrossOver_indicator = Robot.Indicators.MacdCrossOver(
         _data_series,
         LongCyclePeriod,
         ShortCyclePeriod,
         SignalPeriod
      )
       

//no time frame indication here.




How does the MACDCrossover know that you want  a 4hour macdcrossover indictor as apoosed to a 2 hour MacdCrossover indicator?

Any help would be muchaprreciated.

David


@kdcp999
Replies

firemyst
04 Sep 2020, 09:37

RE:

kdcp999 said:

I am trying ti figureout how to initialise multipl MACDCrossover Indicators for differen timeframes?

Because the MacdCrossover indicator takes a DataSeries which doesn't seem to be created based on any given time frame how do you acheive this?
 

      DataSeries _data_series = Robot.CreateDataSeries();
   
       MacdCrossOver_indicator = Robot.Indicators.MacdCrossOver(
         _data_series,
         LongCyclePeriod,
         ShortCyclePeriod,
         SignalPeriod
      )
       

//no time frame indication here.




How does the MACDCrossover know that you want  a 4hour macdcrossover indictor as apoosed to a 2 hour MacdCrossover indicator?

Any help would be muchaprreciated.

David

It knows based on the data series you pass into it.

Instead of creating a data series, you need to pass it one.

Example:

MarketData.GetBars(Bars.TimeFrame, Symbol.Name).ClosePrices

 


@firemyst