http://quantlib.414.s1.nabble.com/OvernightIndexedSwap-in-Python-tp15920p15975.html
OvernightIndexedSwap is not exported at this time. If you want to
> Hi All
>
> Is is possible to create an OIS object OvernightIndexedSwap in python?
> Creating a curve is possible, but creating a swap and hence finding
> fairRate() or NPV() is eluding me at the moment.
>
> In the code below I have used "OvernightIndexedSwap" but this is undefined
> in python quantlib.
>
> Many thanks
>
> from QuantLib import *
>
> settlementDate = Date(18,9,2014);
> maturity = Date(18,9,2016)
> nominal = 1000000
> fixedRate = 0.025
> dayCount = Actual365Fixed()
> spread = 0
>
> discountTermStructure = RelinkableYieldTermStructureHandle()
> forecastTermStructure = RelinkableYieldTermStructureHandle()
>
> MyOisHelper = [OISRateHelper( 0,
> Period(6,Months),QuoteHandle(SimpleQuote(0.02)), Sonia() ),OISRateHelper( 0,
> Period(3,Years),QuoteHandle(SimpleQuote(0.03)), Sonia() )]
>
> OISSwapCurve = PiecewiseFlatForward(settlementDate, MyOisHelper, dayCount)
>
> swapEngine = DiscountingSwapEngine(discountTermStructure)
>
> print OISSwapCurve.discount(Date(21,12,2013))
>
> fixedSchedule = Schedule(settlementDate,maturity, Annual, UnitedKingdom(),
> ModifiedFollowing, ModifiedFollowing, DateGeneration.Forward, False)
>
> ois_swap = *OvernightIndexedSwap(OvernightIndexedSwap.Payer*, nominal,
> fixedSchedule, fixedRate, dayCount, Sonia(), spread);
>
> ois_swap.setPricingEngine(swapEngine)
>
> swapEngine = DiscountingSwapEngine(discountTermStructure)
>
> discountTermStructure.linkTo(OISSwapCurve)
> forecastTermStructure.linkTo(OISSwapCurve)
>
>
>
> print ois_swap.NPV();
> print ois_swap.fairRate();
>
>
>
>
> --
> View this message in context:
http://quantlib.10058.n7.nabble.com/OvernightIndexedSwap-in-Python-tp15920.html> Sent from the quantlib-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
>
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk> _______________________________________________
> QuantLib-users mailing list
>
[hidden email]
>
https://lists.sourceforge.net/lists/listinfo/quantlib-users