Loading...
Home / Cashflowtype Output

Home Forums Development Cashflowtype Output

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6135
    Anonymous
    Inactive

    There is no cashflowtype in the Outputfile of ORE. As I could not find any option in the configuration files to add the type, i tried to implement it myself. I added some lines in the OREAnalytics/reportwriter.cpp->writeCashflows(…).At the moment I determin the type from the dynamic_cast of this object “ptrFlow”.

    e.g.:

    boost::shared_ptr<QuantLib::Coupon> ptrCoupon = boost::dynamic_pointer_cast<QuantLib::Coupon>(ptrFlow);
    if (ptrCoupon) {
    coupon = ptrCoupon->rate();
    accrual = ptrCoupon->accrualPeriod();
    flowType = "INT";
    } else {
    coupon = Null<Real>();
    accrual = Null<Real>();
    flowType = "NOM";
    }

    Is there a “better” way to get the type of the CF?

    #6138
    Anonymous
    Inactive

    Hi bmayer,

    The problem we have seen before is from a QuantLib point of view, there is no categorisation of cashflows built in, they are just amount/date pairs. If you make assumptions (e.g. that Coupon means cashflow=INT) this might not always work (e.g. for something that inherits from Coupon). There is already some logic in writeCashflows() to handle some of the different cashflow types, is but as more trade types are added it might become difficult.

    So if you really need this categorisation than I don’t think there is a better way to get this information, are you going to create an MR on github?

    Regards,
    Niall.

    #6139
    Anonymous
    Inactive

    Hi Niall,
    thanks for your answer. For further analyses we need the cashflowtype, especially to distinguish a notional flow from a interest flow.

    As i have never used github before, i do not know “MR”. I suggest it is a master repository?

    #6141
    Anonymous
    Inactive

    Hi,

    MR = merge request.

    As it is all open source, you can of course make the code changes you suggest and submit them to the project on github. This submission is a merge request, if it is successful then it will be added to ORE.

    Regards,
    Niall.

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


Sign up to hear about the latest ORE developments