Exemplo n.º 1
0
        private static ResponseCandle GetCandleHistoryDto(IList <Candle> candle)
        {
            if (candle == null)
            {
                Console.WriteLine("Candle empty");
                return(null);
            }

            var result = new ResponseCandle {
                Text = "something", Payload = new List <CandleDto>()
            };

            var candleDto = candle.Select(c => new CandleDto()
            {
                Timestamp = c.Timestamp,
                BidOpen   = c.BidOpen,
                BidHigh   = c.BidHigh,
                BidLow    = c.BidLow,
                BidClose  = c.BidClose,
                AskOpen   = c.AskOpen,
                AskHigh   = c.AskHigh,
                AskLow    = c.AskLow,
                AskClose  = c.AskClose,
                TickQty   = c.TickQty
            })
                            .ToList();

            result.Payload = candleDto;

            return(result);
        }
Exemplo n.º 2
0
 public void PublishCandleMessage(ResponseCandle message)
 {
     using (var bus = RabbitHutch.CreateBus(Host))
     {
         bus.Publish <ResponseCandle>(message);
     }
 }
Exemplo n.º 3
0
        private static void PublishMessage(ResponseCandle message)
        {
            INetQPublish p = new NetQPublish();

            p.PublishCandleMessage(message);
        }