示例#1
0
        public void AbortPartialDepth()
        {
            if (_partialDepthSocketId.HasValue)
            {
                AccessWebSocket.Unsubscribe(_partialDepthSocketId.Value);
            }

            _partialDepthSocketId = null;
        }
示例#2
0
        public void AbortTrade()
        {
            if (_tradeSocketId.HasValue)
            {
                AccessWebSocket.Unsubscribe(_tradeSocketId.Value);
            }

            _tradeSocketId = null;
        }
示例#3
0
        public void AbortKline()
        {
            if (_klineSocketId.HasValue)
            {
                AccessWebSocket.Unsubscribe(_klineSocketId.Value);
            }

            _klineSocketId = null;
        }
示例#4
0
        public void RetrievePartialDepth(Action <OrderBookInfo> handler, int level)
        {
            if (_partialDepthSocketId.HasValue)
            {
                AbortPartialDepth();
            }

            _partialDepthSocketId = AccessWebSocket.Subscribe(
                _symbol + "@depth" + level.ToString(), handler);
        }
示例#5
0
        public void RetrieveTrade(Action <TradeInfo> handler)
        {
            if (_tradeSocketId.HasValue)
            {
                AbortTrade();
            }

            _tradeSocketId = AccessWebSocket.Subscribe(
                _symbol + "@trade", handler);
        }
示例#6
0
        public void RetrieveKline(Action <CurrentKlineInfo> handler, KlineInterval interval)
        {
            if (_klineSocketId.HasValue)
            {
                AbortKline();
            }

            _klineSocketId = AccessWebSocket.Subscribe(
                _symbol + "@kline_" + ConvertHelper.ObtainEnumValue(interval), handler);
        }