Cast to List<DateTime> MarketSeries.OpenTime

Created at 04 Nov 2013, 17: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!
adaled's avatar

adaled

Joined 17.09.2012

Cast to List<DateTime> MarketSeries.OpenTime
04 Nov 2013, 17:34


Hello,

I would like to apply List methods, like FindIndex, to the MarketSeries.OpenTime for example. Is it possible?

I tried to do a cast and it didn't work.

Thanks.


@adaled
Replies

adaled
04 Nov 2013, 17:40

RE:

adaled said:

Hello,

I would like to apply List methods, like FindIndex, to the MarketSeries.OpenTime for example. Is it possible?

I tried to do a cast and it didn't work.

Thanks.

Sorry, I meant IEnumerable like this:

  var openTimes = new List<DateTime>((IEnumerable<DateTime>) series.OpenTime);

 


@adaled

atrader
07 Nov 2013, 17:44

You can index any series so you can use a classic for statement to loop through the elements and find an index. What other methods do you need?


@atrader