|
From: Luigi B. <lui...@gm...> - 2011-01-22 14:59:43
|
On Jan 20, 2011, at 8:03 PM, Leon Sit wrote: > In quantlib, is there a way to query the last fixing date of a swap > with respect to the evaluation date? Yes, but it's kind of complex. You'll have to: - ask the swap for its floating leg; if it's a VanillaSwap, call its floatingLeg() method; if it's a generic Swap, use the leg(i) method by passing the correct index; - get a pointer to the last CashFlow; that's leg.back() - downcast it to FloatingRateCoupon; that's coupon = boost::dynamic_pointer_cast<FloatingRateCoupon>(leg.back()); - now you can use its fixingDate() method. Luigi |