Exemplo n.º 1
0
 private void UpdateSpreads(PriceRow row)
 {
     //cout("UPDATE SPREADS: {0}", row.Symbol);
     if (m_updateSpreadRows.ContainsKey(row.Symbol))
     {
         var li = m_updateSpreadRows[row.Symbol];
         foreach (var spreadRow in li)
         {
             spreadRow.SymbolUpdate(row);
             m_spreadGrid.UpdateRow(spreadRow);
         }
     }
 }
Exemplo n.º 2
0
        private void M_prices_UpdatePrices(PriceUpdateIQ update)
        {
            // Update messages are sent to the client anytime one of the fields in the current fieldset are updated.
            //var x = "Q,@ESU17,2463.50,2,08:26:54.256829,43,170391,2463.25,116,2463.50,159,2460.25,2463.75,2456.50,2459.75,a,01,";

            if (!m_priceRowForSymbol.ContainsKey(update.Symbol)) return;

            m_latestPrices[update.Symbol] = update;

            var row = m_priceRowForSymbol[update.Symbol];
            row.UpdateValues(update);

            //Console.WriteLine("CHANGE the NotifyGrids Property method of updating grids!");
            // Price Update to Level 1 grid
            //if (row.NotifyGrids.Contains(m_level1Grid))
            if (m_notifyGrids[update.Symbol].Contains(m_priceGrid))
                m_priceGrid.UpdateRow(row);

            // Price Update to Spread grid
            //if (row.NotifyGrids.Contains(m_spreadGrid))
            if (m_notifyGrids[update.Symbol].Contains(m_spreadGrid))
                UpdateSpreads(row);
        }
Exemplo n.º 3
0
        private void M_subscriber_Receive(string sUpdate)
        {
            // Update messages are sent to the client anytime one of the fields in the current fieldset are updated.
            //var x = "Q,@ESU17,2463.50,2,08:26:54.256829,43,170391,2463.25,116,2463.50,159,2460.25,2463.75,2456.50,2459.75,a,01,";

            //cout(sUpdate);

            _update = new PriceUpdate(sUpdate);
            //cout("{0} [{1}] {2}:{3}-{4}:{5}", _update.Symbol, _update.LastTradePrice, _update.BidSize, _update.Bid, _update.Ask, _update.AskSize);

            if (!m_updatePriceRows.ContainsKey(_update.Symbol)) return;

            var row = m_updatePriceRows[_update.Symbol];
            row.UpdateValues(_update);

            // Price Update to Level 1 grid
            if (row.NotifyGrids.Contains(m_priceGrid))
                m_priceGrid.UpdateRow(row);

            // Price Update to Spread grid
            if (row.NotifyGrids.Contains(m_spreadGrid))
                UpdateSpreads(row);
        }