Git Product home page Git Product logo

Comments (6)

dpinte avatar dpinte commented on August 14, 2024

@arthurcolle thanks for reporting the issue. There is an easy fix for this bug. We should expose the empty constructor from the Euribor class ( see ql/indexes/_euribor.pxd). I'll see if I can find a minute to fix it. If you want to give it a try, let me know.

from pyql.

stochastic-thread avatar stochastic-thread commented on August 14, 2024

Yes I am free to try at your leisure! I just ran a 'git pull origin master' and the master branch was already up to date so just let me know and I'll try again whenever. Thanks for the prompt response

from pyql.

dpinte avatar dpinte commented on August 14, 2024

There is some work on the fix/bug_76 branch but it revealed some other issue with swap.py example (wrong usage of relinkable handles). I'll try to fix that as soon as possible.

from pyql.

dpinte avatar dpinte commented on August 14, 2024

@arthurcolle if you want to give a shot at #77 that would be great.

from pyql.

stochastic-thread avatar stochastic-thread commented on August 14, 2024
Traceback (most recent call last):
  File "swap.py", line 101, in <module>
    for n, unit in swaps.keys() ]
  File "swap.py", line 101, in <listcomp>
    for n, unit in swaps.keys() ]
  File "quantlib/indexes/euribor.pyx", line 41, in quantlib.indexes.euribor.Euribor6M.__init__ (quantlib/indexes/euribor.cpp:2721)
TypeError: __init__() takes exactly 1 positional argument (0 given)

Here is output when I run it.

I totally rebuilt this repo from scratch btw, in its own venv, so lmk if you think I'm doing something wrong.
The above output is when I ran "python swap.py" at the command-line but here is the output in iPython as well, which my be a distinct issue, but just reporting for your info:

ImportError                               Traceback (most recent call last)
<ipython-input-2-677456946651> in <module>()
      4 """
      5 from __future__ import print_function
----> 6 from quantlib.indexes.euribor import Euribor6M
      7 from quantlib.pricingengines.swap import DiscountingSwapEngine
      8 from quantlib.settings import Settings

ImportError: No module named 'quantlib.indexes.euribor'

from pyql.

dpinte avatar dpinte commented on August 14, 2024

Something happened in your compilation step. Are you sure you're on the fix/example_swap branch? The fact that you don't have the quantlib.indexes.euribor module shows that it was not cythonized and compiled properly.

What platform do you use? This is the output of the swap.py example for me with the fix in place:

DP-MBP:pyql dpinte (fix/example_swap) $ python examples/swap.py
==================================================================
5-year market swap-rate = 4.43 %
==================================================================
        5-years swap paying 4.00 %
term structure | net present value | fair spread | fair fixed rate
------------------------------------------------------------------
 depo-fut-swap |          19067.30 |   -0.4192 % |        4.4300 %
 depo-FRA-swap |          19055.41 |   -0.4193 % |        4.4300 %
------------------------------------------------------------------
        5-years, 1-year forward swap paying 4.00 %
------------------------------------------------------------------
 depo-fut-swap |          42129.89 |   -0.9710 % |        4.9976 %
 depo-FRA-swap |          37151.83 |   -0.8564 % |        4.8793 %
==================================================================
5-year market swap-rate = 4.60 %
==================================================================
        5-years swap paying 4.00 %
term structure | net present value | fair spread | fair fixed rate
------------------------------------------------------------------
 depo-fut-swap |          26541.00 |   -0.5846 % |        4.6000 %
 depo-FRA-swap |          26524.45 |   -0.5848 % |        4.6000 %
------------------------------------------------------------------
        5-years, 1-year forward swap paying 4.00 %
------------------------------------------------------------------
 depo-fut-swap |          48499.75 |   -1.1217 % |        5.1529 %
 depo-FRA-swap |          42835.30 |   -0.9907 % |        5.0176 %

from pyql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.