예제 #1
0
        /// <summary>
        /// Sets the current status of the BenchmarkSystem
        /// </summary>
        private void SetStatus()
        {

            //NB Pause is yet not implementet and therefore this is not set here

            if (_isFinishing)
                if (_threads.Count == 0)
                    Status = BSStatus.Stopped;
                else
                    Status = BSStatus.Finishing;
            else if (_threads.Count < 1)
                Status = BSStatus.Ready;
            else
                Status = BSStatus.Processing;
        }
        public QuotePriceClient(QuoteMessage quoteMessage, int waitTimes, InstrumentClient instrument, Customer customer, ExchangeQuotation quotation)
        {
            this._ExchangeQuotation = quotation;
            this._Origin = quotation.Origin;
            this._CustomerClient = customer;
            this._Instrument = instrument;
            this._ExchangeCode = quoteMessage.ExchangeCode;
            this._CustomerId = quoteMessage.CustomerID;
            this._InstrumentId = quoteMessage.InstrumentID;

            this._Lot = (decimal)quoteMessage.QuoteLot;
            this._AnswerLot = this._Lot;
            this._BSStatus = (BSStatus)quoteMessage.BSStatus;
            this._BuyLot = this._BSStatus == BSStatus.Buy ? this._Lot : decimal.Zero;
            this._SellLot = this._BSStatus == BSStatus.Sell ? this._Lot : decimal.Zero;
            if (this._BSStatus == BSStatus.Both)
            {
                this._BuyLot = this._Lot;
                this._SellLot = this._Lot;
            }
            this._WaitTimes = waitTimes;
            this._TimeStamp = quoteMessage.TimeStamp;
        }
        internal void FirstQuoteUpdate(QuotePriceClient quotePriceClient)
        {
            this._QuoteId = quotePriceClient.Id;
            this._Instrument = quotePriceClient.Instrument;
            this._InstrumentCode = this._Instrument.Code;
            this._Origin = quotePriceClient.ExchangeQuotation.Origin;
            this._Ask = quotePriceClient.ExchangeQuotation.Ask;
            this._Bid = quotePriceClient.ExchangeQuotation.Bid;
            this._SumBuyLot = quotePriceClient.BuyLot;
            this._SumSellLot = quotePriceClient.SellLot;
            this._Lot = quotePriceClient.Lot;
            this._AnswerLot = this._Lot;
            this._AdjustLot = this._Lot;
            this._BSStatus = quotePriceClient.BSStatus;
            this._AdjustPoint = (decimal)this.Instrument.NumeratorUnit / (decimal)this.Instrument.Denominator;

            this.CreateBestPrice(true);
            this.SettingBackGround();
        }