Bond Engine Serialization

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Bond Engine Serialization

Lapin
This post was updated on .
Hi,

I have a weird issue with the serialization of the bonds...

I do a very simple fixed rate bond in an XL sheet. Everything is alright, as per the NPV.
Then I serialize it, and the xml is created as hoped.
Next step, you open a new excel, and load the xml, and all the objects are created as expected.

The issue appears when you want to calculate the NPV. If you run the qlInstrumentNPV function on the
bond, the null pricing engine error message appears. It mean that the engine is not linked with the bond.

To make it work, you have to run the qlInstrumentSetPricingEngine function, and then everything is back on track.

I have done the same exercice with a swaption, and I don't need to run the qlInstrumentSetPricingEngine function to get my NPV.

Is this the standard behavior or is there something I am missing?
For reference, I have attached the xml (I use the last QL and QLXL version)...

Thanks




<boost_serialization signature="serialization::archive" version="9">
<object_list class_id="1" tracking_level="1" version="0" object_id="_0">
<count>3</count>
<item_version>1</item_version>
<item class_id="0" tracking_level="0" version="1">
<px class_id="193" tracking_level="1" version="0" object_id="_1">
<ObjectId>TEST@FloatingSchedule</ObjectId>
<ClassName>qlSchedule</ClassName>
<EffectiveDate class_id="244" tracking_level="0" version="0">
<which>4</which>
<value>40417</value>
</EffectiveDate>
<TerminationDate>
<which>4</which>
<value>41513</value>
</TerminationDate>
<Tenor>3M</Tenor>
<Calendar>TARGET</Calendar>
<Convention>Modified Following</Convention>
<TermDateConv>Modified Following</TermDateConv>
<GenRule>Forward</GenRule>
<EndOfMonth>0</EndOfMonth>
<FirstDate>
<which>0</which>
<value class_id="245" tracking_level="0" version="0"/>
</FirstDate>
<NextToLastDate>
<which>0</which>
<value/>
</NextToLastDate>
<Permanent>0</Permanent>
<UserProperties class_id="246" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</UserProperties>
</px>
</item>
<item>
<px class_id="156" tracking_level="1" version="0" object_id="_2">
<ObjectId>TEST@Engine</ObjectId>
<ClassName>qlBondEngine</ClassName>
<YieldCurve>EURYC3m_MID</YieldCurve>
<Permanent>0</Permanent>
<UserProperties>
<count>0</count>
<item_version>0</item_version>
</UserProperties>
</px>
</item>
<item>
<px class_id="13" tracking_level="1" version="0" object_id="_3">
<ObjectId>TEST</ObjectId>
<ClassName>qlFixedRateBond</ClassName>
<Description/>
<Currency>EUR</Currency>
<SettlementDays>0</SettlementDays>
<FaceAmount>100</FaceAmount>
<ScheduleID>TEST@FloatingSchedule</ScheduleID>
<Coupons>
<count>1</count>
<item_version>0</item_version>
<item>0.02</item>
</Coupons>
<DayCounter>Act/360</DayCounter>
<PaymentBDC>Following</PaymentBDC>
<Redemption>100</Redemption>
<IssueDate>
<which>4</which>
<value>40417</value>
</IssueDate>
<PaymentCalendar>TARGET</PaymentCalendar>
<Permanent>0</Permanent>
<UserProperties>
<count>1</count>
<item_version>0</item_version>
<item class_id="248" tracking_level="0" version="0">
<first>EngineID</first>
<second>
<which>2</which>
<value>TEST@Engine</value>
</second>
</item>
</UserProperties>
</px>
</item>
</object_list>
</boost_serialization>