Different data series

Created at 16 Oct 2014, 13:50
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!
TA

TAlgo

Joined 16.10.2014

Different data series
16 Oct 2014, 13:50


Hello,

I would like to use 2 different dataseries in cBot.

I'll explain: I would like to calculate 2 different EMA of 2 different time frames of the same symbol. So, when the cBot starts on the 1H TimeFrame, I can log the a certain ema in 15min timeframe.

Who can help me with that?

 

Thanks!


@TAlgo
Replies

Spotware
16 Oct 2014, 14:10

You can obtain market series for specific timeframe using MarketData.GetSeries method:

var marketSeries = MarketData.GetSeries(TimeFrame.Hour);

Then you can create EMA over series from marketSeries: 

var ems = Indicators.ExponentialMovingAverage(marketSeries.Close, 14);

 


@Spotware

TAlgo
16 Oct 2014, 14:14

RE:

Spotware said:

You can obtain market series for specific timeframe using MarketData.GetSeries method:

var marketSeries = MarketData.GetSeries(TimeFrame.Hour);

Than you can create EMA over series from marketSeries: 

var ems = Indicators.ExponentialMovingAverage(marketSeries.Close, 14);

 

Yeah, Got IT!

I was missing the ".Close" at the end of the statement.

Thank you!


@TAlgo