import numpy as np
import matplotlib.pyplot as plt
def floating_lookback_put_option(S, r, sigma, T):
# Option pricing code (same as before)
def floating_lookback_put_delta(S, r, sigma, T, h=0.01):
# Delta calculation code (same as before)
# Example usage
S = np.linspace(80, 120, 100) # Range of underlying asset prices
r = 0.05 # Risk-free interest rate
sigma = 0.3 # Volatility of the underlying asset
T = 1 # Time to maturity in years
delta_values = []
for price in S:
delta = floating_lookback_put_delta(price, r, sigma, T)
delta_values.append(delta)
# Plotting
plt.plot(S, delta_values)
plt.xlabel('Underlying Asset Price')
plt.ylabel('Delta')
plt.title('Delta of Floating Lookback Put Option')
plt.grid(True)
plt.show()