Ejemplo n.º 1
0
        public void ProcessOverridedQuotation(OverridedQuotationMessage overridedQuotationMessage)
        {
            string exchangeCode = overridedQuotationMessage.ExchangeCode;
            if(!this._ExchangeQuotations.ContainsKey(exchangeCode))return;

            List<ExchangeQuotation> exchangeQuotations = this._ExchangeQuotations[exchangeCode];
            foreach (OverridedQuotation quotation in overridedQuotationMessage.OverridedQs)
            {
                ExchangeQuotation exchangeQuotation = exchangeQuotations.SingleOrDefault(P => P.QuotationPolicyId == quotation.QuotePolicyID && P.InstruemtnId == quotation.InstrumentID);

                if (exchangeQuotation == null) continue;
                exchangeQuotation.Ask = quotation.Ask;
                exchangeQuotation.Bid = quotation.Bid;
                exchangeQuotation.High = quotation.High;
                exchangeQuotation.Low = quotation.Low;
                exchangeQuotation.Origin = quotation.Origin;

                //Update DQ UI Price
                if (this._ProcessInstantOrder.InstantOrderForInstrument != null)
                {
                    this._ProcessInstantOrder.InstantOrderForInstrument.UpdateOverridedQuotation(exchangeQuotation);
                }
            }
        }
        public void ProcessOverridedQuotation(OverridedQuotationMessage overridedQuotationMessage)
        {
            string exchangeCode = overridedQuotationMessage.ExchangeCode;
            if (!this.ExchangeSettingManagers.ContainsKey(exchangeCode)) return;

            Dictionary<Guid, Dictionary<Guid, ExchangeQuotation>> exchangeQuotations = this.ExchangeSettingManagers[exchangeCode].ExchangeQuotations;

            foreach (OverridedQuotation quotation in overridedQuotationMessage.OverridedQs)
            {
                ExchangeQuotation exchangeQuotation = exchangeQuotations[quotation.QuotePolicyID][quotation.InstrumentID];

                if (exchangeQuotation == null) continue;
                exchangeQuotation.Ask = quotation.Ask;
                exchangeQuotation.Bid = quotation.Bid;
                exchangeQuotation.High = quotation.High;
                exchangeQuotation.Low = quotation.Low;
                exchangeQuotation.Origin = quotation.Origin;

                //Update DQ/Lmt UI Price
                if (this._ProcessInstantOrder.InstantOrderForInstrument != null)
                {
                    this._ProcessInstantOrder.InstantOrderForInstrument.UpdateOverridedQuotation(exchangeQuotation);
                }
                if (this._ProcessLmtOrder.LmtOrderForInstrument != null)
                {
                    this._ProcessLmtOrder.LmtOrderForInstrument.UpdateOverridedQuotation(exchangeQuotation);
                }
                if (this._MooMocOrderForInstrumentModel.MooMocOrderForInstruments.Count > 0)
                {
                    foreach (MooMocOrderForInstrument mooMocOrderForInstrument in this._MooMocOrderForInstrumentModel.MooMocOrderForInstruments)
                    {
                        mooMocOrderForInstrument.UpdateOverridedQuotation(exchangeQuotation);
                    }
                }
            }
        }