Ejemplo n.º 1
0
 // TODO: WHAT IF WE SUBSCRIBE TO A PRICE FIRST IN THE SPREAD GRID? WE NEED TO CHECK FOR EXISTING m_updatePriceRows ENTRY AND USE IF EXISTS
 private void AddPriceRow(string symbol)
 {
     if (m_updatePriceRows.ContainsKey(symbol))      // if the symbol is already "subscribed"...
     {
         var row = m_updatePriceRows[symbol];        // use the existing PriceRow
         //row.AddNotifyGrid(m_level1Grid);            // add m_level1Grid to the grids that should be notified of updates
         m_level1Grid.AddRow(row);                   // display the row in the "Price" grid
     }
     else
     {
         var row = new PriceRow(symbol);             // create a new PriceRow for this symbol
         //row.AddNotifyGrid(m_level1Grid);
         m_updatePriceRows[symbol] = row;
         m_level1Grid.AddRow(row);
         m_prices.SubscribePrices(symbol);
     }
 }
Ejemplo n.º 2
0
        // TODO: WHAT IF WE SUBSCRIBE TO A PRICE FIRST IN THE SPREAD GRID? WE NEED TO CHECK FOR EXISTING m_updatePriceRows ENTRY AND USE IF EXISTS
        private void AddPriceRow(string symbol)
        {
            // Add the priceGrid to the list of grids associated with this symbol
            if (!m_notifyGrids.ContainsKey(symbol)) m_notifyGrids[symbol] = new HashSet<DynamicDisplayGrid>();
            m_notifyGrids[symbol].Add(m_priceGrid);

            // 
            if (m_priceRowForSymbol.ContainsKey(symbol))      // if the symbol is already "subscribed"...
            {
                var row = m_priceRowForSymbol[symbol];        // use the existing PriceRow
                //row.AddNotifyGrid(m_level1Grid);            // add m_level1Grid to the grids that should be notified of updates
                m_priceGrid.AddRow(row);                   // display the row in the "Price" grid
            }
            else
            {
                var row = new PriceRow(symbol);             // create a new PriceRow for this symbol
                //row.AddNotifyGrid(m_level1Grid);
                m_priceRowForSymbol[symbol] = row;
                m_priceGrid.AddRow(row);
                m_prices.SubscribePrices(symbol);
            }
        }
Ejemplo n.º 3
0
        // Reload the SPREADS file into the "Spreads" grid
        private void ReloadSpreads()
        {
            m_spreadGrid.ClearRows();

            // If our symbols text file exists, then read it and request price updates on the symbols in the file
            var df = dfReadSpreads();
            foreach (var row in df.Rows)
            {
                //string group = row[0];
                string symbol = row[1];
                string formula = row[8];
                var spreadRow = new SpreadRow(symbol, formula);
                m_spreadGrid.AddRow(spreadRow);

                foreach (var sym in spreadRow.FormulaSymbols)
                {
                    cout("Formula Symbol: {0}", sym);
                    if (m_updatePriceRows.ContainsKey(sym))
                    {
                        var priceRow = m_updatePriceRows[sym];
                        //priceRow.AddNotifyGrid(m_spreadGrid);
                        AddSpreadRow(sym, spreadRow);
                    }
                    else
                    {
                        var priceRow = new PriceRow(sym);
                        //priceRow.AddNotifyGrid(m_spreadGrid);
                        m_updatePriceRows[sym] = priceRow;
                        AddSpreadRow(sym, spreadRow);
                        //m_level1Grid.AddRow(row);
                        m_prices.SubscribePrices(sym);
                    }
                }

                //SubscribePrices(symbol1);
                //SubscribePrices(symbol2);
            }
        }