Exemplo n.º 1
0
 def get_value(self):
     return (
            self.notional * (self.tau / self.basis) / (1 + (self.f * self.tau) / self.basis)) * math.exp(
         -self.r * self.t * ((self.x * cnd(-self.d2)) - (self.f * -self.d1)))
Exemplo n.º 2
0
 def get_value(self):
     result=None
     if self.flag == 'c':
         result = ((1 - (1 / (math.pow(1 + (self.f / self.m), self.t1 * self.m)))) / self.f) * math.exp(-self.r * self.t) * ((self.f * cnd(self.d1)) - (self.x * cnd(self.d2)))
     elif self.flag == 'p':
         result = ((1 - (1 / (math.pow(1 + (self.f / self.m), self.t1 * self.m)))) / self.f) * math.exp(-self.r * self.t) * ((self.x * cnd(-self.d2)) - (self.f * cnd(-self.d1)))
     return result