Custom MarketSeries

Created at 20 Sep 2015, 04:00
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!
Jiri's avatar

Jiri

Joined 31.08.2015

Custom MarketSeries
20 Sep 2015, 04:00


Hi,

How do one make custom MarketSeries for MovingAverage? Something like that:

 protected override void Initialize()
        {
            double hl2 = (MarketSeries.High + MarketSeries.Low) /  2;
            sma = Indicators.MovingAverage(hl2, length, type);
        }

Thanks in advance.


@Jiri
Replies

ClickAlgo
20 Sep 2015, 18:47

hello are you asking for a MovingAverage indicator with a custom MarketSeries Timeframe?


@ClickAlgo

Jiri
20 Sep 2015, 18:51

No, I would just like to feed MovingAverage indicator with different source, let's say (High+Low)/2 for example.


@Jiri

ClickAlgo
20 Sep 2015, 20:47

Your 1st argument needs to be a DataSource type object and not a double, the DataSource is read only and you cannot modify it.

DataSource represents a read only list of values, typically used to represent market price series. The values are accessed with an array-like [] operator.

/api/reference/dataseries

Sorry I cannot help more. :-)


@ClickAlgo

Jiri
20 Sep 2015, 20:48

Solved. Thanks for replies. ;)


@Jiri

JXTA
15 Oct 2023, 09:40 ( Updated at: 16 Oct 2023, 04:03 )

RE: Custom MarketSeries

Jiri said: 

Solved. Thanks for replies. ;)

Hi, would you mind sharing how did you solved this?


@JXTA