コード例 #1
0
        public async Task <List <Bar> > GetBars(Selection selection)
        {
            var id      = NextValidId;
            var request = new GetBarsRequest
            {
                Id        = id,
                Selection = selection
            };

            return(await RequestHelper <List <Bar> > .ProceedRequest(id, _client, request));
        }
コード例 #2
0
        public override Task <Response> GetBars(GetBarsRequest request, ServerCallContext context)
        {
            _logger.Write(
                $"Call GetBars({request.Symbol.Value}, {(StBarInterval) request.Interval}, {new DateTime(request.Since)}, {(int) request.Count})"
                );

            try
            {
                _stServer.GetBars(
                    request.Symbol.Value,
                    (StBarInterval)request.Interval,
                    new DateTime(request.Since),
                    (int)request.Count
                    );
            }
            catch (Exception e)
            {
                _logger.Error(e.Message);
            }

            return(Task.FromResult(new Response {
                Queue = TopicName.AddBar
            }));
        }