public void LoadHistoricalChartData(object chartIdentifier, DateTime startDate, DateTime endDate)
        {
            ChartIdentifier = chartIdentifier;
            StartDate       = startDate;
            EndDate         = endDate;

            Market market = chartIdentifier as Market;

            ezDateRange dateRangeRequested = new ezDateRange();
            ezDateRange dateRangeProcessed = new ezDateRange();

            // Start with an empty set of TradeBars.
            chartData.TradeBars.Clear();

            // Load the data for the selected market.
            BarInterval     interval     = new BarInterval(APIConvert.ToChartInterval(BarInterval.Interval), BarInterval.Period);
            ChartDataSeries ctsChartData = new ChartDataSeries(market, interval, SessionTimeRange.Empty);

            var session = new ezSessionTimeRange();

            /*EZChartDataSeries myChartData = new EZChartDataSeries(market.Description, BarInterval, session);
             * myChartData.DataLoadComplete += myChartData_DataLoadComplete;
             * myChartData.DataSeriesUpdated += myChartData_DataSeriesUpdated;*/

            var chartThread = new ChartDataThread(ctsChartData, chartData, startDate, endDate);

            var thread = new Thread(new ThreadStart(chartThread.Run));

            thread.Name = market.Description + ":" + BarInterval;
            thread.Start();


            //if (DataLoadComplete != null) DataLoadComplete(this, new ezDataLoadCompleteEventArgs(zDataLoadStatus.Success, dateRangeRequested, dateRangeProcessed));
        }
        public ChartDataProviderCTS(string chartName, ezBarInterval barInterval, ezSessionTimeRange session)
        {
            this.chartName = chartName;

            // If null has been passed as barInterval or session, then we will use default values for those.
            if (barInterval == null)
            {
                barInterval = new ezBarInterval(zChartInterval.Day, 1);
            }

            if (session == null)
            {
                session = new ezSessionTimeRange();
            }

            this.BarInterval = barInterval;
            this.Session     = session;

            // Create the EZChartDataSeries - this will be available via the ChartData property (but the caller
            // should subscribe to the events to know when the data has finished loading or updates occur).
            this.chartData = new EZChartDataSeries(chartName, barInterval, session);

            this.chartData.DataLoadComplete  += chartData_DataLoadComplete;
            this.chartData.DataSeriesUpdated += chartData_DataSeriesUpdated;
        }
        public ChartDataProviderYahoo(string chartName, ezBarInterval barInterval, ezSessionTimeRange session)
        {
            this.chartName = chartName;

            // If null has been passed as barInterval or session, then we will use default values for those.
            if (barInterval == null)
            {
                barInterval = new ezBarInterval(zChartInterval.Day, 1);
            }

            if (session == null)
            {
                session = new ezSessionTimeRange();
            }

            this.BarInterval = barInterval;
            this.Session     = session;

            // Create the EZChartDataSeries - this will be available via the ChartData property (but the caller
            // should subscribe to the events to know when the data has finished loading or updates occur).
            this.chartData = new EZChartDataSeries(chartName, barInterval, session);

            //var chartThread = new ChartDataThread(this, chartData, startDate, endDate);
            //var thread = new Thread(new ThreadStart(chartThread.Run));
            //thread.Name = chartName + ":" + barInterval;
            //thread.Start();
        }