Example #1
0
 private void OnNewMarketDepth(object sender, MarketDepthEventArgs args)
 {
     if (!this.isRunning || !this.cbxMarketDepth.Checked)
     {
         return;
     }
     this.queue.Enqueue((Action)(() =>
     {
         Instrument local_0 = ((IntradayEventArgs)args).Instrument as Instrument;
         InstrumentRow local_1 = this.instruments[local_0] as InstrumentRow;
         if (local_1 == null)
         {
             return;
         }
         local_0.Add(args.MarketDepth);
         ++local_1.MarketDepths;
     }));
 }
Example #2
0
        private void RemoveInstrument(Instrument instrument)
        {
            InstrumentRow instrumentRow = this.instruments[instrument] as InstrumentRow;

            if (instrumentRow != null)
            {
                this.dgvPanel.Rows.Remove((DataGridViewRow)instrumentRow);
            }
            this.instruments.Remove(instrument);
            if (!this.isRunning)
            {
                return;
            }
            this.CancelMarketData(new Instrument[1]
            {
                instrument
            }, this.GetMarketDataType());
        }
Example #3
0
 private void OnNewQuote(object sender, QuoteEventArgs args)
 {
     if (!this.isRunning || !this.cbxQuotes.Checked)
     {
         return;
     }
     this.queue.Enqueue((Action)(() =>
     {
         Instrument local_0 = ((IntradayEventArgs)args).Instrument as Instrument;
         InstrumentRow local_1 = this.instruments[local_0] as InstrumentRow;
         if (local_1 == null)
         {
             return;
         }
         local_0.Add(args.Quote);
         ++local_1.Quotes;
     }));
 }
Example #4
0
        private void AddInstrument(Instrument instrument)
        {
            if (this.instruments.ContainsKey(instrument))
            {
                return;
            }
            InstrumentRow instrumentRow = new InstrumentRow(instrument);

            instrumentRow.Height           = this.dgvPanel.RowTemplate.Height;
            instrumentRow.ContextMenuStrip = this.dgvPanel.RowTemplate.ContextMenuStrip;
            this.dgvPanel.Rows.Add((DataGridViewRow)instrumentRow);
            this.instruments.Add(instrument, instrumentRow);
            if (!this.isRunning)
            {
                return;
            }
            this.RequestMarketData(new Instrument[1]
            {
                instrument
            }, this.GetMarketDataType());
        }
Example #5
0
 private void AddInstrument(Instrument instrument)
 {
   if (this.instruments.ContainsKey(instrument))
     return;
   InstrumentRow instrumentRow = new InstrumentRow(instrument);
   instrumentRow.Height = this.dgvPanel.RowTemplate.Height;
   instrumentRow.ContextMenuStrip = this.dgvPanel.RowTemplate.ContextMenuStrip;
   this.dgvPanel.Rows.Add((DataGridViewRow) instrumentRow);
   this.instruments.Add(instrument, instrumentRow);
   if (!this.isRunning)
     return;
   this.RequestMarketData(new Instrument[1]
   {
     instrument
   }, this.GetMarketDataType());
 }