Exemple #1
0
        /// <summary>
        /// Get candlesticks
        /// </summary>
        /// <param name="pair">Trading pair</param>
        /// <param name="endAt">Ending date</param>
        /// <param name="interval">Candlestick interval</param>
        /// <param name="stickCount">Number of sticks to return</param>
        /// <returns>Collection of candlesticks</returns>
        public static async Task <List <Candlestick> > GetCandlestick(this IKuCoinDotNet service, string pair, long endAt, Interval interval, int stickCount)
        {
            var _dtHelper = new DateTimeHelper();
            var _helper   = new Helper();
            var startAt   = _helper.GetFromUnixTime(endAt, interval, (stickCount + 2));

            return(await service.GetCandlestick(pair, startAt, endAt, interval));
        }
Exemple #2
0
        /// <summary>
        /// Get candlesticks
        /// </summary>
        /// <param name="pair">Trading pair</param>
        /// <param name="startDate">Starting date</param>
        /// <param name="endDate">Ending date</param>
        /// <param name="interval">Candlestick interval</param>
        /// <returns>Collection of candlesticks</returns>
        public static async Task <List <Candlestick> > GetCandlestick(this IKuCoinDotNet service, string pair, DateTime startDate, DateTime endDate, Interval interval)
        {
            var _dtHelper = new DateTimeHelper();
            var startAt   = _dtHelper.LocalToUnixTime(startDate);
            var endAt     = _dtHelper.LocalToUnixTime(endDate);

            return(await service.GetCandlestick(pair, startAt, endAt, interval));
        }
        public void GetCandleStick_Simple_Test()
        {
            var pair     = "ETH-BTC";
            var interval = Interval.OneH;
            var count    = 5;

            var candlesticks = _service.GetCandlestick(pair, interval, count).Result;

            Assert.NotNull(candlesticks);
        }