Esempio n. 1
0
 def __init__(self,
              spot=100,
              strike=80,
              interest_rate=0.06,
              volatility=0.2,
              variance=None,
              tenor=1.0,
              top=None,
              bottom=None):
     """Default is up and out."""
     assert not (top and bottom)
     BarrierOption.__init__(self,
                            spot=spot,
                            strike=strike,
                            interest_rate=interest_rate,
                            volatility=volatility,
                            variance=variance,
                            tenor=tenor,
                            top=top,
                            bottom=bottom)
     BlackScholesOption.__init__(self,
                                 spot=spot,
                                 strike=strike,
                                 interest_rate=interest_rate,
                                 volatility=volatility,
                                 variance=variance,
                                 tenor=tenor)
Esempio n. 2
0
 def __init__(self
         , spot=100
         , strike=99
         , interest_rate=0.06
         , volatility=0.2
         , variance=None
         , tenor=1.0
         , mean_reversion=1
         , mean_variance=None
         , vol_of_variance=0.4
         , correlation=0
         , top=None
         , bottom=None
         ):
     """"""
     # We must call Barrier BEFORE Heston or our variance process will be
     # ruined, but if we do... monte_carlo_callback is ruined...
     BarrierOption.__init__(self, spot=spot, strike=strike,
             interest_rate=interest_rate,
             volatility=volatility, variance=variance,
             tenor=tenor, top=top, bottom=bottom)
     HestonOption.__init__(self
             , spot=spot
             , strike=strike
             , interest_rate=interest_rate
             , variance=self.variance.value
             , tenor=tenor
             , mean_reversion=mean_reversion
             , mean_variance=mean_variance
             , vol_of_variance=vol_of_variance
             , correlation=correlation
             )
     self.Type = 'HestonBarrierOption'
Esempio n. 3
0
 def __init__(self
             , spot=100
             , strike=80
             , interest_rate=0.06
             , volatility=0.2
             , variance=None
             , tenor=1.0
             , top=None
             , bottom=None
             ):
     """Default is up and out."""
     assert not (top and bottom)
     BarrierOption.__init__(self, spot=spot, strike=strike,
                            interest_rate=interest_rate,
                            volatility=volatility, variance=variance,
                            tenor=tenor, top=top, bottom=bottom)
     BlackScholesOption.__init__(self, spot=spot, strike=strike,
                            interest_rate=interest_rate,
                            volatility=volatility, variance=variance,
                            tenor=tenor)
Esempio n. 4
0
 def features(self):
     d = BarrierOption.features(self)
     d[0] = "BlackScholesBarrierOption <%s>" % hex(id(self))
     return d
Esempio n. 5
0
 def features(self):
     d = BarrierOption.features(self)
     d[0] = "BlackScholesBarrierOption <%s>" % hex(id(self))
     return d
Esempio n. 6
0
 def features(self):
     d = HestonOption.features(self)
     d[0] = "HestonBarrierOption <%s>" % hex(id(self))
     b = BarrierOption.features(self)
     d.extend(b[-2:])
     return d