private void OnSessionOrderBookStatusChanged(OrderBookStatusEvent orderBookStatusEvent)
        {
            SecurityStates state;

            switch (orderBookStatusEvent.Status)
            {
            case OrderBookStatus.New:
            case OrderBookStatus.Opened:
                state = SecurityStates.Trading;
                break;

            case OrderBookStatus.Suspended:
            case OrderBookStatus.Closed:
            case OrderBookStatus.Settled:
            case OrderBookStatus.Withdrawn:
                state = SecurityStates.Stoped;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            SendOutMessage(
                new Level1ChangeMessage
            {
                SecurityId = new SecurityId {
                    Native = orderBookStatusEvent.InstrumentId
                },
                ServerTime = CurrentTime.Convert(TimeZoneInfo.Utc),
            }
                .Add(Level1Fields.State, state));
        }
예제 #2
0
 public bool Equals(OrderBookStatusEvent other)
 {
     if (object.ReferenceEquals((object)null, (object)other))
     {
         return(false);
     }
     if (object.ReferenceEquals((object)this, (object)other))
     {
         return(true);
     }
     return(other._instrumentId == this._instrumentId && other._status == this._status);
 }
예제 #3
0
 public bool Equals(OrderBookStatusEvent other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(other._instrumentId == _instrumentId && other._status == _status);
 }
 public bool Equals(OrderBookStatusEvent other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return other._instrumentId == _instrumentId && other._status == _status;
 }