Finding last value from multiple IndicatorDataSeries

Created at 25 Apr 2014, 20:31
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!
DE

deejbee

Joined 10.04.2014

Finding last value from multiple IndicatorDataSeries
25 Apr 2014, 20:31


Hi,  I'm trying to find if a value exists in either one of an Up or Down IndicatorDataSeries provided by an Indicator from within a bot.

The Up an Down both have a different Count but I can't see how they correlate to time when looking at LastValue within OnTick().

Put another way, I'd like to see if Up has a value or Down has a value in OnTick()

Thanks

 

 

 

 


@deejbee
Replies

Spotware
28 Apr 2014, 10:45

You can retrieve the corresponding time by passing the same index to the Last method of OpenTime collection:

            var marketSeries = MarketData.GetSeries(Symbol, TimeFrame.Minute3);

            var close = marketSeries.Close.Last(0);
            var time = marketSeries.OpenTime.Last(0);

 


@Spotware