Open vannarho-fas opened 1 year ago
Hi,
Am I right in thinking that ORE-SWIG is an open source repo without a community?
In case anyone reads this....
From further investigation, the answer to "Can I directly use the ORE-SWIG Python bindings "as is" to accomplish this task" is "No". :-(
However, it is possible to get access to portfolio data. It is held in nested classes under Portfolio. I gained access to the legData for Example_1 by casting the trade->instrument()->qlInstrument() to a swap and then using the LegData / FixedLegData / FloatingLegData class methods.
From this investigation, my updated hypothesis is that given the depth of the ORE codebase, it may actually be more beneficial to port the SACCR code to ORE.
Here's some console output to illustrate:
Commodity Electricity 0.4000 0.40 1.50
Commodity Other 0.1800 0.40 0.70
CreditIndex IG 0.0038 0.80 0.80
CreditIndex SG 0.0106 0.80 0.80
CreditSingle A 0.0042 0.50 1.00
CreditSingle AA 0.0038 0.50 1.00
CreditSingle AAA 0.0038 0.50 1.00
CreditSingle B 0.0160 0.50 1.00
CreditSingle BB 0.0106 0.50 1.00
CreditSingle BBB 0.0054 0.50 1.00
CreditSingle CCC 0.0600 0.50 1.00
EQ 0.3200 0.50 1.20
EQ Index 0.2000 0.80 0.75
FX 0.0400 0.00 0.15
IRD 0.0050 0.00 0.50
OtherExposure 0.0800 0.00 1.50
SACCR: test complete
run time: 0.389229 sec
ORE done.
F
Hi F,
apologies for the late reply- I think your last approach is reasonable, to extend core ORE to cover SA-CCR, with an additional analytic. Have you startend down this route? We have an internal SACCR implementation that covers a few products so far - Swaps, Swaptions, FX Forwards, FX Options, β¦ We are about to extend that scope. And I expect to get approval for releasing that code in ORE with one of the next releases in 2024. Let us know whether you would like to contribute to that!
Best wishes, Roland
Thanks for the reply Roland.
I did start down this route initially for Swaps, but then I read you were going to release SA-CCR, so I realised my efforts would be wasted (so I ended up working outside of ORE using a FileIO pattern).
I have a few important questions for your roadmap - I appreciate there are necessarily caveats when it comes to release dates / roadmap items, but it would be very helpful to know:
Which release is targeted for SA-CCR? Do you have release dates (even notional) for SA-CVA and FRTB-SA? What is the broad design of your AAD implementation? Will it only be for scripted trade items?
I cannot commit to contributing right at the moment due to other pressures, but I would like to contribute at some point. Are there forums / design resources for contributors especially when it comes to major new features like SA-CCR?
Speak soon,
Forde
On Mon, 13 Nov 2023 at 22:36, Roland Lichters @.***> wrote:
Hi F,
apologies for the late reply- I think your last approach is reasonable, to extend core ORE to cover SA-CCR, with an additional analytic. Have you startend down this route? We have an internal SACCR implementation that covers a few products so far
- Swaps, Swaptions, FX Forwards, FX Options, β¦ We are about to extend that scope. And I expect to get approval for releasing that code in ORE with one of the next releases in 2024. Let us know whether you would like to contribute to that!
Best wishes, Roland
β Reply to this email directly, view it on GitHub https://github.com/OpenSourceRisk/ORE-SWIG/issues/23#issuecomment-1807990550, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEAXL6ZCJQX2GWMWVSZSFR3YEIA4BAVCNFSM6AAAAAAZCHSQ26VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBXHE4TANJVGA . You are receiving this because you authored the thread.Message ID: @.***>
Hi Forde, on this
What is the broad design of your AAD implementation? Will it only be for scripted trade items?
No, it will eventually apply to all trade types. The script framework provides the infrastructure to perform AAD, therefore classical trade types will have to be translated, but that will happen under the hood.
Roland, Peter,
I am still interested in answers to my questions. If you don't have time to reply, could you perhaps point me in the right direction in terms of people who can?
The questions again: Which release is targeted for SA-CCR? I have a partially completed build in ORE but will finish it if there is no commitment from you to release. Do you have designs, plans, release dates (even notional) for BA/SA-CVA and FRTB-SA? What is the broad design of your AAD implementation? Will it only be for scripted trade items?
Two further questions (one of which I have asked previously and restate):
Regards,
Forde
On Tue, 14 Nov 2023 at 08:39, Forde Smith @.***> wrote:
Thanks for the reply Roland.
I did start down this route initially for Swaps, but then I read you were going to release SA-CCR, so I realised my efforts would be wasted (so I ended up working outside of ORE using a FileIO pattern).
I have a few important questions for your roadmap - I appreciate there are necessarily caveats when it comes to release dates / roadmap items, but it would be very helpful to know:
Which release is targeted for SA-CCR? Do you have release dates (even notional) for SA-CVA and FRTB-SA? What is the broad design of your AAD implementation? Will it only be for scripted trade items?
I cannot commit to contributing right at the moment due to other pressures, but I would like to contribute at some point. Are there forums / design resources for contributors especially when it comes to major new features like SA-CCR?
Speak soon,
Forde
On Mon, 13 Nov 2023 at 22:36, Roland Lichters @.***> wrote:
Hi F,
apologies for the late reply- I think your last approach is reasonable, to extend core ORE to cover SA-CCR, with an additional analytic. Have you startend down this route? We have an internal SACCR implementation that covers a few products so far - Swaps, Swaptions, FX Forwards, FX Options, β¦ We are about to extend that scope. And I expect to get approval for releasing that code in ORE with one of the next releases in 2024. Let us know whether you would like to contribute to that!
Best wishes, Roland
β Reply to this email directly, view it on GitHub https://github.com/OpenSourceRisk/ORE-SWIG/issues/23#issuecomment-1807990550, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEAXL6ZCJQX2GWMWVSZSFR3YEIA4BAVCNFSM6AAAAAAZCHSQ26VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBXHE4TANJVGA . You are receiving this because you authored the thread.Message ID: @.***>
Hello Community,
Actually, I cannot find a community for ORE so I am posting here. I tried to contact the forum on the ore webpage but there was no response. π
Please redirect me as needed. I am part of the Quantlib user group but don't see any threads there re ORE. Is there a group that I am not aware of?
I have a SACCR calculator using Python but it does not currently cover all instruments in ORE / QL so I'm looking into the option of refactoring the code to leverage ORE and its Python bindings via SWIG. An alternative is porting the code to C++ / ORE, but as I judge this to be more difficult (for me at least, though has a lot of other advantages), I want to explore the SWIG route first.
As a first step in this investigation, I want to populate a dictionary, such as the one below, using details from various trade objects in the portfolio.
Here's an example dictionary structure I'm looking to fill:
The concept was to iterate over the portfolio's trade IDs, extracting the relevant information from each trade:
Using the "Input" files from Example_1 (/oreswig/OREAnalytics-SWIG/Python/Examples/Notebooks/Example_1), trade.legs() seems to be returning an empty tuple, even though the trade has fixed and floating legs. print(portfolioXML) shows that the data is fully populated...how to get access to it?
Here is the console output.
I also tried to load a new Portfolio directly with new data in case it had been processed (e.g. In a subsequent step, initiated by a call to the build member function, if the βrawβ trade data is then translated into QuantLib/QuantExt objects up to the QuantLib/QuantExt instrument, linked to a QuantLib/QuantExt pricing engine, in turn linked to the relevant term structures provided by the Market class. e.g.
output:
In the swig interface file, the trade.legs() method seems to return a two-dimensional vector of shared_ptrs to CashFlow objects.
If I want to access the underlying leg and schedule data, I had two ideas, but I can't see the bindings for these / understand how to do this yet:
However in the above example trade.instrument().qlInstrument() = None and trade.instrument().qlInstrument() throws the error "'NoneType' object has no attribute 'qlInstrument'"
// use the xml utility functions to extract the data string id = XMLUtils::getChildValue(node, "id"); Real notional = XMLUtils::getChildValueAsDouble(node, "notional"); bool payer = XMLUtils::getChildValueAsBool(node, "payer"); Period tenor = XMLUtils::getChildValueAsPeriod(node, "tenor");