tosin2013 commited on
Commit
acbf079
1 Parent(s): 54ceda9

updating code

Browse files
Files changed (1) hide show
  1. app.py +14 -25
app.py CHANGED
@@ -244,28 +244,17 @@ from gradio import inputs # Import the missing 'inputs' attribute from the 'gra
244
  api_key_link = "https://www.alphavantage.co/support/#api-key"
245
 
246
 
247
- class APIKeyComponent(gr.Component):
248
- def __init__(self):
249
- super().__init__()
250
- self.api_key = gr.inputs.Textbox(label="API Key", placeholder=api_key_link)
251
-
252
- class CurrencyPairComponent(gr.Component):
253
- def __init__(self):
254
- super().__init__()
255
- self.from_symbol = gr.inputs.Dropdown(label="From Currency", choices=['EUR', 'GBP', 'USD', 'AUD', 'JPY'])
256
- self.to_symbol = gr.inputs.Dropdown(label="To Currency", choices=['USD', 'JPY', 'GBP', 'AUD', 'CAD'])
257
-
258
- # Run the Gradio app
259
- if __name__ == "__main__":
260
- gr.Interface(
261
- fn=run_backtest,
262
- inputs=[
263
- APIKeyComponent(),
264
- CurrencyPairComponent(),
265
- gr.inputs.Radio(label="Interval", choices=["1min", "5min", "15min", "30min", "60min"])
266
- ],
267
- outputs="html", # Output as HTML to display colored text
268
- live=True,
269
- title="Trading Signal",
270
- description="Run Backtest and Get Trading Signal",
271
- ).launch()
 
244
  api_key_link = "https://www.alphavantage.co/support/#api-key"
245
 
246
 
247
+ # Create a Gradio interface
248
+ gr.Interface(
249
+ fn=run_backtest,
250
+ inputs=[
251
+ gr.inputs.Textbox(label="API Key", placeholder="Enter your API key"),
252
+ gr.inputs.Dropdown(label="From Currency", choices=['EUR', 'GBP', 'USD', 'AUD', 'JPY']),
253
+ gr.inputs.Dropdown(label="To Currency", choices=['USD', 'JPY', 'GBP', 'AUD', 'CAD']),
254
+ gr.inputs.Radio(label="Interval", choices=["1min", "5min", "15min", "30min", "60min"])
255
+ ],
256
+ outputs="html", # Output as HTML to display colored text
257
+ live=True,
258
+ title="Trading Signal",
259
+ description="Run Backtest and Get Trading Signal",
260
+ ).launch()