diff --git a/frontend/components/directional_trading_general_inputs.py b/frontend/components/directional_trading_general_inputs.py index fa8d0a3c..363ada44 100644 --- a/frontend/components/directional_trading_general_inputs.py +++ b/frontend/components/directional_trading_general_inputs.py @@ -31,8 +31,9 @@ def get_directional_trading_general_inputs(): help="Enter the trading pair to get candles for (e.g., WLD-USDT).") with c3: leverage = st.number_input("Leverage", value=leverage, + min_value=1, help="Set the leverage to use for trading (e.g., 20 for 20x leverage)." - "Set it to 1 for spot trading.") + "Set it to 1 for spot trading. Value must be greater than 0.") interval = st.selectbox("Candles Interval", ("1m", "3m", "5m", "15m", "1h", "4h", "1d"), index=interval_index, help="Enter the interval for candles (e.g., 1m).") diff --git a/frontend/components/market_making_general_inputs.py b/frontend/components/market_making_general_inputs.py index 873436ba..8fc0c946 100644 --- a/frontend/components/market_making_general_inputs.py +++ b/frontend/components/market_making_general_inputs.py @@ -29,8 +29,9 @@ def get_market_making_general_inputs(custom_candles=False, controller_name: str help="Enter the trading pair to trade on (e.g., WLD-USDT).") with c3: leverage = st.number_input("Leverage", value=leverage, + min_value=1, help="Set the leverage to use for trading (e.g., 20 for 20x leverage). " - "Set it to 1 for spot trading.") + "Set it to 1 for spot trading. Value must be greater than 0.") with c4: total_amount_quote = st.number_input("Total amount of quote", value=total_amount_quote, help="Enter the total amount in quote asset to use for " diff --git a/frontend/components/st_inputs.py b/frontend/components/st_inputs.py index a20c0708..f38ac654 100644 --- a/frontend/components/st_inputs.py +++ b/frontend/components/st_inputs.py @@ -27,32 +27,49 @@ def distribution_inputs(column, dist_type_name, levels=3, default_values=None): base, scaling_factor, step, ratio, manual_values = None, None, None, None, None if dist_type != "Manual": + # Set min_value for Fibonacci to ensure positive start values + min_start = 0.01 if dist_type == "Fibonacci" else None start = column.number_input(f"{dist_type_name} Start Value", value=1.0, + min_value=min_start, key=f"{column}_{dist_type_name.lower()}_start") if dist_type == "Logarithmic": base = column.number_input(f"{dist_type_name} Log Base", value=exp(1), + min_value=0.01, + help="Base must be greater than 0 and not equal to 1", key=f"{column}_{dist_type_name.lower()}_base") scaling_factor = column.number_input(f"{dist_type_name} Scaling Factor", value=2.0, + min_value=0.01, + help="Scaling factor must be greater than 0", key=f"{column}_{dist_type_name.lower()}_scaling") elif dist_type == "Arithmetic": step = column.number_input(f"{dist_type_name} Step", value=0.3, key=f"{column}_{dist_type_name.lower()}_step") elif dist_type == "Geometric": ratio = column.number_input(f"{dist_type_name} Ratio", value=2.0, + min_value=1.0, + help="Ratio must be greater than or equal to 1", key=f"{column}_{dist_type_name.lower()}_ratio") elif dist_type == "GeoCustom": ratio = column.number_input(f"{dist_type_name} Ratio", value=2.0, + min_value=1.0, + help="Ratio must be greater than or equal to 1", key=f"{column}_{dist_type_name.lower()}_ratio") elif dist_type == "Linear": step = column.number_input(f"{dist_type_name} End", value=1.0, key=f"{column}_{dist_type_name.lower()}_end") else: if default_values: - manual_values = [column.number_input(f"{dist_type_name} for level {i + 1}", value=value * 100.0, + manual_values = [column.number_input(f"{dist_type_name} for level {i + 1}", + value=value * 100.0, + min_value=0.01 if dist_type_name == "Amount" else 0.0, + help="Value must be greater than 0" if dist_type_name == "Amount" else None, key=f"{column}_{dist_type_name.lower()}_{i}") for i, value in enumerate(default_values)] else: - manual_values = [column.number_input(f"{dist_type_name} for level {i + 1}", value=i + 1.0, + manual_values = [column.number_input(f"{dist_type_name} for level {i + 1}", + value=i + 1.0, + min_value=0.01 if dist_type_name == "Amount" else 0.0, + help="Value must be greater than 0" if dist_type_name == "Amount" else None, key=f"{column}_{dist_type_name.lower()}_{i}") for i, value in range(levels)] start = None # As start is not relevant for Manual type diff --git a/frontend/pages/landing.py b/frontend/pages/landing.py index fc56f29b..e7987cde 100644 --- a/frontend/pages/landing.py +++ b/frontend/pages/landing.py @@ -257,23 +257,26 @@ def generate_sample_data(): # Quick Actions st.markdown("## ⚡ Quick Actions") +# Alert for mocked navigation +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.") + col1, col2, col3, col4 = st.columns(4) with col1: if st.button("🚀 Deploy Strategy", use_container_width=True, type="primary"): - st.switch_page("frontend/pages/orchestration/deploy_v2_with_controllers/app.py") + st.error("đŸšĢ Navigation unavailable - This is a mocked landing page for demonstration purposes.") with col2: if st.button("📊 View Performance", use_container_width=True): - st.switch_page("frontend/pages/performance/app.py") + st.error("đŸšĢ Navigation unavailable - This is a mocked landing page for demonstration purposes.") with col3: if st.button("🔍 Backtesting", use_container_width=True): - st.switch_page("frontend/pages/backtesting/app.py") + st.error("đŸšĢ Navigation unavailable - This is a mocked landing page for demonstration purposes.") with col4: if st.button("đŸ—ƒī¸ Archived Bots", use_container_width=True): - st.switch_page("frontend/pages/orchestration/archived_bots/app.py") + st.error("đŸšĢ Navigation unavailable - This is a mocked landing page for demonstration purposes.") st.divider() diff --git a/frontend/pages/orchestration/credentials/app.py b/frontend/pages/orchestration/credentials/app.py index 95848411..25c9382c 100644 --- a/frontend/pages/orchestration/credentials/app.py +++ b/frontend/pages/orchestration/credentials/app.py @@ -173,7 +173,7 @@ def add_credentials_section(): if st.button("Submit Credentials"): response = client.accounts.add_credential(account_name, connector_name, config_inputs) if response: - st.success(response) + st.success(f"✅ Successfully added {connector_name} connector to {account_name}!") try: st.rerun(scope="fragment") except Exception: @@ -188,12 +188,7 @@ def add_credentials_section(): with cols[-1]: if st.button("Submit Credentials"): response = client.accounts.add_credential(account_name, connector_name, config_inputs) - if response: - st.success(response) - try: - st.rerun(scope="fragment") - except Exception: - st.rerun() + st.write(response) add_credentials_section()