Quant0 commited on
Commit
9d3eed3
·
verified ·
1 Parent(s): cbc30ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -221,9 +221,8 @@ with gr.Blocks(title="Análisis de Opciones") as demo:
221
  with gr.Row():
222
  ticker_input = gr.Textbox(label="Ticker (ej. GOOGL)", value="MSTR")
223
  expiration_date = gr.Textbox(label="Fecha de vencimiento (formato: aaaa-mm-dd)", value = "" )
224
- with gr.Column():
225
- size_of_the_window = gr.Slider(minimum=1, maximum=30, value=16, step=1, label="Tamaño de la ventana")
226
- btn_mostrar = gr.Button('Cargar Datos')
227
 
228
  df_put_state = gr.State(value=initial_df_put)
229
  df_call_state = gr.State(value=initial_df_call)
@@ -239,12 +238,13 @@ with gr.Blocks(title="Análisis de Opciones") as demo:
239
 
240
  output_df_put = gr.DataFrame(label="Datos de Opciones put", value=initial_df_put)
241
 
 
242
  ticker_input.change(
243
  fn = generar_puts,
244
  inputs=[ticker_input, expiration_date, size_of_the_window],
245
  outputs= [ output_df_put, df_put_state]
246
  )
247
-
248
 
249
  with gr.Tab("Calls"):
250
 
@@ -255,12 +255,13 @@ with gr.Blocks(title="Análisis de Opciones") as demo:
255
  with gr.Row():
256
 
257
  output_df_call = gr.DataFrame(label="Datos de Opciones call", value=initial_df_call)
258
-
259
  ticker_input.change(
260
  fn = generar_calls,
261
  inputs=[ticker_input, expiration_date, size_of_the_window],
262
  outputs= [ output_df_call, df_call_state]
263
  )
 
264
  with gr.Tab("Plots"):
265
 
266
  btn_plot = gr.Button("Mostrar Plot")
@@ -285,13 +286,13 @@ with gr.Blocks(title="Análisis de Opciones") as demo:
285
  inputs=[ticker_input, expiration_date, size_of_the_window],
286
  outputs=[output_file, output_msg]
287
  )
288
- '''
289
  btn_mostrar.click(
290
  fn=generar_todo,
291
  inputs=[ticker_input, expiration_date, size_of_the_window],
292
  outputs= [ output_df_put, output_df_call, df_call_state, df_put_state]
293
  )
294
- '''
295
  btn_plot.click(
296
  fn=plot_opciones,
297
  inputs=[df_put_state, df_call_state, ticker_input, expiration_date],
 
221
  with gr.Row():
222
  ticker_input = gr.Textbox(label="Ticker (ej. GOOGL)", value="MSTR")
223
  expiration_date = gr.Textbox(label="Fecha de vencimiento (formato: aaaa-mm-dd)", value = "" )
224
+ size_of_the_window = gr.Slider(minimum=1, maximum=30, value=16, step=1, label="Tamaño de la ventana")
225
+ btn_mostrar = gr.Button('Cargar Datos')
 
226
 
227
  df_put_state = gr.State(value=initial_df_put)
228
  df_call_state = gr.State(value=initial_df_call)
 
238
 
239
  output_df_put = gr.DataFrame(label="Datos de Opciones put", value=initial_df_put)
240
 
241
+ '''
242
  ticker_input.change(
243
  fn = generar_puts,
244
  inputs=[ticker_input, expiration_date, size_of_the_window],
245
  outputs= [ output_df_put, df_put_state]
246
  )
247
+ '''
248
 
249
  with gr.Tab("Calls"):
250
 
 
255
  with gr.Row():
256
 
257
  output_df_call = gr.DataFrame(label="Datos de Opciones call", value=initial_df_call)
258
+ '''
259
  ticker_input.change(
260
  fn = generar_calls,
261
  inputs=[ticker_input, expiration_date, size_of_the_window],
262
  outputs= [ output_df_call, df_call_state]
263
  )
264
+ '''
265
  with gr.Tab("Plots"):
266
 
267
  btn_plot = gr.Button("Mostrar Plot")
 
286
  inputs=[ticker_input, expiration_date, size_of_the_window],
287
  outputs=[output_file, output_msg]
288
  )
289
+
290
  btn_mostrar.click(
291
  fn=generar_todo,
292
  inputs=[ticker_input, expiration_date, size_of_the_window],
293
  outputs= [ output_df_put, output_df_call, df_call_state, df_put_state]
294
  )
295
+
296
  btn_plot.click(
297
  fn=plot_opciones,
298
  inputs=[df_put_state, df_call_state, ticker_input, expiration_date],