|
import gradio as gr |
|
from modules.share_price_trend import share_price_trend |
|
|
|
examples = [ |
|
["AAPL,GOOGL,MSFT", 90], |
|
["SCHD,QQQ", 365] |
|
] |
|
|
|
|
|
title = gr.Markdown("<h2 style='margin: 5px'>Share Price Trend</h2>") |
|
stock_codes = gr.Textbox( |
|
label="Stock Codes", |
|
|
|
placeholder="e.g., AAPL,GOOGL,MSFT", |
|
value="SCHD,QQQ" |
|
) |
|
period = gr.Slider( |
|
label="Number of Days", |
|
value=90, |
|
maximum=3650 |
|
) |
|
|
|
|
|
input = [stock_codes, period] |
|
output = gr.HTML() |
|
component_rows = [[stock_codes], [period]] |
|
|
|
|
|
def update_output(*args): |
|
return share_price_trend(*args) |
|
|