public override BindingList <CandleStickData> GetCandleStickData(Ticker ticker, int candleStickPeriodMin, DateTime startUtc, long periodInSeconds)
        {
            long startSec = (long)(startUtc.Subtract(epoch)).TotalSeconds;
            long end      = startSec + periodInSeconds;
            CandleStickIntervalInfo info = AllowedCandleStickIntervals.FirstOrDefault(i => i.Interval.TotalMinutes == candleStickPeriodMin);

            string address = string.Format("https://api.binance.com/api/v1/klines?symbol={0}&interval={1}&startTime={2}&endTime={3}&limit=10000",
                                           Uri.EscapeDataString(ticker.CurrencyPair), info.Command, startSec * 1000, end * 1000);

            byte[] bytes = null;
            try {
                bytes = GetDownloadBytes(address);
            }
            catch (Exception) {
                return(null);
            }
            if (bytes == null || bytes.Length == 0)
            {
                return(null);
            }

            DateTime startTime = epoch;

            BindingList <CandleStickData> list = new BindingList <CandleStickData>();
            int             startIndex         = 0;
            List <string[]> res = JSonHelper.Default.DeserializeArrayOfArrays(bytes, ref startIndex, 12);

            if (res == null)
            {
                return(list);
            }
            foreach (string[] item in res)
            {
                CandleStickData data = new CandleStickData();
                data.Time          = startTime.AddMilliseconds(FastValueConverter.ConvertPositiveLong(item[0])).ToLocalTime();
                data.Open          = FastValueConverter.Convert(item[1]);
                data.High          = FastValueConverter.Convert(item[2]);
                data.Low           = FastValueConverter.Convert(item[3]);
                data.Close         = FastValueConverter.Convert(item[4]);
                data.Volume        = FastValueConverter.Convert(item[5]);
                data.QuoteVolume   = FastValueConverter.Convert(item[7]);
                data.BuyVolume     = FastValueConverter.Convert(item[9]);
                data.SellVolume    = data.Volume - data.BuyVolume;
                data.BuySellVolume = data.BuyVolume - data.SellVolume;
                list.Add(data);
            }

            //List<TradeInfoItem> trades = GetTradeVolumesForCandleStick(ticker, startSec * 1000, end * 1000);
            //CandleStickChartHelper.InitializeVolumes(list, trades, ticker.CandleStickPeriodMin);
            return(list);
        }
        protected virtual void OnKlineItemRecv(Ticker ticker, string[] item)
        {
            long     dt   = FastValueConverter.ConvertPositiveLong(item[0]);
            DateTime time = FromUnixTime(dt);
            CandleStickIntervalInfo info = AllowedCandleStickIntervals.FirstOrDefault(i => i.Command == item[3]);

            if (ticker.CandleStickPeriodMin != info.Interval.TotalMinutes)
            {
                return;
            }
            Debug.WriteLine(item[6] + " " + item[7] + " " + item[8] + " " + item[9]);
            lock (ticker.CandleStickData) {
                CandleStickData data = ticker.GetOrCreateCandleStickData(time);
                data.Open        = FastValueConverter.Convert(item[6]);
                data.Close       = FastValueConverter.Convert(item[7]);
                data.High        = FastValueConverter.Convert(item[8]);
                data.Low         = FastValueConverter.Convert(item[9]);
                data.Volume      = FastValueConverter.Convert(item[10]);
                data.QuoteVolume = FastValueConverter.Convert(item[13]);
                ticker.RaiseCandleStickChanged();
            }
        }