internal void OnInstrumentUpdated(Settings.Instrument instrument, Settings.InstrumentUpdateType updateType)
 {
     lock (_mutex)
     {
         Logger.InfoFormat("Market manager update instrument, updateType = {0}, instrument = {1}", updateType, instrument);
         if (updateType == Settings.InstrumentUpdateType.Add)
         {
             _instruments.Add(instrument.Id, new Instrument(instrument.Id));
         }
         else if (updateType == Settings.InstrumentUpdateType.Delete)
         {
             _instruments.Remove(instrument.Id);
         }
     }
 }
Exemplo n.º 2
0
 internal void OnInstrumentUpdated(Settings.Instrument instrument, Settings.InstrumentUpdateType updateType)
 {
     lock (this.lockObj)
     {
         Logger.InfoFormat("update instrument, updateType = {0}, instrument = {1}", updateType, instrument);
         if (updateType == Settings.InstrumentUpdateType.Add)
         {
             Debug.Assert(!_alertInstrumentDict.ContainsKey(instrument.Id));
             _alertInstrumentDict.Add(instrument.Id, new AlertInstrument(instrument));
         }
         else if (updateType == Settings.InstrumentUpdateType.Delete)
         {
             Debug.Assert(_alertInstrumentDict.ContainsKey(instrument.Id));
             _alertInstrumentDict.Remove(instrument.Id);
         }
     }
 }
Exemplo n.º 3
0
 internal void OnInstrumentUpdated(Settings.Instrument instrument, Settings.InstrumentUpdateType updateType)
 {
     lock (_mutex)
     {
         Logger.InfoFormat("TradingSetting update instrument, updateType = {0}, instrument = {1}", updateType, instrument);
         if (updateType == Settings.InstrumentUpdateType.Add)
         {
             if (!_instrumentDict.ContainsKey(instrument.Id))
             {
                 _instrumentDict.Add(instrument.Id, new TradingInstrument(instrument));
             }
         }
         else if (updateType == Settings.InstrumentUpdateType.Delete)
         {
             if (_instrumentDict.ContainsKey(instrument.Id))
             {
                 _instrumentDict.Remove(instrument.Id);
             }
         }
     }
 }