Skip to content

Commit d4a69a5

Browse files
authored
Merge pull request #261 from hummingbot/feat/minor_improvements
Feat/minor improvements
2 parents b85acea + ba5a6a2 commit d4a69a5

5 files changed

Lines changed: 32 additions & 15 deletions

File tree

frontend/components/directional_trading_general_inputs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ def get_directional_trading_general_inputs():
3131
help="Enter the trading pair to get candles for (e.g., WLD-USDT).")
3232
with c3:
3333
leverage = st.number_input("Leverage", value=leverage,
34+
min_value=1,
3435
help="Set the leverage to use for trading (e.g., 20 for 20x leverage)."
35-
"Set it to 1 for spot trading.")
36+
"Set it to 1 for spot trading. Value must be greater than 0.")
3637
interval = st.selectbox("Candles Interval", ("1m", "3m", "5m", "15m", "1h", "4h", "1d"),
3738
index=interval_index,
3839
help="Enter the interval for candles (e.g., 1m).")

frontend/components/market_making_general_inputs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ def get_market_making_general_inputs(custom_candles=False, controller_name: str
2929
help="Enter the trading pair to trade on (e.g., WLD-USDT).")
3030
with c3:
3131
leverage = st.number_input("Leverage", value=leverage,
32+
min_value=1,
3233
help="Set the leverage to use for trading (e.g., 20 for 20x leverage). "
33-
"Set it to 1 for spot trading.")
34+
"Set it to 1 for spot trading. Value must be greater than 0.")
3435
with c4:
3536
total_amount_quote = st.number_input("Total amount of quote", value=total_amount_quote,
3637
help="Enter the total amount in quote asset to use for "

frontend/components/st_inputs.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,32 +27,49 @@ def distribution_inputs(column, dist_type_name, levels=3, default_values=None):
2727
base, scaling_factor, step, ratio, manual_values = None, None, None, None, None
2828

2929
if dist_type != "Manual":
30+
# Set min_value for Fibonacci to ensure positive start values
31+
min_start = 0.01 if dist_type == "Fibonacci" else None
3032
start = column.number_input(f"{dist_type_name} Start Value", value=1.0,
33+
min_value=min_start,
3134
key=f"{column}_{dist_type_name.lower()}_start")
3235
if dist_type == "Logarithmic":
3336
base = column.number_input(f"{dist_type_name} Log Base", value=exp(1),
37+
min_value=0.01,
38+
help="Base must be greater than 0 and not equal to 1",
3439
key=f"{column}_{dist_type_name.lower()}_base")
3540
scaling_factor = column.number_input(f"{dist_type_name} Scaling Factor", value=2.0,
41+
min_value=0.01,
42+
help="Scaling factor must be greater than 0",
3643
key=f"{column}_{dist_type_name.lower()}_scaling")
3744
elif dist_type == "Arithmetic":
3845
step = column.number_input(f"{dist_type_name} Step", value=0.3,
3946
key=f"{column}_{dist_type_name.lower()}_step")
4047
elif dist_type == "Geometric":
4148
ratio = column.number_input(f"{dist_type_name} Ratio", value=2.0,
49+
min_value=1.0,
50+
help="Ratio must be greater than or equal to 1",
4251
key=f"{column}_{dist_type_name.lower()}_ratio")
4352
elif dist_type == "GeoCustom":
4453
ratio = column.number_input(f"{dist_type_name} Ratio", value=2.0,
54+
min_value=1.0,
55+
help="Ratio must be greater than or equal to 1",
4556
key=f"{column}_{dist_type_name.lower()}_ratio")
4657
elif dist_type == "Linear":
4758
step = column.number_input(f"{dist_type_name} End", value=1.0,
4859
key=f"{column}_{dist_type_name.lower()}_end")
4960
else:
5061
if default_values:
51-
manual_values = [column.number_input(f"{dist_type_name} for level {i + 1}", value=value * 100.0,
62+
manual_values = [column.number_input(f"{dist_type_name} for level {i + 1}",
63+
value=value * 100.0,
64+
min_value=0.01 if dist_type_name == "Amount" else 0.0,
65+
help="Value must be greater than 0" if dist_type_name == "Amount" else None,
5266
key=f"{column}_{dist_type_name.lower()}_{i}") for i, value in
5367
enumerate(default_values)]
5468
else:
55-
manual_values = [column.number_input(f"{dist_type_name} for level {i + 1}", value=i + 1.0,
69+
manual_values = [column.number_input(f"{dist_type_name} for level {i + 1}",
70+
value=i + 1.0,
71+
min_value=0.01 if dist_type_name == "Amount" else 0.0,
72+
help="Value must be greater than 0" if dist_type_name == "Amount" else None,
5673
key=f"{column}_{dist_type_name.lower()}_{i}") for i, value in
5774
range(levels)]
5875
start = None # As start is not relevant for Manual type

frontend/pages/landing.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,23 +257,26 @@ def generate_sample_data():
257257
# Quick Actions
258258
st.markdown("## ⚡ Quick Actions")
259259

260+
# Alert for mocked navigation
261+
st.info("ℹ️ **Note**: This is a mocked landing page. The Quick Actions buttons below are for demonstration purposes and the page navigation is not functional.")
262+
260263
col1, col2, col3, col4 = st.columns(4)
261264

262265
with col1:
263266
if st.button("🚀 Deploy Strategy", use_container_width=True, type="primary"):
264-
st.switch_page("frontend/pages/orchestration/deploy_v2_with_controllers/app.py")
267+
st.error("🚫 Navigation unavailable - This is a mocked landing page for demonstration purposes.")
265268

266269
with col2:
267270
if st.button("📊 View Performance", use_container_width=True):
268-
st.switch_page("frontend/pages/performance/app.py")
271+
st.error("🚫 Navigation unavailable - This is a mocked landing page for demonstration purposes.")
269272

270273
with col3:
271274
if st.button("🔍 Backtesting", use_container_width=True):
272-
st.switch_page("frontend/pages/backtesting/app.py")
275+
st.error("🚫 Navigation unavailable - This is a mocked landing page for demonstration purposes.")
273276

274277
with col4:
275278
if st.button("🗃️ Archived Bots", use_container_width=True):
276-
st.switch_page("frontend/pages/orchestration/archived_bots/app.py")
279+
st.error("🚫 Navigation unavailable - This is a mocked landing page for demonstration purposes.")
277280

278281
st.divider()
279282

frontend/pages/orchestration/credentials/app.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def add_credentials_section():
173173
if st.button("Submit Credentials"):
174174
response = client.accounts.add_credential(account_name, connector_name, config_inputs)
175175
if response:
176-
st.success(response)
176+
st.success(f"✅ Successfully added {connector_name} connector to {account_name}!")
177177
try:
178178
st.rerun(scope="fragment")
179179
except Exception:
@@ -188,12 +188,7 @@ def add_credentials_section():
188188
with cols[-1]:
189189
if st.button("Submit Credentials"):
190190
response = client.accounts.add_credential(account_name, connector_name, config_inputs)
191-
if response:
192-
st.success(response)
193-
try:
194-
st.rerun(scope="fragment")
195-
except Exception:
196-
st.rerun()
191+
st.write(response)
197192

198193

199194
add_credentials_section()

0 commit comments

Comments
 (0)