diff --git a/.Jules/palette.md b/.Jules/palette.md new file mode 100644 index 0000000..3929bc1 --- /dev/null +++ b/.Jules/palette.md @@ -0,0 +1,3 @@ +## 2024-03-07 - Accessible Statistical/Financial Input Tooltips +**Learning:** This application involves highly technical inputs (e.g., basis points, daily volume percentiles, rolling quantiles) that are obscure to less experienced users. Providing concrete, relatable examples inside the native Streamlit `help` parameter makes the interface significantly more intuitive and usable. +**Action:** Always include concrete numeric examples (e.g., "10 bps = 0.10%", "21 days = 1 month") when adding or modifying statistical or financial input parameters across the design system. diff --git a/src/dashboard.py b/src/dashboard.py index 4156c1d..0139d93 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -168,16 +168,37 @@ def get_cache_key(*args) -> str: help="Lookback months for Momentum signal." ) else: - factor_window = st.slider("Factor Beta Window (days)", 20, 252, 63, 7) - vol_window = st.slider("Regime Vol Window (days)", 10, 60, 21, 5) - adv_pct = st.slider("ADV Participation %", 0.01, 0.30, float(DEFAULT_ADV_PCT), 0.01) + factor_window = st.slider( + "Factor Beta Window (days)", + 20, + 252, + 63, + 7, + help="Rolling window for calculating beta to risk factors (e.g., 63 days = 3 months).", + ) + vol_window = st.slider( + "Regime Vol Window (days)", + 10, + 60, + 21, + 5, + help="Rolling window for calculating realized volatility (e.g., 21 days = 1 month).", + ) + adv_pct = st.slider( + "ADV Participation %", + 0.01, + 0.30, + float(DEFAULT_ADV_PCT), + 0.01, + help="Target percentage of Average Daily Volume for trading (e.g., 0.10 = 10% of daily volume).", + ) st.markdown("---") st.subheader("4. Research Rigor") use_oos = st.toggle( "Out-of-Sample Mode", value=False, - help="Uses expanding-window quantiles for regime classification to avoid look-ahead bias. Enable for rigorous backtesting." + help="Uses expanding-window quantiles for regime classification to avoid look-ahead bias. Enable for rigorous backtesting.", ) if use_oos: st.success("✓ Look-ahead bias removed") @@ -185,12 +206,25 @@ def get_cache_key(*args) -> str: st.info("Using full-sample quantiles (exploratory mode)") vol_q_high = st.slider( - "High Volatility Quantile", 0.5, 0.95, DEFAULT_VOL_QUANTILE_HIGH, 0.05 + "High Volatility Quantile", + 0.5, + 0.95, + DEFAULT_VOL_QUANTILE_HIGH, + 0.05, + help="Threshold for defining 'High' volatility regime (e.g., 0.75 = top 25% of historical volatility).", ) if mode == "Single-Asset": st.subheader("5. Backtest Settings") - bt_cost = st.number_input("Transaction Cost (bps)", value=DEFAULT_COST_BPS, step=1) / 10000 + bt_cost = ( + st.number_input( + "Transaction Cost (bps)", + value=DEFAULT_COST_BPS, + step=1, + help="Cost per trade in basis points (e.g., 10 bps = 0.10%).", + ) + / 10000 + ) allow_short = st.checkbox("Allow Short Selling?", value=False) else: st.subheader("5. Alert Thresholds")