Bug/2590 error setting exp (#2615)

* set yahoo finance as default model if source not set

* set yahoo finance as default model if source not set

Co-authored-by: john <john@erlandsen.tech>
This commit is contained in:
John Inge
2022-09-25 00:36:18 +02:00
committed by GitHub
parent 7a02f85e51
commit 8e20d9eb83

View File

@@ -607,20 +607,20 @@ class OptionsController(BaseController):
self.update_runtime_choices()
if self.selected_date:
if self.source == "YahooFinance":
self.chain = yfinance_model.get_option_chain(
if self.source == "Tradier":
df = tradier_model.get_option_chains(
self.ticker, self.selected_date
)
self.chain = op_helpers.Chain(df)
elif self.source == "Nasdaq":
df = nasdaq_model.get_chain_given_expiration(
self.ticker, self.selected_date
)
self.chain = op_helpers.Chain(df, self.source)
else:
df = tradier_model.get_option_chains(
self.chain = yfinance_model.get_option_chain(
self.ticker, self.selected_date
)
self.chain = op_helpers.Chain(df)
self.update_runtime_choices()
else:
console.print("Please load a ticker using `load <ticker>`.\n")