Beispiel #1
0
        internal void Merge(OverridedQ overridedQuotation)
        {
            if (this.High.IsEmpty || decimal.Parse(overridedQuotation.Bid) >= decimal.Parse(this.High.OverridedQuotation.Bid))
            {
                if (!this.High.IsEmpty && this.Low.IsEmpty)
                {
                    this.Low = new QuotationPair(this.High);
                }

                this.High = new QuotationPair(overridedQuotation);
                if (!this.Last.IsEmpty && overridedQuotation.Timestamp >= this.Last.OverridedQuotation.Timestamp)
                {
                    this.Last = QuotationPair.Empty;
                }
            }
            else if (this.Low.IsEmpty || decimal.Parse(overridedQuotation.Bid) <= decimal.Parse(this.Low.OverridedQuotation.Bid))
            {
                this.Low = new QuotationPair(overridedQuotation);
                if (!this.Last.IsEmpty && overridedQuotation.Timestamp >= this.Last.OverridedQuotation.Timestamp)
                {
                    this.Last = QuotationPair.Empty;
                }
            }
            else if (this.Last.IsEmpty || overridedQuotation.Timestamp >= this.Last.OverridedQuotation.Timestamp)
            {
                this.Last = new QuotationPair(overridedQuotation);
            }
        }
Beispiel #2
0
        public AlertOverridedQuotation(OverridedQ overridedQ, AlertInstrument instrument)
        {
            this.instrument    = instrument;
            this.quotePolicyID = overridedQ.QuotePolicyID;
            this.timestamp     = overridedQ.Timestamp;

            this.ask  = instrument.CreatePriceFromString(overridedQ.Ask);
            this.bid  = instrument.CreatePriceFromString(overridedQ.Bid);
            this.high = instrument.CreatePriceFromString(overridedQ.High);
            this.low  = instrument.CreatePriceFromString(overridedQ.Low);
        }
Beispiel #3
0
 internal static Quotation Create(OverridedQ overridedQuotation)
 {
     return(Quotation.Create(overridedQuotation.InstrumentID, overridedQuotation.Ask,
                             overridedQuotation.Bid, overridedQuotation.High, overridedQuotation.Low, overridedQuotation.Timestamp, Settings.Setting.Default));
 }
Beispiel #4
0
 internal QuotationPair(QuotationPair pair)
 {
     _quotation = pair.OverridedQuotation;
 }
Beispiel #5
0
 internal QuotationPair(OverridedQ quotation)
 {
     _quotation = quotation;
 }