Skip to content

Commit

Permalink
fixing the code
Browse files Browse the repository at this point in the history
  • Loading branch information
tamilselvanarjun committed Mar 29, 2024
1 parent a7de527 commit 2380c4c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions quantmodels/opm.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def binomial_option_pricing(S, K, T, r, sigma, n, option_type='call'):
volatility = 0.2 # Volatility of the underlying asset
periods = 100 # Number of periods in the binomial model

call_price = binomial_option_pricing(underlying_price, strike_price, time_to_maturity, risk_free_rate, volatility, periods, 'call')
put_price = binomial_option_pricing(underlying_price, strike_price, time_to_maturity, risk_free_rate, volatility, periods, 'put')
print(f"Call Option Price: {call_price:.2f}")
print(f"Put Option Price: {put_price:.2f}")
#call_price = binomial_option_pricing(underlying_price, strike_price, time_to_maturity, risk_free_rate, volatility, periods, 'call')
#put_price = binomial_option_pricing(underlying_price, strike_price, time_to_maturity, risk_free_rate, volatility, periods, 'put')
#print(f"Call Option Price: {call_price:.2f}")
#print(f"Put Option Price: {put_price:.2f}")

0 comments on commit 2380c4c

Please sign in to comment.