"""Combine two call legs at expiry.

Premiums are per underlying unit and both legs share the same expiry; fixed costs are charged once.
All inputs are synthetic teaching examples. Run: python 36_option-vertical-payoff.py
"""
from tv_math import *

legs=[('C',100,7,1),('C',110,3,-1)]
assert payoff(120,legs)==6 and payoff(90,legs)==-4
print([payoff(s,legs) for s in [90,100,104,110,120]])
