ahudock commited on
Commit
ce5dc13
·
1 Parent(s): 0ea0b34

Correct undefined var

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -47,6 +47,8 @@ def yf_get_ticker_price(ticker: str) -> float:
47
  Args:
48
  ticker: A string representing a stock ticker.
49
  """
 
 
50
  # Get current underlying price
51
  hist = stock.history(period="1d")
52
  if hist.empty:
@@ -82,7 +84,7 @@ def yf_get_atm_straddle_price(ticker: str, dte: int = 0) -> Dict[str, Any]:
82
  stock = yf.Ticker(ticker)
83
 
84
  # Get current underlying price
85
- underlying_price = yf_get_ticker_price(ticker)
86
 
87
  # Get option expiration dates
88
  expirations = stock.options
 
47
  Args:
48
  ticker: A string representing a stock ticker.
49
  """
50
+ stock = yf.Ticker(ticker)
51
+
52
  # Get current underlying price
53
  hist = stock.history(period="1d")
54
  if hist.empty:
 
84
  stock = yf.Ticker(ticker)
85
 
86
  # Get current underlying price
87
+ underlying_price = yf_get_ticker_price(stock)
88
 
89
  # Get option expiration dates
90
  expirations = stock.options