Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running new example 43 #142

Open
Othmane-Ch opened this issue May 2, 2023 · 11 comments
Open

Error running new example 43 #142

Othmane-Ch opened this issue May 2, 2023 · 11 comments

Comments

@Othmane-Ch
Copy link

I have seen that a new example 43 on bonds has been added . I have this error while running it. Anybody has the same error ?

image

@noonediesalone
Copy link

If we've built the latest from master, then you shouldn't have this error per https://github.com/OpenSourceRisk/Engine/blob/master/OREData/ored/utilities/parsers.cpp
image

@Othmane-Ch
Copy link
Author

Othmane-Ch commented May 3, 2023

May I ask how did you build your project ? cause I have errors when building the latest version from master

"\Desktop\Engine-master\build\ALL_BUILD.vcxproj" (default target) (1) ->
"\Desktop\Engine-master\build\OREAnalytics\orea\OREAnalytics-x64-mt.vcxproj" (default target) (21) ->
"\Desktop\Engine-master\build\OREData\ored\OREData-x64-mt.vcxproj" (default target) (22) ->
"\Desktop\Engine-master\build\QuantExt\qle\QuantExt-x64-mt.vcxproj" (default target) (23) ->
(ClCompile target) ->
\Desktop\Engine-master\QuantExt\qle\pricingengines\midpointcdsenginemultistate.cpp(52,5): error C2678: binary '=': no operator found which takes a
left-hand operand of type 'const QuantLib::HandleQuantLib::DefaultProbabilityTermStructure' (or there is no acceptable conversion) [\Desktop\Engi
ne-master\build\QuantExt\qle\QuantExt-x64-mt.vcxproj]
\Desktop\Engine-master\QuantExt\qle\pricingengines\midpointcdsenginemultistate.cpp(53,5): error C3892: 'this': you cannot assign to a variable tha
t is const [\Desktop\Engine-master\build\QuantExt\qle\QuantExt-x64-mt.vcxproj]

@noonediesalone
Copy link

It's a QL error, so try updating the submodule:
git submodule foreach git pull origin master

@Othmane-Ch
Copy link
Author

Works perfectly. Thank you

@Othmane-Ch Othmane-Ch reopened this May 5, 2023
@Othmane-Ch
Copy link
Author

While I can run the example 43, it doesn't seem to load the trades. I am using the recent version from master.This is my output :

D:\Desktop\Engine-master\Examples\Example_43>python run.py

1) Run ORE for a single Bond
Loading inputs                                    OK
Requested analytics                               CASHFLOW,EXPOSURE,NPV,XVA
Pricing: Build Market                             OK
Pricing: Build Portfolio
Error: Error in ORE analytics: Portfolio does not contain any built trades, context is 'analytic/PRICING'
Saving plot....Output\mpl_cdf_bond1.pdf
Saving plot....Output\mpl_pdf_bond1.pdf

2) Run ORE for Bond and Swap
Loading inputs                                    OK
Requested analytics                               CASHFLOW,EXPOSURE,NPV,XVA
Pricing: Build Market                             OK
Pricing: Build Portfolio                          OK
Pricing: Cashflow Report                          OK
Pricing: NPV Report                               OK
Pricing: Curves Report                            OK
XVA: Build Market                                 OK

Error: Error in ORE analytics: did not find object 'BOND_AAA' of type default curve under configuration 'collateral_eur' or 'default'
Saving plot....Output\mpl_cdf_bond_swap.pdf
Saving plot....Output\mpl_pdf_bond_swap.pdf

3) Run ORE for 3 Bonds
Loading inputs                                    OK
Requested analytics                               CASHFLOW,EXPOSURE,NPV,XVA
Pricing: Build Market                             OK
Pricing: Build Portfolio
Error: Error in ORE analytics: Portfolio does not contain any built trades, context is 'analytic/PRICING'
Saving plot....Output\mpl_cdf_bond3.pdf
Saving plot....Output\mpl_pdf_bond3.pdf

