// **********************************************************************

    public override void Read(bool push)
    {
      long orderId = dr.ReadInt64();
      DateTime dateTime = dr.ReadDateTime(ref baseDateTime);
      int price = dr.ReadRelative(ref basePrice);
      int quantity = dr.ReadPackInt();

      OwnTradeReply reply = new OwnTradeReply(OwnTradeSource.History,
        dateTime, 0, orderId, price, quantity);

      if(push && Handler != null)
        Handler(Security.Key, reply);
    }
Example #2
0
        // **********************************************************************

        public override void Read(bool push)
        {
            long     orderId  = dr.ReadInt64();
            DateTime dateTime = dr.ReadDateTime(ref baseDateTime);
            int      price    = dr.ReadRelative(ref basePrice);
            int      quantity = dr.ReadPackInt();

            OwnTradeReply reply = new OwnTradeReply(OwnTradeSource.History,
                                                    dateTime, 0, orderId, price, quantity);

            if (push && Handler != null)
            {
                Handler(Security.Key, reply);
            }
        }
Example #3
0
        // **********************************************************************

        public void Write(DateTime dateTime, OwnTradeReply reply)
        {
            dw.WriteRecHeader(sid, dateTime);

            dw.WriteGrowing(DateTimeHelper.ToMs(reply.DateTime), ref lastMilliseconds);

            dw.WriteLeb128(reply.TradeId - lastTradeId);
            lastTradeId = reply.TradeId;

            dw.WriteLeb128(reply.OrderId - lastOrderId);
            lastOrderId = reply.OrderId;

            dw.WriteLeb128(reply.Price - lastPrice);
            lastPrice = reply.Price;

            dw.WriteLeb128(reply.Quantity);
        }
    // **********************************************************************

    public void Write(DateTime dateTime, OwnTradeReply reply)
    {
      dw.WriteRecHeader(sid, dateTime);

      dw.WriteGrowing(DateTimeHelper.ToMs(reply.DateTime), ref lastMilliseconds);

      dw.WriteLeb128(reply.TradeId - lastTradeId);
      lastTradeId = reply.TradeId;

      dw.WriteLeb128(reply.OrderId - lastOrderId);
      lastOrderId = reply.OrderId;

      dw.WriteLeb128(reply.Price - lastPrice);
      lastPrice = reply.Price;

      dw.WriteLeb128(reply.Quantity);
    }