QLNet.IndexedCashFlow.amount C# (CSharp) Метод

amount() публичный Метод

public amount ( ) : double
Результат double
        public override double amount()
        {
            double I0 = _index.fixing(_baseDate);
            double I1 = _index.fixing(_fixingDate);

            return _growthOnly ? _notional * (I1 / I0 - 1.0) : _notional * (I1 / I0);
        }

Usage Example

        public double fairRate()
        {
            // What does this mean before or after trade date?
            // Always means that NPV is zero for _this_ instrument
            // if it was created with _this_ rate
            // _knowing_ the time from base to obs (etc).

            IndexedCashFlow icf = legs_[1][0] as IndexedCashFlow;

            if (icf == null)
            {
                throw new ApplicationException("failed to downcast to IndexedCashFlow in ::fairRate()");
            }

            // +1 because the IndexedCashFlow has growthOnly=true
            double growth = icf.amount() / icf.notional() + 1.0;
            double T      = Utils.inflationYearFraction(infIndex_.frequency(),
                                                        infIndex_.interpolated(),
                                                        dayCounter_, baseDate_, obsDate_);

            return(Math.Pow(growth, 1.0 / T) - 1.0);

            // we cannot use this simple definition because
            // it does not work for already-issued instruments
            // return infIndex_->zeroInflationTermStructure()->zeroRate(
            //      maturityDate(), observationLag(), infIndex_->interpolated());
        }
All Usage Examples Of QLNet.IndexedCashFlow::amount