4) Run ORE for 10 bonds
Loading inputs                                    OK
Requested analytics                               CASHFLOW,EXPOSURE,NPV,XVA
Pricing: Build Market                             OK
Pricing: Build Portfolio
Error: Error in ORE analytics: Portfolio does not contain any built trades, context is 'analytic/PRICING'
Saving plot....Output\mpl_cdf_bond10.pdf
Saving plot....Output\mpl_pdf_bond10.pdf

5) Run ORE for Bond and CDS
Loading inputs                                    OK
Requested analytics                               CASHFLOW,EXPOSURE,NPV,XVA
Pricing: Build Market                             OK
Pricing: Build Portfolio
Error: Error in ORE analytics: Portfolio does not contain any built trades, context is 'analytic/PRICING'
Saving plot....Output\mpl_cdf_bond_cds.pdf
Saving plot....Output\mpl_pdf_bond_cds.pdf

@Othmane-Ch
Copy link
Author

Shoutout to my boi oussama from Lydex :)

@Othmane-Ch Othmane-Ch reopened this Jul 5, 2023
@quantthingy
Copy link

Still got this error (build it from master on 22 Nov 2023)

  1. Run ORE for a single Bond
    Loading inputs OK
    Requested analytics CASHFLOW,EXPOSURE,NPV,XVA
    Pricing: Build Market OK
    Pricing: Build Portfolio
    Error: Error in ORE analytics: Portfolio does not contain any built trades, context is 'analytic/PRICING'
    Traceback (most recent call last):
    File "/Volumes/Crucial X6/Documents SSD/ore/Examples/Example_43/run.py", line 15, in
    oreex.plot(targetFileName, 0, 2, 'b', label="Loss")
    File "/Volumes/Crucial X6/Documents SSD/ore/Examples/Example_43/../ore_examples_helper.py", line 115, in plot
    self.ax.plot(self.get_output_data_from_column(filename, colIdxTime, offset),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Volumes/Crucial X6/Documents SSD/ore/Examples/Example_43/../ore_examples_helper.py", line 99, in get_output_data_from_column
    f = open(os.path.join(os.path.join(os.getcwd(), "Output"), csv_name))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    FileNotFoundError: [Errno 2] No such file or directory: '/Volumes/Crucial X6/Documents SSD/ore/Examples/Example_43/Output/credit_migration_bond1_11.csv'

@rkapl123
Copy link
Contributor

rkapl123 commented Jan 28, 2024

Well, this is due to default curve building requiring the additional Eigen3 library, the log says:
ALERT [2024-Jan-28 12:19:18.654435] (...ta\ored\marketdata\todaysmarket.cpp:920) : error while building node DefaultCurve(BOND_AAA,Default/EUR/BOND_AAA) in configuration collateral_eur: default curve building failed for BOND_AAA: build attempt failed for BOND_AAA using config with priority 0: Logm(): no implementation provided, you can e.g. install Eigen and rebuild ORE to enable this function.
There are instructions to install this in the userguide, it works quite well (you have to remove the build cache however), simply install vcpkg https://vcpkg.io/en/getting-started.html, then install Eigen3 with vcpkg install -–triplet x64-windows eigen3 and finally configure ORE cmake / build ORE using

set VCPKG_ROOT=C:/dev/vcpkg
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake -DBOOST_INCLUDEDIR=%BOOST% -DBOOST_LIBRARYDIR=%BOOST_LIB64% -DQL_ENABLE_SESSIONS=ON -B build
cmake --build build -v --config Release

@rkapl123
Copy link
Contributor

rkapl123 commented Jan 28, 2024

In general, I would suggest to include Eigen3 and zlib in the prebuilt binary, once this is possible again (see #190 ), otherwise the examples do not run completely. In the meantime I've built a windows binary with the latest version of ORE and made it available here. Simply klick on download raw file:
image

@quantthingy
Copy link

What about mentioning explicitly the dependency on Eigen3 for all build environment in the doc? (not just windows)

@rkapl123
Copy link
Contributor

rkapl123 commented Jul 4, 2024

Actually this is already mentioned in creditmodel.tex (separate doc). I have also included it in the userguide in #242 , line 3140 of userguide.tex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants