Esempio n. 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);
     }
 }
Esempio n. 2
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);
            }
        }