Load more bars for different data series.

Created at 27 Jun 2016, 10:29
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!
CT

ctid231346

Joined 21.06.2016

Load more bars for different data series.
27 Jun 2016, 10:29


Hello,

How can I load more bars for different data series and endure that cTrader will maintain them.

Here is a code that counts the bars available:

using System;
using System.Text;
using cAlgo.API;

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class CountData : Robot
    {
        string[] symbolsList = 
        {
            "EURUSD",
            "USDCHF",
            "GBPUSD",
            "USDJPY",
            "AUDUSD",
            "USDCAD",
            "NZDUSD"
        };

        TimeFrame[] timeFrames = 
        {
            TimeFrame.Minute,
            TimeFrame.Minute5,
            TimeFrame.Minute15,
            TimeFrame.Minute30,
            TimeFrame.Hour,
            TimeFrame.Hour4,
            TimeFrame.Daily
        };

        protected override void OnStart()
        {
            for (var s = 0; s < symbolsList.Length; s++)
            {
                var sb = new StringBuilder();
                var symbol = symbolsList[s];
                sb.Append(symbol + " ");
                for (var t = 0; t < timeFrames.Length; t++)
                {
                    var timeFrame = timeFrames[t];
                    var data = MarketData.GetSeries(symbol, timeFrames[t]);
                    sb.Append(", " + timeFrame + ": " + data.Close.Count);
                }
                Print(sb.ToString());
            }
        }
    }
}

The results are:

I want to load 20 000 bars for every symbol / period. I added the symbols in the Watch list and also opened a chart for each symbol. I also loaded more bars with pressing the Home key for every chart. cTrader loads the bars, but later they disappear.

 

 


@ctid231346