コード例 #1
0
ファイル: DepositConvention.cs プロジェクト: QLNetRisk/Engine
 public virtual void Build()
 {
     _calendar       = Parsers.ParseCalendar(_strCalendar);
     _convention     = Parsers.ParseBusinessDayConvention(_strConvention);
     _eom            = Parsers.ParseBool(_strEom);
     _dayCounter     = Parsers.ParseDayCounter(_strDayCounter);
     _settlementDays = Parsers.ParseInteger(_strSettlementDays);
 }
コード例 #2
0
ファイル: FXConvention.cs プロジェクト: QLNetRisk/Engine
 public virtual void Build()
 {
     _spotDays        = Parsers.ParseInteger(_strSpotDays);
     _sourceCurrency  = Parsers.ParseCurrency(_strSourceCurrency);
     _targetCurrency  = Parsers.ParseCurrency(_strTargetCurrency);
     _pointsFactor    = Parsers.ParseDouble(_strPointsFactor);
     _advanceCalendar = _strAdvanceCalendar == "" ? new NullCalendar() : Parsers.ParseCalendar(_strAdvanceCalendar);
     _spotRelative    = _strSpotRelative == "" ? true : Parsers.ParseBool(_strSpotRelative);
 }
コード例 #3
0
        public virtual void Build()
        {
            _dayCounter           = Parsers.ParseDayCounter(_strDayCounter);
            _compounding          = _strCompounding == string.Empty ? QLNet.Compounding.Continuous : Parsers.ParseCompounding(_strCompounding);
            _compoundingFrequency = _strCompoundingFrequency == string.Empty ? Frequency.Annual : Parsers.ParseFrequency(_strCompoundingFrequency);

            if (_tenorBased)
            {
                _tenorCalendar  = Parsers.ParseCalendar(_strTenorCalendar);
                _spotLag        = Convert.ToInt32(_strSpotLag);
                _spotCalendar   = Parsers.ParseCalendar(_strSpotCalendar);
                _rollConvention = Parsers.ParseBusinessDayConvention(_strRollConvention);
                _eom            = Parsers.ParseBool(_strEom);
            }
        }
コード例 #4
0
        public virtual void Build()
        {
            // First check that we have an overnight index.
            _index = (OvernightIndex)Parsers.ParseIborIndex(_strIndex);
            Utils.QL_REQUIRE(_index != null, () => "The index string, " + _strIndex + ", does not represent an overnight index.");

            _spotLag                = Parsers.ParseInteger(_strSpotLag);
            _fixedDayCounter        = Parsers.ParseDayCounter(_strFixedDayCounter);
            _paymentLag             = _strPaymentLag == string.Empty ? 0 : Parsers.ParseInteger(_strPaymentLag);
            _eom                    = _strEom == string.Empty ? false : Parsers.ParseBool(_strEom);
            _fixedFrequency         = _strFixedFrequency == string.Empty ? Frequency.Annual : Parsers.ParseFrequency(_strFixedFrequency);
            _fixedConvention        = _strFixedConvention == string.Empty ? BusinessDayConvention.Following : Parsers.ParseBusinessDayConvention(_strFixedConvention);
            _fixedPaymentConvention = _strFixedPaymentConvention == string.Empty ? BusinessDayConvention.Following : Parsers.ParseBusinessDayConvention(_strFixedPaymentConvention);
            //_rule = _strRule == string.Empty ? DateGeneration.Rule.Backward : Parsers.ParseDateGenerationRule(_strRule);
        }
コード例 #5
0
        public virtual bool GetChildValueAsBool(XmlNode node, string name, bool mandatory = false)
        {
            string s = GetChildValue(node, name, mandatory);

            return(s == "" ? true : Parsers.ParseBool(s));
        }