コード例 #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (InstrumentId != 0)
            {
                hash ^= InstrumentId.GetHashCode();
            }
            if (timeFrame_ != null)
            {
                hash ^= TimeFrame.GetHashCode();
            }
            if (Side != 0)
            {
                hash ^= Side.GetHashCode();
            }
            if (before_ != null)
            {
                hash ^= Before.GetHashCode();
            }
            if (after_ != null)
            {
                hash ^= After.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #2
0
 private void SetProperties(PricingStructureTypeEnum pricingStructureType)
 {
     if (pricingStructureType == PricingStructureTypeEnum.BondDiscountCurve)
     {
         var rateCurveId   = CurveName.Split('-');
         var subordination = rateCurveId[rateCurveId.Length - 1];
         var indexName     = rateCurveId[0];
         for (var i = 1; i < rateCurveId.Length - 1; i++)
         {
             indexName = indexName + '-' + rateCurveId[i];
         }
         CreditInstrumentId = ProductTypeHelper.InstrumentIdHelper.Parse(indexName);
         CreditSeniority    = ProductTypeHelper.CreditSeniorityHelper.Parse(subordination);
     }
     if (pricingStructureType == PricingStructureTypeEnum.BondCurve)
     {
         var rateCurveId   = CurveName.Split('-');
         var subordination = rateCurveId[rateCurveId.Length - 1];
         var indexName     = rateCurveId[0];
         for (var i = 1; i < rateCurveId.Length - 1; i++)
         {
             indexName = indexName + '-' + rateCurveId[i];
         }
         CreditInstrumentId = ProductTypeHelper.InstrumentIdHelper.Parse(indexName);
         CreditSeniority    = ProductTypeHelper.CreditSeniorityHelper.Parse(subordination);
     }
 }
コード例 #3
0
        public int Compare(StreamOrder other)
        {
            int ret = 0;

            ret = Id.CompareTo(other.Id);
            if (ret != 0)
            {
                return(ret);
            }
            ret = PortfolioId.CompareTo(other.PortfolioId);
            if (ret != 0)
            {
                return(ret);
            }
            ret = InstrumentId.CompareTo(other.InstrumentId);
            if (ret != 0)
            {
                return(ret);
            }
            ret = (Bid != other.Bid ? Bid ? 1 : -1 : 0);
            if (ret != 0)
            {
                return(ret);
            }
            ret = (Price != other.Price ? Price > other.Price ? 1 : -1 : 0);
            if (ret != 0)
            {
                return(ret);
            }
            ret = (Volume != other.Volume ? Volume > other.Volume ? 1 : -1 : 0);
            return(ret);
        }
コード例 #4
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (BrokerId.Length != 0)
            {
                hash ^= BrokerId.GetHashCode();
            }
            if (InvestorId.Length != 0)
            {
                hash ^= InvestorId.GetHashCode();
            }
            if (InstrumentId.Length != 0)
            {
                hash ^= InstrumentId.GetHashCode();
            }
            if (ExchangeId.Length != 0)
            {
                hash ^= ExchangeId.GetHashCode();
            }
            if (HedgeFlag != 0)
            {
                hash ^= HedgeFlag.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #5
0
    private void OnInstrumentSelect(InstrumentId instrumentId)
    {
        instrumentList.OnSelect -= OnInstrumentSelect;

        currentInstrumentId = instrumentId;
        instrumentButton.setText(currentInstrumentId.ToString().ToUpper());

        instrumentList.gameObject.SetActive(false);
    }
コード例 #6
0
        public InstrumentArchetypeInstance(CompoundIdentity instrumentId, CompoundIdentity archetypeId, string data)
        {
            MethodContract.Assert(!InstrumentId.IsNullOrEmpty(), nameof(instrumentId));
            MethodContract.Assert(!archetypeId.IsNullOrEmpty(), nameof(archetypeId));
            MethodContract.NotNullOrEmpty(data, nameof(data));

            this.InstrumentId = instrumentId;
            this.ArchetypeId  = archetypeId;
            this.Data         = data;
        }
コード例 #7
0
ファイル: Instrument.cs プロジェクト: elia07/ExchangeSharp
 public ExchangeMarket ToExchangeMarket()
 {
     return(new ExchangeMarket()
     {
         BaseCurrency = Product1Symbol,
         IsActive = SessionStatus.Equals("running", StringComparison.InvariantCultureIgnoreCase),
         MarginEnabled = false,
         MarketId = InstrumentId.ToStringInvariant(),
         MarketSymbol = Symbol
     });
 }
コード例 #8
0
 private void SetProperties()
 {
     switch (PricingStructureType)
     {
     case PricingStructureTypeEnum.BondDiscountCurve:
     case PricingStructureTypeEnum.BondCurve:
         string creditInstrumentId = PropertyHelper.ExtractCreditInstrumentId(Properties);
         string creditSeniority    = PropertyHelper.ExtractCreditSeniority(Properties);
         CreditInstrumentId = ProductTypeHelper.InstrumentIdHelper.Parse(creditInstrumentId);
         CreditSeniority    = ProductTypeHelper.CreditSeniorityHelper.Parse(creditSeniority);
         break;
     }
 }
コード例 #9
0
        private void SetProperties()
        {
            switch (PricingStructureType)
            {
            case PricingStructureTypeEnum.RateCurve:
            case PricingStructureTypeEnum.RateBasisCurve:
                ForecastRateIndex = ForecastRateIndexHelper.Parse(Index, IndexTenor);
                break;

            case PricingStructureTypeEnum.RateSpreadCurve:
            case PricingStructureTypeEnum.ClearedRateCurve:
                ForecastRateIndex         = ForecastRateIndexHelper.Parse(Index, IndexTenor);
                ReferenceCurveTypeAndName = PropertyHelper.ExtractReferenceCurveName(Properties);
                ReferenceCurveUniqueId    = PropertyHelper.ExtractReferenceCurveUniqueId(Properties);
                break;

            case PricingStructureTypeEnum.DiscountCurve:
                string creditInstrumentId = PropertyHelper.ExtractCreditInstrumentId(Properties);
                string creditSeniority    = PropertyHelper.ExtractCreditSeniority(Properties);
                CreditInstrumentId = InstrumentIdHelper.Parse(creditInstrumentId);
                CreditSeniority    = CreditSeniorityHelper.Parse(creditSeniority);
                break;

            case PricingStructureTypeEnum.RateXccyCurve:
                //ForecastRateIndex = ForecastRateIndexHelper.Parse(Index, IndexTenor);
                string discountInstrumentId = PropertyHelper.ExtractCreditInstrumentId(Properties);
                string discountSeniority    = PropertyHelper.ExtractCreditSeniority(Properties);
                CreditInstrumentId                 = InstrumentIdHelper.Parse(discountInstrumentId);
                CreditSeniority                    = CreditSeniorityHelper.Parse(discountSeniority);
                ReferenceCurveTypeAndName          = PropertyHelper.ExtractReferenceCurveName(Properties);
                ReferenceCurveUniqueId             = PropertyHelper.ExtractReferenceCurveUniqueId(Properties);
                ReferenceFxCurveTypeAndName        = PropertyHelper.ExtractReferenceFxCurveName(Properties);
                ReferenceFxCurveUniqueId           = PropertyHelper.ExtractReferenceFxCurveUniqueId(Properties);
                ReferenceCurrency2CurveTypeAndName = PropertyHelper.ExtractReferenceCurrency2CurveName(Properties);
                ReferenceCurrency2CurveId          = PropertyHelper.ExtractReferenceCurrency2CurveId(Properties);
                break;

            case PricingStructureTypeEnum.InflationCurve:
                ForecastRateIndex = ForecastRateIndexHelper.Parse(Index, IndexTenor);
                var inflationLag = PropertyHelper.ExtractInflationLag(Properties);
                if (inflationLag != "Unknown")
                {
                    InflationLag = PeriodHelper.Parse(inflationLag);
                }
                break;

            case PricingStructureTypeEnum.XccySpreadCurve:
                PricingStructureType = PricingStructureTypeEnum.RateSpreadCurve;
                break;
            }
        }
コード例 #10
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (InstrumentId.Length != 0)
            {
                hash ^= InstrumentId.GetHashCode();
            }
            if (BrokerId.Length != 0)
            {
                hash ^= BrokerId.GetHashCode();
            }
            if (InvestorId.Length != 0)
            {
                hash ^= InvestorId.GetHashCode();
            }
            if (OpenRatioByMoney != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(OpenRatioByMoney);
            }
            if (OpenRatioByVolume != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(OpenRatioByVolume);
            }
            if (CloseRatioByMoney != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(CloseRatioByMoney);
            }
            if (CloseRatioByVolume != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(CloseRatioByVolume);
            }
            if (CloseTodayRatioByMoney != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(CloseTodayRatioByMoney);
            }
            if (CloseTodayRatioByVolume != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(CloseTodayRatioByVolume);
            }
            if (ExchangeId.Length != 0)
            {
                hash ^= ExchangeId.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #11
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (BrokerId.Length != 0)
            {
                hash ^= BrokerId.GetHashCode();
            }
            if (InvestorId.Length != 0)
            {
                hash ^= InvestorId.GetHashCode();
            }
            if (UserId.Length != 0)
            {
                hash ^= UserId.GetHashCode();
            }
            if (InstrumentId.Length != 0)
            {
                hash ^= InstrumentId.GetHashCode();
            }
            if (ExchangeId.Length != 0)
            {
                hash ^= ExchangeId.GetHashCode();
            }
            if (OrderSysId.Length != 0)
            {
                hash ^= OrderSysId.GetHashCode();
            }
            if (OrderRef.Length != 0)
            {
                hash ^= OrderRef.GetHashCode();
            }
            if (FrontId != 0)
            {
                hash ^= FrontId.GetHashCode();
            }
            if (SessionId != 0)
            {
                hash ^= SessionId.GetHashCode();
            }
            if (ActionFlag != 0)
            {
                hash ^= ActionFlag.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #12
0
 private IInstrumentId RegisterNewInstrument(string name)
 {
     lock (this)
     {
         IInstrumentId result;
         if (instruments.TryGetValue(name, out result))
         {
             return(result);
         }
         result = new InstrumentId(name, instruments.Count);
         instruments.Add(name, result);
         return(result);
     }
 }
コード例 #13
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (InstrumentId != 0)
            {
                hash ^= InstrumentId.GetHashCode();
            }
            hash ^= positionHistories_.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #14
0
    public void Init()
    {
        trackNameInput.text = "VOCALS";

        instrumentList.Init();
        instrumentList.gameObject.SetActive(false);

        currentInstrumentId = InstrumentId.Vocals;
        instrumentButton.setText(currentInstrumentId.ToString().ToUpper());

        instrumentButton.onClick += OnInstrumentButtonClick;

        createButton.onClick += OnCreateButtonClick;
        cancelButton.onClick += OnCancelButtonClick;
    }
コード例 #15
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (InstrumentId.Length != 0)
            {
                hash ^= InstrumentId.GetHashCode();
            }
            if (BrokerId.Length != 0)
            {
                hash ^= BrokerId.GetHashCode();
            }
            if (InvestorId.Length != 0)
            {
                hash ^= InvestorId.GetHashCode();
            }
            if (HedgeFlag != 0)
            {
                hash ^= HedgeFlag.GetHashCode();
            }
            if (LongMarginRatioByMoney != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(LongMarginRatioByMoney);
            }
            if (LongMarginRatioByVolume != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(LongMarginRatioByVolume);
            }
            if (ShortMarginRatioByMoney != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(ShortMarginRatioByMoney);
            }
            if (ShortMarginRatioByVolume != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(ShortMarginRatioByVolume);
            }
            if (ExchangeId.Length != 0)
            {
                hash ^= ExchangeId.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #16
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (InstrumentId.Length != 0)
            {
                hash ^= InstrumentId.GetHashCode();
            }
            if (ExchangeId.Length != 0)
            {
                hash ^= ExchangeId.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #17
0
            public ExchangeTicker ToExchangeTicker(string currencyPair)
            {
                var currencyParts = currencyPair.Split(new[] { "_" }, StringSplitOptions.RemoveEmptyEntries);

                return(new ExchangeTicker()
                {
                    Bid = BestBid.GetValueOrDefault(),
                    Ask = BestOffer.GetValueOrDefault(),
                    Id = InstrumentId.ToString(),
                    Last = LastTradeTime.GetValueOrDefault(),
                    Volume = new ExchangeVolume()
                    {
                        BaseCurrency = currencyParts[0],
                        QuoteCurrency = currencyParts[1],
                        BaseCurrencyVolume = Volume.GetValueOrDefault()
                    }
                });
            }
コード例 #18
0
 private void SetProperties(PricingStructureTypeEnum pricingStructureType, string curveName)
 {
     if (pricingStructureType == PricingStructureTypeEnum.RateCurve ||
         pricingStructureType == PricingStructureTypeEnum.RateBasisCurve ||
         pricingStructureType == PricingStructureTypeEnum.ClearedRateCurve ||
         pricingStructureType == PricingStructureTypeEnum.RateSpreadCurve)
     {
         var rateCurveId = curveName.Split('-');
         var indexTenor  = rateCurveId[rateCurveId.Length - 1];
         var indexName   = rateCurveId[0];
         for (var i = 1; i < rateCurveId.Length - 1; i++)
         {
             indexName = indexName + '-' + rateCurveId[i];
         }
         ForecastRateIndex = ForecastRateIndexHelper.Parse(indexName, indexTenor);
     }
     if (pricingStructureType == PricingStructureTypeEnum.DiscountCurve ||
         pricingStructureType == PricingStructureTypeEnum.RateXccyCurve)
     {
         var rateCurveId   = CurveName.Split('-');
         var subordination = rateCurveId[rateCurveId.Length - 1];
         var indexName     = rateCurveId[0];
         for (var i = 1; i < rateCurveId.Length - 1; i++)
         {
             indexName = indexName + '-' + rateCurveId[i];
         }
         CreditInstrumentId = InstrumentIdHelper.Parse(indexName);
         CreditSeniority    = CreditSeniorityHelper.Parse(subordination);
     }
     if (pricingStructureType == PricingStructureTypeEnum.InflationCurve)
     {
         var rateCurveId = CurveName.Split('-');
         var indexTenor  = rateCurveId[rateCurveId.Length - 1];
         var indexName   = rateCurveId[0];
         for (var i = 1; i < rateCurveId.Length - 1; i++)
         {
             indexName = indexName + '-' + rateCurveId[i];
         }
         ForecastRateIndex = ForecastRateIndexHelper.Parse(indexName, indexTenor);
     }
 }
コード例 #19
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (AccountId.Length != 0)
            {
                hash ^= AccountId.GetHashCode();
            }
            if (AgentId.Length != 0)
            {
                hash ^= AgentId.GetHashCode();
            }
            if (InstrumentId.Length != 0)
            {
                hash ^= InstrumentId.GetHashCode();
            }
            if (Price != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Price);
            }
            if (Lots != 0)
            {
                hash ^= Lots.GetHashCode();
            }
            if (TraderId.Length != 0)
            {
                hash ^= TraderId.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #20
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (TradeId.Length != 0)
            {
                hash ^= TradeId.GetHashCode();
            }
            if (ExchangeOrderId.Length != 0)
            {
                hash ^= ExchangeOrderId.GetHashCode();
            }
            if (System.Length != 0)
            {
                hash ^= System.GetHashCode();
            }
            if (Counterparty.Length != 0)
            {
                hash ^= Counterparty.GetHashCode();
            }
            if (PortfolioId.Length != 0)
            {
                hash ^= PortfolioId.GetHashCode();
            }
            if (Volume != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Volume);
            }
            if (InstrumentId.Length != 0)
            {
                hash ^= InstrumentId.GetHashCode();
            }
            if (Price != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Price);
            }
            if (Currency.Length != 0)
            {
                hash ^= Currency.GetHashCode();
            }
            if (timestamp_ != null)
            {
                hash ^= Timestamp.GetHashCode();
            }
            hash ^= AdditionalData.GetHashCode();
            if (SystemTradeId.Length != 0)
            {
                hash ^= SystemTradeId.GetHashCode();
            }
            if (UniqueTradeId.Length != 0)
            {
                hash ^= UniqueTradeId.GetHashCode();
            }
            if (Desk.Length != 0)
            {
                hash ^= Desk.GetHashCode();
            }
            if (ExchangeTradeId.Length != 0)
            {
                hash ^= ExchangeTradeId.GetHashCode();
            }
            if (MarketTrade != false)
            {
                hash ^= MarketTrade.GetHashCode();
            }
            if (AlgoId.Length != 0)
            {
                hash ^= AlgoId.GetHashCode();
            }
            if (Strategy.Length != 0)
            {
                hash ^= Strategy.GetHashCode();
            }
            if (Owner.Length != 0)
            {
                hash ^= Owner.GetHashCode();
            }
            if (ClearerAccount.Length != 0)
            {
                hash ^= ClearerAccount.GetHashCode();
            }
            if (Depot.Length != 0)
            {
                hash ^= Depot.GetHashCode();
            }
            if (Safekeeping.Length != 0)
            {
                hash ^= Safekeeping.GetHashCode();
            }
            if (Deleted != false)
            {
                hash ^= Deleted.GetHashCode();
            }
            if (FundingCurrency.Length != 0)
            {
                hash ^= FundingCurrency.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #21
0
        /// <summary>
        /// Returns a System.String containing an Xml representation of the specified property of the current object
        /// </summary>
        /// <param name="property">name of a specific property that is to be written out as Xml.
        /// If this value is filled in, only the <id/> node and the node for property are output.
        /// At the time of this writing, this is only used for product_pictures.
        /// </param>
        /// <returns></returns>
        public string ToXml(string property)
        {
            var xml = new XElement(_objectName);

            xml.Add(new XElement("id", Id.ToString()));

            if ((property == null || property == "product_type_id") && LogBits.BitTest(Enums.Logfield.ProductTypeId))
            {
                xml.Add(new XElement("product_type_id", (int)ProductTypeId));
            }

            if ((property == null || property == "name_nl") && Name_NL != null && LogBits.BitTest(Enums.Logfield.PublicProductName_NL))
            {
                xml.Add(new XElement("name_nl", Name_NL));
            }

            //if ((property == null || property == "name_en") && Name_EN != null && LogBits.BitTest(Enums.Logfield.PublicProductName_EN))
            //    xml.Add(new XElement("name_en", Name_EN));

            if ((property == null || property == "songs") && LogBits.BitTest(Enums.Logfield.SongSortOrder))
            {
                xml.Add(new XElement("songs", from song in Songs
                                     select new XElement(XElement.Parse(song.ToXml()))));
            }

            if ((property == null || property == "subtitle_nl") && LogBits.BitTest(Enums.Logfield.Subtitle_NL))
            {
                xml.Add(new XElement("subtitle_nl", Subtitle_NL));
            }

            if ((property == null || property == "author_id") && LogBits.BitTest(Enums.Logfield.AuthorId))
            {
                xml.Add(new XElement("author_id", AuthorId.ToString()));
            }

            if ((property == null || property == "arranger_id") && LogBits.BitTest(Enums.Logfield.ArrangerId))
            {
                xml.Add(new XElement("arranger_id", ArrangerId.ToString()));
            }

            if ((property == null || property == "manufacturer_id") && LogBits.BitTest(Enums.Logfield.ManufacturerId))
            {
                xml.Add(new XElement("manufacturer_id", ManufacturerId.ToString()));
            }

            if ((property == null || property == "instrument_id") && LogBits.BitTest(Enums.Logfield.InstrumentId))
            {
                xml.Add(new XElement("instrument_id", InstrumentId.ToString()));
            }

            if ((property == null || property == "sell_price") && !SalesPrice.IsNullOrZero() && LogBits.BitTest(Enums.Logfield.SalesPrice))
            {
                xml.Add(new XElement("sell_price", SalesPrice));
            }

            if ((property == null || property == "reference") && LogBits.BitTest(Enums.Logfield.ReferenceNumber))
            {
                xml.Add(new XElement("reference", ReferenceNumber));
            }

            if ((property == null || property == "isbn") && LogBits.BitTest(Enums.Logfield.Isbn))
            {
                xml.Add(new XElement("isbn", Isbn));
            }

            if ((property == null || property == "ismn") && LogBits.BitTest(Enums.Logfield.Ismn))
            {
                xml.Add(new XElement("ismn", Ismn));
            }

            if ((property == null || property == "ean") && LogBits.BitTest(Enums.Logfield.Ean))
            {
                xml.Add(new XElement("ean", Ean));
            }

            if ((property == null || property == "upc") && LogBits.BitTest(Enums.Logfield.Upc))
            {
                xml.Add(new XElement("upc", Upc));
            }

            if ((property == null || property == "language_id") && LogBits.BitTest(Enums.Logfield.LanguageId))
            {
                xml.Add(new XElement("language_id", LanguageId != null ? ((int)LanguageId).ToString() : String.Empty));
            }

            if ((property == null || property == "binding_id") && LogBits.BitTest(Enums.Logfield.BindingId))
            {
                xml.Add(new XElement("binding_id", BindingId.ToString()));
            }

            if ((property == null || property == "grade_level") && LogBits.BitTest(Enums.Logfield.GradeLevel))
            {
                xml.Add(new XElement("grade_level", GradeLevel));
            }

            if ((property == null || property == "product_series_id") && LogBits.BitTest(Enums.Logfield.SeriesId))
            {
                xml.Add(new XElement("product_series_id", SeriesId.ToString()));
            }

            if ((property == null || property == "nr_of_pages") && LogBits.BitTest(Enums.Logfield.Pages))
            {
                xml.Add(new XElement("nr_of_pages", Pages.ToString()));
            }

            if ((property == null || property == "tax_rate_id") && LogBits.BitTest(Enums.Logfield.TaxRateId))
            {
                xml.Add(new XElement("tax_rate_id", ((int)TaxRateId).ToString()));
            }

            if ((property == null || property == "product_pictures") && LogBits.BitTest(Enums.Logfield.ProductPictureFilename))
            {
                xml.Add(new XElement("product_pictures", from picture in ProductPictures
                                     select new XElement(XElement.Parse(picture.ToXml()))));
            }

            if ((property == null || property == "description_nl") && LogBits.BitTest(Enums.Logfield.Description_NL))
            {
                xml.Add(new XElement("description_nl", Description_NL));
            }

            if ((property == null || property == "weight") && LogBits.BitTest(Enums.Logfield.Weight))
            {
                xml.Add(new XElement("weight", Weight.ToString()));
            }

            if ((property == null || property == "length") && LogBits.BitTest(Enums.Logfield.Length))
            {
                xml.Add(new XElement("length", Length.ToString()));
            }

            if ((property == null || property == "width") && LogBits.BitTest(Enums.Logfield.Width))
            {
                xml.Add(new XElement("width", Width.ToString()));
            }

            if ((property == null || property == "height") && LogBits.BitTest(Enums.Logfield.Height))
            {
                xml.Add(new XElement("height", Height.ToString()));
            }

            if ((property == null || property == "product_categories") && LogBits.BitTest(Enums.Logfield.ProductCategory))
            {
                xml.Add(new XElement("product_categories", from category in ProductCategories
                                     select new XElement("product_category", new XElement("id", category.Id),
                                                         new XElement("test", Test.ToInt()))));
            }

            if ((property == null || property == "internal_stock_qty") && LogBits.BitTest(Enums.Logfield.InternalStock))
            {
                xml.Add(new XElement("internal_stock_qty", InternalStock.ToString()));
            }

            if ((property == null || property == "external_stock_qty") && LogBits.BitTest(Enums.Logfield.ExternalStock))
            {
                xml.Add(new XElement("external_stock_qty", ExternalStock != null ? ExternalStock.ToString() : "1"));
            }

            if ((property == null || property == "supplier_id") && LogBits.BitTest(Enums.Logfield.SupplierId))
            {
                xml.Add(new XElement("supplier_id", SupplierId.ToString()));
            }

            if ((property == null || property == "promotion") && LogBits.BitTest(Enums.Logfield.Promotion))
            {
                xml.Add(new XElement("promotion", Promotion.ToInt().ToString()));
            }

            if ((property == null || property == "highlight_on_home") && LogBits.BitTest(Enums.Logfield.HighlightOnHome))
            {
                xml.Add(new XElement("highlight_on_home", HighlightOnHome.ToInt().ToString()));
            }

            if ((property == null || property == "available") && LogBits.BitTest(Enums.Logfield.ActiveInWebshop))
            {
                xml.Add(new XElement("available", ActiveInWebshop.ToInt().ToString()));
            }

            if ((property == null || property == "bestseller") && LogBits.BitTest(Enums.Logfield.BestSeller))
            {
                xml.Add(new XElement("bestseller", BestSeller.ToInt().ToString()));
            }

            if ((property == null || property == "minimum_order_qty") && LogBits.BitTest(Enums.Logfield.MinimumOrderQty))
            {
                xml.Add(new XElement("minimum_order_qty", (MinimumOrderQuantity != 0) ? MinimumOrderQuantity.ToString() : String.Empty));
            }

            if ((property == null || property == "teacher_discount") && LogBits.BitTest(Enums.Logfield.WebshopTeacherDiscount))
            {
                xml.Add(new XElement("teacher_discount", TeacherDiscount.ToString()));
            }

            if ((property == null || property == "reseller_discount") && LogBits.BitTest(Enums.Logfield.WebshopResellerDiscount))
            {
                xml.Add(new XElement("reseller_discount", ResellerDiscount.ToString()));
            }

            if ((property == null || property == "search_keywords") && LogBits.BitTest(Enums.Logfield.SearchKeywords))
            {
                xml.Add(new XElement("search_keywords", SearchKeywords));
            }

            if ((property == null || property == "store_pickup_only") && LogBits.BitTest(Enums.Logfield.StorePickupOnly))
            {
                xml.Add(new XElement("store_pickup_only", StorePickupOnly.ToInt().ToString()));
            }

            if ((property == null || property == "test"))
            {
                xml.Add(new XElement("test", Test.ToInt()));
            }

            if ((property == null || property == "created") && LogBits.BitTest(Enums.Logfield.CreateDttm))
            {
                xml.Add(new XElement("created", (!CreatedDttm.IsNullOrDefault()) ? ((DateTime)CreatedDttm).ToString("yyyy-MM-dd HH:mm:ss") : String.Empty));
            }

            if ((property == null || property == "updated") && LogBits.BitTest(Enums.Logfield.UpdateDttm))
            {
                xml.Add(new XElement("updated", (!UpdatedDttm.IsNullOrDefault()) ? ((DateTime)UpdatedDttm).ToString("yyyy-MM-dd HH:mm:ss") : String.Empty));
            }

            if ((property == null || property == "deleted") && LogBits.BitTest(Enums.Logfield.DeleteDttm))
            {
                xml.Add(new XElement("deleted", (!DeletedDttm.IsNullOrDefault()) ? ((DateTime)DeletedDttm).ToString("yyyy-MM-dd HH:mm:ss") : String.Empty));
            }

            string xmlString = xml.ToString();

            return(xmlString);
        }
コード例 #22
0
 public override string ToString() => $"{DateTime} {Instrument?.Symbol ?? InstrumentId.ToString()} {ExecType} {Side} {LastPx}";
コード例 #23
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (BrokerId.Length != 0)
            {
                hash ^= BrokerId.GetHashCode();
            }
            if (InvestorId.Length != 0)
            {
                hash ^= InvestorId.GetHashCode();
            }
            if (UserId.Length != 0)
            {
                hash ^= UserId.GetHashCode();
            }
            if (InstrumentId.Length != 0)
            {
                hash ^= InstrumentId.GetHashCode();
            }
            if (ExchangeId.Length != 0)
            {
                hash ^= ExchangeId.GetHashCode();
            }
            if (OrderPriceType != 0)
            {
                hash ^= OrderPriceType.GetHashCode();
            }
            if (Direction != 0)
            {
                hash ^= Direction.GetHashCode();
            }
            if (CombOffsetFlag != 0)
            {
                hash ^= CombOffsetFlag.GetHashCode();
            }
            if (CombHedgeFlag != 0)
            {
                hash ^= CombHedgeFlag.GetHashCode();
            }
            if (LimitPrice != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(LimitPrice);
            }
            if (VolumeTotalOriginal != 0)
            {
                hash ^= VolumeTotalOriginal.GetHashCode();
            }
            if (TimeCondition != 0)
            {
                hash ^= TimeCondition.GetHashCode();
            }
            if (VolumeCondition != 0)
            {
                hash ^= VolumeCondition.GetHashCode();
            }
            if (MinVolume != 0)
            {
                hash ^= MinVolume.GetHashCode();
            }
            if (ContigentCondition != 0)
            {
                hash ^= ContigentCondition.GetHashCode();
            }
            if (StopPrice != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(StopPrice);
            }
            if (ForceCloseReason != 0)
            {
                hash ^= ForceCloseReason.GetHashCode();
            }
            if (IsAutoSuspend != 0)
            {
                hash ^= IsAutoSuspend.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #24
0
 public override string ToString() => $"{DateTime} {GetSideAsString()} {Instrument?.Symbol ?? InstrumentId.ToString()} {Qty} {Price} {Text}";
 public override int GetHashCode()
 {
     return
         (InstrumentId.GetHashCode() ^
          (Name ?? string.Empty).GetHashCode());
 }
コード例 #26
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (BrokerId.Length != 0)
            {
                hash ^= BrokerId.GetHashCode();
            }
            if (InvestorId.Length != 0)
            {
                hash ^= InvestorId.GetHashCode();
            }
            if (InstrumentId.Length != 0)
            {
                hash ^= InstrumentId.GetHashCode();
            }
            if (OrderRef.Length != 0)
            {
                hash ^= OrderRef.GetHashCode();
            }
            if (UserId.Length != 0)
            {
                hash ^= UserId.GetHashCode();
            }
            if (TradeId.Length != 0)
            {
                hash ^= TradeId.GetHashCode();
            }
            if (Direction != 0)
            {
                hash ^= Direction.GetHashCode();
            }
            if (OffsetFlag != 0)
            {
                hash ^= OffsetFlag.GetHashCode();
            }
            if (HedgeFlag != 0)
            {
                hash ^= HedgeFlag.GetHashCode();
            }
            if (Price != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Price);
            }
            if (Volume != 0)
            {
                hash ^= Volume.GetHashCode();
            }
            if (TradeDate.Length != 0)
            {
                hash ^= TradeDate.GetHashCode();
            }
            if (TradeTime.Length != 0)
            {
                hash ^= TradeTime.GetHashCode();
            }
            if (OrderLocalId.Length != 0)
            {
                hash ^= OrderLocalId.GetHashCode();
            }
            if (TradingDay.Length != 0)
            {
                hash ^= TradingDay.GetHashCode();
            }
            if (BrokerOrderSeq != 0)
            {
                hash ^= BrokerOrderSeq.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #27
0
 public override string ToString() => $"{DateTime} {Type} {Instrument?.Symbol ?? InstrumentId.ToString()} {Side} {OrdType} {Qty}";
コード例 #28
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (InstrumentId.Length != 0)
            {
                hash ^= InstrumentId.GetHashCode();
            }
            if (ExchangeId.Length != 0)
            {
                hash ^= ExchangeId.GetHashCode();
            }
            if (InstrumentName.Length != 0)
            {
                hash ^= InstrumentName.GetHashCode();
            }
            if (ProductId.Length != 0)
            {
                hash ^= ProductId.GetHashCode();
            }
            if (ProductClass != 0)
            {
                hash ^= ProductClass.GetHashCode();
            }
            if (DeliveryYear != 0)
            {
                hash ^= DeliveryYear.GetHashCode();
            }
            if (DeliveryMonth != 0)
            {
                hash ^= DeliveryMonth.GetHashCode();
            }
            if (MaxMarketOrderVolume != 0)
            {
                hash ^= MaxMarketOrderVolume.GetHashCode();
            }
            if (MinMarketOrderVolume != 0)
            {
                hash ^= MinMarketOrderVolume.GetHashCode();
            }
            if (MaxLimitOrderVolume != 0)
            {
                hash ^= MaxLimitOrderVolume.GetHashCode();
            }
            if (MinLimitOrderVolume != 0)
            {
                hash ^= MinLimitOrderVolume.GetHashCode();
            }
            if (VolumeMultiple != 0)
            {
                hash ^= VolumeMultiple.GetHashCode();
            }
            if (PriceTick != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(PriceTick);
            }
            if (CreateDate.Length != 0)
            {
                hash ^= CreateDate.GetHashCode();
            }
            if (OpenDate.Length != 0)
            {
                hash ^= OpenDate.GetHashCode();
            }
            if (ExpireDate.Length != 0)
            {
                hash ^= ExpireDate.GetHashCode();
            }
            if (StartDelivDate.Length != 0)
            {
                hash ^= StartDelivDate.GetHashCode();
            }
            if (EndDelivDate.Length != 0)
            {
                hash ^= EndDelivDate.GetHashCode();
            }
            if (IsTrading != false)
            {
                hash ^= IsTrading.GetHashCode();
            }
            if (UnderlyingMultiple != 0)
            {
                hash ^= UnderlyingMultiple.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #29
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (TradingDay.Length != 0)
            {
                hash ^= TradingDay.GetHashCode();
            }
            if (InstrumentId.Length != 0)
            {
                hash ^= InstrumentId.GetHashCode();
            }
            if (ExchangeId.Length != 0)
            {
                hash ^= ExchangeId.GetHashCode();
            }
            if (LastPrice != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(LastPrice);
            }
            if (PreSettlementPrice != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(PreSettlementPrice);
            }
            if (PreClosePrice != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(PreClosePrice);
            }
            if (PreOpenInterest != 0)
            {
                hash ^= PreOpenInterest.GetHashCode();
            }
            if (OpenPrice != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(OpenPrice);
            }
            if (HighestPrice != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(HighestPrice);
            }
            if (LowestPrice != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(LowestPrice);
            }
            if (Volume != 0)
            {
                hash ^= Volume.GetHashCode();
            }
            if (TurnOver != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(TurnOver);
            }
            if (OpenInterest != 0)
            {
                hash ^= OpenInterest.GetHashCode();
            }
            if (ClosePrice != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(ClosePrice);
            }
            if (SettlementPrice != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(SettlementPrice);
            }
            if (UpperLimitPrice != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(UpperLimitPrice);
            }
            if (LowerLimitPrice != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(LowerLimitPrice);
            }
            if (UpdateTime.Length != 0)
            {
                hash ^= UpdateTime.GetHashCode();
            }
            if (UpdateMillisec != 0)
            {
                hash ^= UpdateMillisec.GetHashCode();
            }
            if (AveragePrice != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(AveragePrice);
            }
            if (ActionDay.Length != 0)
            {
                hash ^= ActionDay.GetHashCode();
            }
            if (BidPrice != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(BidPrice);
            }
            if (BidVolume != 0)
            {
                hash ^= BidVolume.GetHashCode();
            }
            if (AskPrice != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(AskPrice);
            }
            if (AskVolume != 0)
            {
                hash ^= AskVolume.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }