Пример #1
0
        public List <Candle> GetChartData(CurrencyPair pair, EMarketTimeFrames tf, long time_beg, long time_end, CancellationToken?cancel = null)
        {
            // https://api.bitfinex.com/v2/candles/trade:TimeFrame:Symbol/Section
            var reply = GetData($"v2/candles/trade:{Misc.ToRequestString(tf)}:{pair.Id}/hist", cancel,
                                new KV("start", Misc.ToUnixTime(time_beg) * 1000),
                                new KV("end", Misc.ToUnixTime(time_end) * 1000),
                                new KV("sort", -1));

            // Update the chart data for the given pair
            Candles.ParseUpdate(pair, tf, JArray.Parse(reply));
            return(Candles[pair, tf]);
        }