diff --git a/openbb_terminal/stocks/options/yfinance_model.py b/openbb_terminal/stocks/options/yfinance_model.py index 05337cc9e24..3b87fb3f9f4 100644 --- a/openbb_terminal/stocks/options/yfinance_model.py +++ b/openbb_terminal/stocks/options/yfinance_model.py @@ -130,11 +130,12 @@ def get_option_chain_expiry( dt = ( datetime.strptime(expiry, "%Y-%m-%d") + timedelta(hours=16) - datetime.now() ).total_seconds() / (60 * 60 * 24) + rf = get_rf() # Note the way the Option class is defined, put has a -1 input and call has a +1 input for df, option_type in zip(df_list, option_factor): df["Delta"] = df.apply( lambda x: Option( - last_price, x.strike, 0.03, 0, dt, x.impliedVolatility, option_type + last_price, x.strike, rf, 0, dt, x.impliedVolatility, option_type ).Delta(), axis=1, ) @@ -142,13 +143,13 @@ def get_option_chain_expiry( warnings.simplefilter("ignore") df["Gamma"] = df.apply( lambda x: Option( - last_price, x.strike, 0.03, 0, dt, x.impliedVolatility, option_type + last_price, x.strike, rf, 0, dt, x.impliedVolatility, option_type ).Gamma(), axis=1, ) df["Theta"] = df.apply( lambda x: Option( - last_price, x.strike, 0.03, 0, dt, x.impliedVolatility, option_type + last_price, x.strike, rf, 0, dt, x.impliedVolatility, option_type ).Theta(), axis=1, ) @@ -542,7 +543,6 @@ def get_greeks( dif = (expire_dt - datetime.now() + timedelta(hours=16)).total_seconds() / ( 60 * 60 * 24 ) - print(dif) strikes = [] for _, row in chain.iterrows(): vol = row["impliedVolatility"]