Пример #1
0
        /*// Maintain a List of DisplayGrid objects that should be notified when this PriceRow is updated
         * public void AddNotifyGrid(DynamicDisplayGrid displayGrid)
         * {
         *  if (!m_notifyGridsOfUpdate.Contains(displayGrid))
         *      m_notifyGridsOfUpdate.Add(displayGrid);
         * }*/

        // Simple method to update the properties of the PriceRow
        //public void UpdateValues(double lastTradePrice, int lastTradeSize, double bid, int bidSize, double ask, int askSize, int totalVolume, double openPrice, double highPrice, double lowPrice, double closePrice)
        public void UpdateValues(PriceUpdateIQ update)
        {
            this.LastTradePrice = update.LastTradePrice;
            this.LastTradeSize  = update.LastTradeSize;
            this.Bid            = update.Bid;
            this.BidSize        = update.BidSize;
            this.Ask            = update.Ask;
            this.AskSize        = update.AskSize;
            this.TotalVolume    = update.TotalVolume;
            this.OpenPrice      = update.OpenPrice;
            this.HighPrice      = update.HighPrice;
            this.LowPrice       = update.LowPrice;
            this.ClosePrice     = update.ClosePrice;
        }
Пример #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_updatePriceRows.ContainsKey(update.Symbol)) return;

            var row = m_updatePriceRows[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))
                m_level1Grid.UpdateRow(row);

            // Price Update to Spread grid
            if (row.NotifyGrids.Contains(m_spreadGrid))
                UpdateSpreads(row);*/
        }
Пример #3
0
        private void M_iq_UpdatePrices(PriceUpdateIQ update)
        {
            //Console.WriteLine("{0}  {1}:{2}-{3}:{4}  {5}", update.Symbol, update.BidSize, update.Bid, update.Ask, update.AskSize, update.LastTradeTime);
            if (update.Symbol.StartsWith("@BTC"))
            {
                m_baBtc.Update(this, update);

                if (m_prevBtc != null)
                {
                    if (update.LastTradePrice > decimal.Parse(m_prevBtc))
                    {
                        GUi.SetLabelColor(this, lblFutBTC, Color.Green);
                    }
                    else if (update.LastTradePrice < decimal.Parse(m_prevBtc))
                    {
                        GUi.SetLabelColor(this, lblFutBTC, Color.Red);
                    }
                }
                GUi.SetLabelText(this, lblFutBTC, update.LastTradePrice.ToString());
                m_prevBtc = update.LastTradePrice.ToString();
            }
            else if (update.Symbol.StartsWith("@XBT"))
            {
                m_baXbt.Update(this, update);

                if (m_prevXbt != null)
                {
                    if (update.LastTradePrice > decimal.Parse(m_prevXbt))
                    {
                        GUi.SetLabelColor(this, lblFutXBT, Color.Green);
                    }
                    else if (update.LastTradePrice < decimal.Parse(m_prevXbt))
                    {
                        GUi.SetLabelColor(this, lblFutXBT, Color.Red);
                    }
                }
                GUi.SetLabelText(this, lblFutXBT, update.LastTradePrice.ToString());
                m_prevXbt = update.LastTradePrice.ToString();
            }
        }