Exemplo n.º 1
0
 def test_short_call_payoff_ITM(self):
     # short call -\
     position = -1
     for x in range(45, 0, -5):
         payoff = pf.call_payoff(self.strike_price, self.premeium, position,
                                 self.quantity, x)
         self.assertTrue(payoff == self.premeium)
Exemplo n.º 2
0
 def test_short_call_payoff_OTM(self):
     # short call -\
     position = -1
     for x in range(55, 2 * self.strike_price, 5):
         payoff = pf.call_payoff(self.strike_price, self.premeium, position,
                                 self.quantity, x)
         self.assertTrue(payoff == -(x - self.strike_price - self.premeium))
Exemplo n.º 3
0
 def test_long_call_payoff_OTM(self):
     # long call _/
     position = 1
     for x in range(45, 0, -5):
         payoff = pf.call_payoff(self.strike_price, self.premeium, position,
                                 self.quantity, x)
         self.assertTrue(payoff == -self.premeium)
Exemplo n.º 4
0
 def test_short_call_payoff_ATM(self):
     # short call -\
     position = -1
     payoff = pf.call_payoff(self.strike_price, self.premeium, position,
                             self.quantity, self.x)
     self.assertTrue(payoff == self.premeium)
Exemplo n.º 5
0
 def test_long_call_payoff_ITM(self):
     position = 1
     for x in range(55, 2 * self.strike_price, 5):
         payoff = pf.call_payoff(self.strike_price, self.premeium, position,
                                 self.quantity, x)
         self.assertTrue(payoff == x - self.strike_price - self.premeium)
Exemplo n.º 6
0
 def test_long_call_payoff_ATM(self):
     # long call _/
     position = 1
     payoff = pf.call_payoff(self.strike_price, self.premeium, position,
                             self.quantity, self.x)
     self.assertTrue(payoff == -self.premeium)