-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
19 lines (15 loc) · 928 Bytes
/
Copy pathmain.py
File metadata and controls
19 lines (15 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from pricing.monte_carlo import monte_carlo_price
from pricing.black_scholes import black_scholes
#testing shenanigans
if __name__ == "__main__":
price_call_monte = monte_carlo_price(S=100, K=110, T=0.25, r=0.05, sigma=0.20, option_type="call")
price_put_monte = monte_carlo_price(S=100, K=110, T=0.25, r=0.05, sigma=0.20, option_type="put")
call_values = black_scholes(S=100, K=110, T=0.25, r=0.05, sigma=0.20, option_type="call")
put_values = black_scholes(S=100, K=110, T=0.25, r=0.05, sigma=0.20, option_type="put")
print("Black Scholes\n")
print(f"Call price: ${call_values["price"]}\nCall delta: ${call_values["delta"]}")
print(f"Put price: ${put_values["price"]}\nPut delta: ${put_values["delta"]}")
print(f"Vega: ${call_values["vega"]}")
print("\nMonte Carlo\n")
print(f"Call price: ${price_call_monte["price_call"]}")
print(f"Put price: ${price_put_monte["price_put"]}")