How to use an OHLC4 as DataSeries for the source param of an indicator ( like EMA )

Created at 19 Sep 2018, 03:34
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!
TH

thriscio

Joined 03.01.2018

How to use an OHLC4 as DataSeries for the source param of an indicator ( like EMA )
19 Sep 2018, 03:34


Idea here is pretty simple.

I would like to set the source series of my EMA to an OLHC4 value other than the standard close ( MarketSeries.Close to kinda MarketSeries.OHLC4 )

 

    _exponentialMovingAverage = Indicators.ExponentialMovingAverage(MarketSeries.Close, PeriodEma);

 

I can't use also a custom indicator OHLC4 because the param type IndicatorsDataSeries does fit the DataSeries type

 

It must have a way to do this ?

 

Thanks

 

 

    

 


@thriscio
Replies

PanagiotisCharalampous
19 Sep 2018, 10:55

Hi thriscio,

You can set the source of an indicator to any source as long as it is a DataSeries type. IndicatorDataSeries type derives from DataSeries so you can use another indicator's result as an input to EMA.

Best Regards,

Panagiotis


@PanagiotisCharalampous