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)
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))
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)
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)
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)
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)