get a range from MarketData series

Created at 21 Sep 2015, 02:04
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

deansi

Joined 30.10.2014

get a range from MarketData series
21 Sep 2015, 02:04


Im trying to get a specific range only of MarketData low series for example, and find the lowest low of that range. 

I know I can use a for loop, but just wondering if there is a more compact way to code it. this is what Ive tried just to get a list and ignore the most recent bar. It gets an error on the "GetRange" call because that doesnt work on "DataSeries" type, and off course the DataSeries is read only So I cant just trim the original series.  Ive tried a method just to copy to a list, and to copy to an array, both of which I get a compile error.

            var listOrig = MarketData.GetSeries(TimeFrame);
            var listOrigLow = listOrig.Low;
            List <double> listNew = listOrigLow.GetRange(0, listOrigLow.Count -2);

Anyone have a more simple way than making a for loop, and also how is a DataSeries different than an array or list,


@deansi
Replies

Spotware
21 Sep 2015, 03:17

Dear Trader,

Currently there isn’t any simpler way than making a loop. It is in our plans to provide more methods to make the usage of cAlgo.API even easier in the future. Stay tuned.


@Spotware

deansi
21 Sep 2015, 12:08

If I can recommend, what would be good for programmers and calgo servers would be the possible option to get a specific range of bars directly from the server and maybe to be able to specify only open, close, vol, bar time etc. this makes looking back through recent history concise, and also save download data overheads for your servers.

I know right now you get +1000 bars of data if you access MarketData, and all the O,H,L,C,V, times of all those 1000+ bars, not so efficient.


@deansi

Spotware
21 Sep 2015, 22:18

Dear Trader,

Thank you for your suggestion. We will consider it. Additionally you can post your ideas/suggestions to http://vote.spotware.com/


@Spotware