Commit
Β·
f732c53
1
Parent(s):
4ee8ea3
Update app.py
Browse files
app.py
CHANGED
@@ -108,13 +108,22 @@ def plot_volatility_bands(ticker, reference_year):
|
|
108 |
return fig_html, text_info
|
109 |
|
110 |
def wrapper_func(ticker, reference_year):
|
111 |
-
|
112 |
-
|
|
|
|
|
|
|
113 |
|
114 |
iface = gr.Interface(
|
115 |
-
fn=wrapper_func,
|
116 |
-
inputs=[
|
117 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
)
|
119 |
|
120 |
iface.launch()
|
|
|
108 |
return fig_html, text_info
|
109 |
|
110 |
def wrapper_func(ticker, reference_year):
|
111 |
+
try:
|
112 |
+
fig_html, text_info = plot_volatility_bands(ticker, str(reference_year))
|
113 |
+
return fig_html, text_info
|
114 |
+
except Exception as e:
|
115 |
+
return str(e)
|
116 |
|
117 |
iface = gr.Interface(
|
118 |
+
fn=wrapper_func,
|
119 |
+
inputs=[
|
120 |
+
gr.inputs.Textbox(label="Enter the Ticker as it Appears on Yahoo Finance"),
|
121 |
+
gr.inputs.Number(label="Enter the Year of Reference")
|
122 |
+
],
|
123 |
+
outputs=[
|
124 |
+
gr.outputs.HTML(label="Candlestick Chart"),
|
125 |
+
gr.outputs.Textbox(label="Supply and Demand Levels")
|
126 |
+
]
|
127 |
)
|
128 |
|
129 |
iface.launch()
|