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

index gearing, i.e. multiplicative coefficient for the index
public gearing ( ) : double
Результат double
Пример #1
0
        public override void setupArguments(IPricingEngineArguments args)
        {
            YoYInflationCapFloor.Arguments arguments = args as YoYInflationCapFloor.Arguments;
            Utils.QL_REQUIRE(arguments != null, () => "wrong argument type");

            int n = yoyLeg_.Count;

            arguments.startDates   = new List <Date>(n);
            arguments.fixingDates  = new List <Date>(n);
            arguments.payDates     = new List <Date>(n);
            arguments.accrualTimes = new List <double>(n);
            arguments.nominals     = new List <double>(n);
            arguments.gearings     = new List <double>(n);
            arguments.capRates     = new List <double?>(n);
            arguments.floorRates   = new List <double?>(n);
            arguments.spreads      = new List <double>(n);

            arguments.type = type_;

            for (int i = 0; i < n; ++i)
            {
                YoYInflationCoupon coupon = yoyLeg_[i] as YoYInflationCoupon;
                Utils.QL_REQUIRE(coupon != null, () => "non-YoYInflationCoupon given");
                arguments.startDates.Add(coupon.accrualStartDate());
                arguments.fixingDates.Add(coupon.fixingDate());
                arguments.payDates.Add(coupon.date());

                // this is passed explicitly for precision
                arguments.accrualTimes.Add(coupon.accrualPeriod());

                arguments.nominals.Add(coupon.nominal());
                double spread  = coupon.spread();
                double gearing = coupon.gearing();
                arguments.gearings.Add(gearing);
                arguments.spreads.Add(spread);

                if (type_ == CapFloorType.Cap || type_ == CapFloorType.Collar)
                {
                    arguments.capRates.Add((capRates_[i] - spread) / gearing);
                }
                else
                {
                    arguments.capRates.Add(null);
                }

                if (type_ == CapFloorType.Floor || type_ == CapFloorType.Collar)
                {
                    arguments.floorRates.Add((floorRates_[i] - spread) / gearing);
                }
                else
                {
                    arguments.floorRates.Add(null);
                }
            }
        }
Пример #2
0
        public override void initialize(InflationCoupon coupon)
        {
            coupon_ = coupon as YoYInflationCoupon;
            gearing_ = coupon_.gearing();
            spread_ = coupon_.spread();
            PaymentDate = coupon_.Date;
            YoYInflationIndex y = (YoYInflationIndex)(coupon.index());
            RateCurve = y.yoyInflationTermStructure().link.nominalTermStructure();

            // past or future fixing is managed in YoYInflationIndex::fixing()
            // use yield curve from index (which sets discount)

            discount_ = 1.0;
            if (PaymentDate > RateCurve.link.referenceDate())
                discount_ = RateCurve.link.discount(PaymentDate);

            spreadLegValue_ = spread_ * coupon_.accrualPeriod() * discount_;
        }
Пример #3
0
        // we may watch an underlying coupon ...
        public CappedFlooredYoYInflationCoupon(YoYInflationCoupon underlying,
                                               double?cap   = null,
                                               double?floor = null)
            : base(underlying.date(),
                   underlying.nominal(),
                   underlying.accrualStartDate(),
                   underlying.accrualEndDate(),
                   underlying.fixingDays(),
                   underlying.yoyIndex(),
                   underlying.observationLag(),
                   underlying.dayCounter(),
                   underlying.gearing(),
                   underlying.spread(),
                   underlying.referencePeriodStart,
                   underlying.referencePeriodEnd)

        {
            underlying_ = underlying;
            isFloored_  = false;
            isCapped_   = false;
            setCommon(cap, floor);
            underlying.registerWith(update);
        }
    // we may watch an underlying coupon ...
    public CappedFlooredYoYInflationCoupon(YoYInflationCoupon underlying,
                                           double? cap = null,
                                           double? floor = null)
       :base(underlying.date(),
             underlying.nominal(),
             underlying.accrualStartDate(),
             underlying.accrualEndDate(),
             underlying.fixingDays(),
             underlying.yoyIndex(),
             underlying.observationLag(),
             underlying.dayCounter(),
             underlying.gearing(),
             underlying.spread(),
             underlying.refPeriodStart,
             underlying.refPeriodEnd)
 
    {
       underlying_ = underlying;
       isFloored_ = false;
       isCapped_ = false;
       setCommon(cap, floor);
       underlying.registerWith(update);
    }
Пример #5
0
 public CappedFlooredYoYInflationCoupon(YoYInflationCoupon underlying, double?cap, double?floor)
     : this(underlying.Date, underlying.nominal(), underlying.accrualStartDate(), underlying.accrualEndDate(), underlying.fixingDays(), underlying.yoyIndex(), underlying.observationLag(), underlying.dayCounter(), underlying.gearing(), underlying.spread(), null, null, underlying.refPeriodStart, underlying.refPeriodEnd)
 {
     underlying_ = underlying;
     setCommon(cap, floor);
     underlying.registerWith(update);
 }