File size: 1,462 Bytes
a5e5bde
33d0c27
a5e5bde
 
33d0c27
 
a5e5bde
 
 
f3ec673
4d6998d
 
 
a5e5bde
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33d0c27
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import gradio as gr
import pandas as pd


data = pd.read_csv("./data/EURUSD_Candlestick_1_M_BID_01.01.2021-04.02.2023.csv")

# The UI of the demo defines here.
with gr.Blocks() as demo:
    gr.Markdown("Auto trade bot.")
    
    with gr.Row():
        gr.Markdown("Trade data settings.")
        time_slider = gr.components.Slider(minimum=1, maximum=20, value=5, label="Time interval", interactive=True)
    gr.Markdown("Candle polts may goes here.")
    gr.components.Image()
    # for plotly it should follow this: https://gradio.app/plot-component-for-maps/
    # trade_plot = gr.Plot()
    # demo.load(the_plot, [*args], [gr.components], trade_plot)
    
    with gr.Row():
        with gr.Column():
            gr.Markdown("User Interactive panel.")
            amount = gr.components.Textbox(value="", label="Amount", interactive=True)
            with gr.Row():
                buy_btn = gr.components.Button("Buy", label="Buy", interactive=True, inputs=[amount])
                sell_btn = gr.components.Button("Sell", label="Sell", interactive=True, inputs=[amount])
                hold_btn = gr.components.Button("Hold", label="Hold", interactive=True, inputs=[amount])
        with gr.Column():
            gr.Markdown("Trade bot history.")
            # show trade box history in a table or something
            gr.components.Textbox(value="Some history? Need to decide how to show bot history", label="History", interactive=True)

demo.launch()