Replies

march.tim
27 Mar 2016, 10:11

OK... I did some more digging and came across this thread /forum/indicator-support/2759.

I've implemented the same timing code in the indicator and measured it's performance on a call-by-call basis. It looks like it's the same issue and the MarketData.GetSeries call takes anywhere up to 6.7 seconds to complete for each time frame. The quickest calls I've observed are around 1.5 seconds.

 

                // Get market data for each timeframe for the symbol...
                series = new MarketSeries[4];
                for (int i = 0; i < 4; i++)
                {
                    var start = DateTime.Now;
                    series[i] = MarketData.GetSeries(sym, tf[i]);
                    var end = DateTime.Now;
                    Print((end - start).TotalMilliseconds + "\t" + sym + "\t" + tf[i]);
                }

There's a quote in the thread above from SpotWare saying "Because of technical reasons GetSeries returns value when next tick comes to the platform. We plan to change this behavior in the future." I'm currently testing in off-market conditions, perhaps we'll see better performance when all the markets are open during the week.

Does anyone know if there's a way to limit the number of bars MarketData.GetSeries returns to speed it up? For example, if the longest SMA I'm trying to calculate is 100 bars, could I only retrieve that many from the server somehow?


@march.tim