Beispiel #1
0
 private void AddSpreadRow(string symbol, SpreadRow spreadRow)
 {
     if (!m_updateSpreadRows.ContainsKey(symbol))
     {
         m_updateSpreadRows[symbol] = new List<SpreadRow>() { spreadRow };
     }
     else
     {
         m_updateSpreadRows[symbol].Add(spreadRow);
     }
 }
        private void AddSpreadRow(string symbol, SpreadRow spreadRow)
        {
            // Add the spreadGrid 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_spreadGrid);

            // If this symbol does not have an entry in m_spreadRowsForSymbol dictionary, then create one
            if (!m_spreadRowsForSymbol.ContainsKey(symbol))
            {
                m_spreadRowsForSymbol[symbol] = new List<SpreadRow>() { spreadRow };
            }
            else
            {
                m_spreadRowsForSymbol[symbol].Add(spreadRow);
            }
        }
Beispiel #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);
                        StartPublishPriceUpdates(sym);
                    }
                }

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