>

QuantLib을 처음 사용하며 Quantlib와 Quantlib-Python을 설치했습니다. MS Visual Studio 2017 및 2.7.15 64 비트가 있습니다.

Goutham Balaraman의 블로그 ( http : // gouthamanbalaraman)의 예를 살펴 보려고합니다. com/blog/quantlib-basics.html ). 그러나 오류가 발생했습니다.

코드 :

   # schedule object can be used to construct a list of dates such as coupon payments
    date1 = ql.Date(1, 1, 2015)
    date2 = ql.Date(1, 1, 2016)
    tenor = ql.Period(ql.Monthly)
    calendar = ql.UnitedStates
    schedule = ql.Schedule(date1, date2, tenor, calendar, ql.Following, ql.Following, ql.DateGeneration.Forward, False)
schedule 


Error:
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
<ipython-input-5-cae31a33e500> in <module>()
      4 tenor = ql.Period(ql.Monthly)
      5 calendar = ql.UnitedStates
----> 6 schedule = ql.Schedule(date1, date2, tenor, calendar, ql.Following, ql.Following, ql.DateGeneration.Forward, False)
      7 schedule
c:\users\papu\envs\quantlib\lib\site-packages\QuantLib\QuantLib.pyc in __init__(self, *args)
   9419 
   9420     def __init__(self, *args):
-> 9421         this = _QuantLib.new_Schedule(*args)
   9422         try:
   9423             self.this.append(this)
NotImplementedError: Wrong number or type of arguments for overloaded function 'new_Schedule'.
  Possible C/C++ prototypes are:
    Schedule::Schedule(std::vector< Date,std::allocator< Date > > const &,Calendar const &,BusinessDayConvention const,boost::optional< BusinessDayConvention >,boost::optional< Period > const,boost::optional< DateGeneration::Rule >,boost::optional< bool >,std::vector< bool,std::allocator< bool > > const &)
    Schedule::Schedule(std::vector< Date,std::allocator< Date > > const &,Calendar const &,BusinessDayConvention const,boost::optional< BusinessDayConvention >,boost::optional< Period > const,boost::optional< DateGeneration::Rule >,boost::optional< bool >)
    Schedule::Schedule(std::vector< Date,std::allocator< Date > > const &,Calendar const &,BusinessDayConvention const,boost::optional< BusinessDayConvention >,boost::optional< Period > const,boost::optional< DateGeneration::Rule >)
    Schedule::Schedule(std::vector< Date,std::allocator< Date > > const &,Calendar const &,BusinessDayConvention const,boost::optional< BusinessDayConvention >,boost::optional< Period > const)
    Schedule::Schedule(std::vector< Date,std::allocator< Date > > const &,Calendar const &,BusinessDayConvention const,boost::optional< BusinessDayConvention >)
    Schedule::Schedule(std::vector< Date,std::allocator< Date > > const &,Calendar const &,BusinessDayConvention const)
    Schedule::Schedule(std::vector< Date,std::allocator< Date > > const &,Calendar const &)
    Schedule::Schedule(std::vector< Date,std::allocator< Date > > const &)
    Schedule::Schedule(Date const &,Date const &,Period const &,Calendar const &,BusinessDayConvention,BusinessDayConvention,DateGeneration::Rule,bool,Date const &,Date const &)
    Schedule::Schedule(Date const &,Date const &,Period const &,Calendar const &,BusinessDayConvention,BusinessDayConvention,DateGeneration::Rule,bool,Date const &)
    Schedule::Schedule(Date const &,Date const &,Period const &,Calendar const &,BusinessDayConvention,BusinessDayConvention,DateGeneration::Rule,bool)
    Schedule::Schedule()

잘못된 일에 대한 도움이 필요하십니까?

  • 답변 # 1

    달력은 ql.UnitedStates() 여야합니다 ql.UnitedStates 가 아닌 . 지금과 같이 클래스 자체가 아닌 클래스 자체를 전달하고 있습니다.

  • 답변 # 2

    답변의 형식이 잘못되어 있고 주석이 작성되지 않았기 때문에 실제로는 여기에 제공되지 않습니다.

    매개 변수와 가장 일치하는 과부하 :

    schedule = ql.Schedule(
        date1,
        date2,
        tenor,
        calendar,
        ql.Following,
        ql.Following,
        ql.DateGeneration.Forward,
        False
    )
    
    

    는 :

    Schedule::Schedule(
        Date const &,
        Date const &,
        Period const &,
        Calendar const &,
        BusinessDayConvention,
        BusinessDayConvention,
        DateGeneration::Rule,
        bool
    )
    
    

    ql.DataGeneration.Forward가 DataGeneration.Rule 유형이고, 안타깝게도 코드에 문제가 없습니다 ...

  • 이전 javascript - 'colspan'및 'rowspan'속성이있는 테이블 전치
  • 다음 스트림을 사용하여 알파벳 위치에 해당하는 알파벳을 매핑하는 Java 맵 채우기