|
From: Luigi B. <lui...@gm...> - 2019-03-11 16:31:23
|
You can use the InterpolatedForwardCurve class, which is used
underneath PiecewiseYieldCurve when you select the ForwardRate traits.
Once you bootstrap your curve, extract curve.dates(), curve.forwards()
and curve.dayCounter() and serialize them. Later, deserialize them
and pass them to the InterpolatedForwardCurve constructor. You'll
have to instantiate it with the same interpolator you used for the
bootstrap, so, for instance, PiecewiseYieldCurve<ForwardRate,
BackwardFlat> can be deserialized into an
InterpolatedForwardCurve<BackwardFlat>.
Other traits have corresponding interpolated curves.
Hope this helps,
Luigi
On Fri, Mar 1, 2019 at 5:50 PM rajs1 <raj...@ho...> wrote:
>
> I have seen quite a few older posts on this. What I am trying to do is to send the curve(s) data (in AVRO) along with the swaptrade (AVRO) together. I want to avoid the bootstrap process - so want to resurrect YieldTermStructure from, say, forward rates From 2012, this link: http://quantlib.10058.n7.nabble.com/How-to-construct-a-curve-from-forward-rates-by-using-function-qlInterpolatedYieldCurve-td5242.html talks about building a PiecewiseYieldCurve with TraitsID=ForwardRate. The curve points will be represented internally as forward rates from which - I presume - one could get back to YieldTermStructure. However, most examples deal with QuantlibXL addin. Is there anyone who could point me to a bare bones C++ skeleton (on which I can build and test please)? If there are alternative ideas - I am happy to try and even post back blogs for posterity. Thanks in advance
> ________________________________
> Sent from the quantlib-dev mailing list archive at Nabble.com.
> _______________________________________________
> QuantLib-dev mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
|