mirror of
https://github.com/aljazceru/hummingbot-dashboard.git
synced 2025-12-21 15:34:19 +01:00
(feat) add input components
This commit is contained in:
@@ -1,15 +1,17 @@
|
||||
import streamlit as st
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
|
||||
def backtesting_section(inputs, backend_api_client):
|
||||
c1, c2, c3, c4, c5 = st.columns(5)
|
||||
default_end_time = datetime.now().date()
|
||||
default_start_time = default_end_time - timedelta(days=2)
|
||||
with c1:
|
||||
start_date = st.date_input("Start Date", datetime(2024, 5, 1))
|
||||
start_date = st.date_input("Start Date", default_start_time)
|
||||
with c2:
|
||||
end_date = st.date_input("End Date", datetime(2024, 5, 2))
|
||||
end_date = st.date_input("End Date", default_end_time)
|
||||
with c3:
|
||||
backtesting_resolution = st.selectbox("Backtesting Resolution", options=["1m", "3m", "5m", "15m", "30m"], index=1)
|
||||
backtesting_resolution = st.selectbox("Backtesting Resolution", options=["1m", "3m", "5m", "15m", "30m", "1h", "1s"], index=0)
|
||||
with c4:
|
||||
trade_cost = st.number_input("Trade Cost (%)", min_value=0.0, value=0.06, step=0.01, format="%.2f")
|
||||
with c5:
|
||||
@@ -25,4 +27,5 @@ def backtesting_section(inputs, backend_api_client):
|
||||
trade_cost=trade_cost / 100,
|
||||
config=inputs,
|
||||
)
|
||||
|
||||
return backtesting_results
|
||||
|
||||
Reference in New Issue
Block a user