Loading...
Home / CMS Trade simulation

Home Forums Help CMS Trade simulation

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6290
    rkapl
    Participant

    Dear All!

    I’ve tried to set up a CMS Trade for xva simulation, I’m almost there, but now I’m stuck.
    I took the example 21 trades and (after struggling a while with the shift lognormal volatility, a better documentation on how to use shifts along with the sln_rates would have helped here) got a first problem with the <Simulate>false</Simulate> in the simulation.xml (This is a left over in my simulation.xml, I thought it didn’t hurt to leave it in), the error message (after a crash) was:

    NOTICE [2018-Mar-22 16:52:35.261924] (…rtfolio\portfolio.cpp:44) : Parsing XML Input/portfolio_CMS.xml
    NOTICE [2018-Mar-22 16:52:35.263924] (…rtfolio\portfolio.cpp:46) : Loaded XML file
    DEBUG [2018-Mar-22 16:52:35.263924] (…rtfolio\portfolio.cpp:70) : Parsing trade id:CMS_Swap
    DEBUG [2018-Mar-22 16:52:35.264924] (…rtfolio\portfolio.cpp:81) : Added Trade CMS_Swap (CMS_Swap) class:Swap
    DEBUG [2018-Mar-22 16:52:35.265925] (…rtfolio\portfolio.cpp:70) : Parsing trade id:CMS_Cap
    DEBUG [2018-Mar-22 16:52:35.266925] (…rtfolio\portfolio.cpp:81) : Added Trade CMS_Cap (CMS_Cap) class:CapFloor
    NOTICE [2018-Mar-22 16:52:35.267925] (…rtfolio\portfolio.cpp:95) : Finished Parsing XML doc
    NOTICE [2018-Mar-22 16:52:35.268925] (…tfolio\portfolio.cpp:121) : Building Portfolio of size 2
    DEBUG [2018-Mar-22 16:52:35.270925] (ored\portfolio\swap.cpp:41) : Swap::build() called for trade CMS_Swap
    DEBUG [2018-Mar-22 16:52:35.271925] (ored\portfolio\swap.cpp:186) : Swap::build(): currency[0] = EUR
    DEBUG [2018-Mar-22 16:52:35.272925] (ored\portfolio\swap.cpp:186) : Swap::build(): currency[1] = EUR
    DEBUG [2018-Mar-22 16:52:35.273925] (ored\portfolio\swap.cpp:247) : Notional is 10000000.000000 EUR
    DEBUG [2018-Mar-22 16:52:35.275926] (ored\portfolio\swap.cpp:266) : Set instrument wrapper
    NOTICE [2018-Mar-22 16:52:35.276926] (…tfolio\portfolio.cpp:132) : Built Portfolio. Size now 2
    NOTICE [2018-Mar-22 16:52:35.320930] (orea\app\oreapp.cpp:670) : Build valuation cube engine
    NOTICE [2018-Mar-22 16:52:35.321930] (orea\app\oreapp.cpp:677) : Build cube
    NOTICE [2018-Mar-22 16:52:35.324930] (…e\valuationengine.cpp:66) : Starting ValuationEngine for 2 trades, 1000 samples and 236 dates.
    NOTICE [2018-Mar-22 16:52:35.326931] (…e\valuationengine.cpp:77) : Initialise state objects…
    DEBUG [2018-Mar-22 16:52:35.327931] (…e\valuationengine.cpp:83) : Initialise wrapper for trade CMS_Swap
    ALERT [2018-Mar-22 16:52:35.370935] (…luationcalculator.cpp:51) : Failed to price trade CMS_Swap : BlackVanillaOptionPricer: zero-shift lognormal volatility required
    DEBUG [2018-Mar-22 16:52:35.371935] (…e\valuationengine.cpp:83) : Initialise wrapper for trade CMS_Cap
    ALERT [2018-Mar-22 16:52:35.373935] (…luationcalculator.cpp:51) : Failed to price trade CMS_Cap : BlackVanillaOptionPricer: zero-shift lognormal volatility required
    NOTICE [2018-Mar-22 16:52:35.374935] (…\valuationengine.cpp:106) : Total number of swaps = 2
    NOTICE [2018-Mar-22 16:52:35.376936] (…\valuationengine.cpp:107) : Total number of FRC = 0
    NOTICE [2018-Mar-22 16:52:35.378936] (…ion\fixingmanager.cpp:92) : add index name for fixing history: EURLiborSwapIsdaFix30Y 30/360 (Bond Basis)
    NOTICE [2018-Mar-22 16:52:35.379936] (…ities\progressbar.cpp:99) : Building cube… 0 out of 1000 steps (0%) completed
    ALERT [2018-Mar-22 16:52:37.018100] (…luationcalculator.cpp:51) : Failed to price trade CMS_Swap : BlackVanillaOptionPricer: zero-shift lognormal volatility required

    When leaving this flag completely (as in the simulation.xml from example 21), ORE fails even before this point with message:

    NOTICE [2018-Mar-22 16:57:07.523148] (…rtfolio\portfolio.cpp:44) : Parsing XML Input/portfolio_CMS.xml
    NOTICE [2018-Mar-22 16:57:07.524148] (…rtfolio\portfolio.cpp:46) : Loaded XML file
    DEBUG [2018-Mar-22 16:57:07.526148] (…rtfolio\portfolio.cpp:70) : Parsing trade id:CMS_Swap
    DEBUG [2018-Mar-22 16:57:07.527148] (…rtfolio\portfolio.cpp:81) : Added Trade CMS_Swap (CMS_Swap) class:Swap
    DEBUG [2018-Mar-22 16:57:07.527148] (…rtfolio\portfolio.cpp:70) : Parsing trade id:CMS_Cap
    DEBUG [2018-Mar-22 16:57:07.529148] (…rtfolio\portfolio.cpp:81) : Added Trade CMS_Cap (CMS_Cap) class:CapFloor
    NOTICE [2018-Mar-22 16:57:07.530148] (…rtfolio\portfolio.cpp:95) : Finished Parsing XML doc
    NOTICE [2018-Mar-22 16:57:07.531148] (…tfolio\portfolio.cpp:121) : Building Portfolio of size 2
    DEBUG [2018-Mar-22 16:57:07.531148] (ored\portfolio\swap.cpp:41) : Swap::build() called for trade CMS_Swap
    DEBUG [2018-Mar-22 16:57:07.534149] (ored\portfolio\swap.cpp:186) : Swap::build(): currency[0] = EUR
    ALERT [2018-Mar-22 16:57:07.545150] (…tfolio\portfolio.cpp:128) : Error building trade (CMS_Swap) : did not find object EUR of type swaption curve under configuration collateral_eur
    ALERT [2018-Mar-22 16:57:07.548150] (…tfolio\portfolio.cpp:128) : Error building trade (CMS_Cap) : did not find object EUR of type swaption curve under configuration collateral_eur
    NOTICE [2018-Mar-22 16:57:07.549150] (…tfolio\portfolio.cpp:132) : Built Portfolio. Size now 0
    ALERT [2018-Mar-22 16:57:07.554151] (orea\app\oreapp.cpp:194) : Error: portfolio size mismatch, check simulation market setup

    When trying to run a simulation completely using the example’s config files, ORE fails already at building the simulation market:

    NOTICE [2018-Mar-22 17:03:39.907382] (orea\app\oreapp.cpp:701) : Build Simulation Market
    ….
    NOTICE [2018-Mar-22 17:03:40.001391] (…cenariosimmarket.cpp:305) : building GBP-LIBOR-6M index curve done
    NOTICE [2018-Mar-22 17:03:40.002392] (…cenariosimmarket.cpp:307) : index curves done
    NOTICE [2018-Mar-22 17:03:40.002392] (…cenariosimmarket.cpp:310) : building swap indices…
    NOTICE [2018-Mar-22 17:03:40.003392] (…cenariosimmarket.cpp:314) : Adding swap index EUR-CMS-1Y with discounting index EUR-EONIA
    ALERT [2018-Mar-22 17:03:40.017393] (orea\app\oreapp.cpp:194) : Error: Failure in MarketImpl::addSwapIndex() with index EUR-CMS-1Y : did not find object EUR-EURIBOR-3M of type ibor index under configuration default

    I thought CMS trades were supposed to work for xva?

    -regards,
    Roland

    #6293
    Peter Caspers
    Keymaster

    Hi Roland,

    some quick answers that will hopefully get you a step forward:

    a) for xva simulation you should use <Simulate>false</Simulate> for the swaption volatilities, since the cross asset scenario generator does not generate scenarios for the swaption volatilities.

    b) this message Failed to price trade CMS_Swap : BlackVanillaOptionPricer: zero-shift lognormal volatility required means that you try to use a “Hagan” Model for CMS, which only work for unshifted lognormal volatilities; if you switch to “LinearTSR”, all volatility variants should work

    c) did not find object EUR of type swaption curve under configuration collateral_eur => do you have the EUR swaption vols included in the simulation market configuration (under Market / SwaptionVolatilities)?

    d) did not find object EUR-EURIBOR-3M of type ibor index under configuration default => likewise, do you have the index in simulation.xml (under Market / Indices)?

    Best Regards
    Peter

    #6294
    rkapl
    Participant

    Hi Peter!

    Thank you for your answers, I managed to make the example 21 simulate with the hagan analytic engine now (adding <Simulate>false</Simulate> (answer a) and <Index>EUR-EURIBOR-3M</Index> to simulation.xml and using “default” instead of “libor” for all the markets parameters in ore.xml helped (answers c and d)).

    Probably all the CAPFLOOR/RATE_LNVOL marketdata (including the line CAPFLOOR/SHIFT/EUR/6M 0) are missing in marketdata.txt for the hagan analytic model as the log still spews a lot of “CMS_Swap : BlackVanillaOptionPricer: zero-shift lognormal volatility required” alerts (so I’m not confident as of the prices) at least ORE doesn’t crash anymore.

    However, using the suggested LinearTSR, I now get
    NOTICE [2018-Apr-12 11:12:56.280839] (…rtfolio\portfolio.cpp:44) : Parsing XML Input/portfolio_CMS.xml
    NOTICE [2018-Apr-12 11:12:56.280839] (…rtfolio\portfolio.cpp:46) : Loaded XML file
    NOTICE [2018-Apr-12 11:12:56.280839] (…rtfolio\portfolio.cpp:95) : Finished Parsing XML doc
    NOTICE [2018-Apr-12 11:12:56.280839] (…tfolio\portfolio.cpp:121) : Building Portfolio of size 2
    ALERT [2018-Apr-12 11:12:56.280839] (…tfolio\portfolio.cpp:128) : Error building trade (CMS_Swap) : invalid map<K, T> key
    ALERT [2018-Apr-12 11:12:56.280839] (…tfolio\portfolio.cpp:128) : Error building trade (CMS_Cap) : invalid map<K, T> key
    NOTICE [2018-Apr-12 11:12:56.280839] (…tfolio\portfolio.cpp:132) : Built Portfolio. Size now 0
    ALERT [2018-Apr-12 11:12:56.283839] (orea\app\oreapp.cpp:194) : Error: InMemoryCube::InMemoryCube no ids specified

    The code seems to fail in ORE\engine\OREData\ored\portfolio\builders\cms.cpp fetching two parameters, which seem to be missing in the example:

    boost::shared_ptr<FloatingRateCouponPricer> LinearTSRCmsCouponPricerBuilder::engineImpl(const Currency& ccy) {
    const string& ccyCode = ccy.code();
    Real rev = parseReal(engineParameters_.at(“MeanReversion”));
    string policy = engineParameters_.at(“Policy”);

    I’ll try to add these parameters and tell you the result…

    -regards,
    Roland

    #6295
    rkapl
    Participant

    Hi Peter!

    OK, after adding the MeanReversion parameter (0.0) and changing Policy to “RateBound” (in the example was “RateBounds”), the LinearTSRPricer values AND simulates the example CMS trade. Next I’m trying to get the xva results.

    -regards,
    Roland

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.