From 00327ca994727d4ae7de9d212c3340a4353f6a56 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 03:08:11 +0000 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Add=20UX=20toolti?= =?UTF-8?q?ps=20to=20financial=20parameters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: aarjava <218419324+aarjava@users.noreply.github.com> --- .Jules/palette.md | 5 +++++ src/dashboard.py | 26 ++++++++++++++++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 .Jules/palette.md diff --git a/.Jules/palette.md b/.Jules/palette.md new file mode 100644 index 0000000..cedbcab --- /dev/null +++ b/.Jules/palette.md @@ -0,0 +1,5 @@ +## 2024-03-13 - [Initial] + +## 2024-03-13 - [Tooltip UX for Statistical Inputs] +**Learning:** Statistical inputs (like quantiles, bps, adv) without concrete examples cause confusion. +**Action:** Use native Streamlit `help` parameter to provide contextual examples (e.g. 10 bps = 0.10%) for all financial widgets. diff --git a/src/dashboard.py b/src/dashboard.py index 4156c1d..2d399f6 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -141,7 +141,8 @@ def get_cache_key(*args) -> str: portfolio_value = st.number_input( "Portfolio Value (USD)", value=float(DEFAULT_PORTFOLIO_VALUE), - step=100000.0 + step=100000.0, + help="Total capital allocated to the portfolio (e.g., 1,000,000 USD)." ) benchmark_ticker = st.text_input("Benchmark Ticker", value=DEFAULT_BENCHMARK).upper() @@ -168,9 +169,18 @@ 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 factor betas (e.g., 63 days ≈ 3 months)." + ) + vol_window = st.slider( + "Regime Vol Window (days)", 10, 60, 21, 5, + help="Rolling window for calculating annualized volatility (e.g., 21 days ≈ 1 month)." + ) + adv_pct = st.slider( + "ADV Participation %", 0.01, 0.30, float(DEFAULT_ADV_PCT), 0.01, + help="Maximum percentage of Average Daily Volume to trade (e.g., 0.10 = 10% of ADV)." + ) st.markdown("---") st.subheader("4. Research Rigor") @@ -185,12 +195,16 @@ 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 'High' volatility regime (e.g., 0.75 means top 25% of historically most volatile days)." ) 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="Transaction friction per trade (e.g., 10 bps = 0.10%)." + ) / 10000 allow_short = st.checkbox("Allow Short Selling?", value=False) else: st.subheader("5. Alert Thresholds") From efce589322d9bb3ee395ee1a5e4790d341885d18 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 03:12:10 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Add=20UX=20toolti?= =?UTF-8?q?ps=20to=20financial=20parameters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: aarjava <218419324+aarjava@users.noreply.github.com> --- src/dashboard.py | 65 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 47 insertions(+), 18 deletions(-) diff --git a/src/dashboard.py b/src/dashboard.py index 2d399f6..5743e6b 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -142,7 +142,7 @@ def get_cache_key(*args) -> str: "Portfolio Value (USD)", value=float(DEFAULT_PORTFOLIO_VALUE), step=100000.0, - help="Total capital allocated to the portfolio (e.g., 1,000,000 USD)." + help="Total capital allocated to the portfolio (e.g., 1,000,000 USD).", ) benchmark_ticker = st.text_input("Benchmark Ticker", value=DEFAULT_BENCHMARK).upper() @@ -161,25 +161,45 @@ def get_cache_key(*args) -> str: st.subheader("3. Signal Parameters") if mode == "Single-Asset": sma_window = st.slider( - "Trend SMA Window", 10, 200, DEFAULT_SMA_WINDOW, 10, - help="Lookback days for Simple Moving Average trend signal." + "Trend SMA Window", + 10, + 200, + DEFAULT_SMA_WINDOW, + 10, + help="Lookback days for Simple Moving Average trend signal.", ) mom_window = st.slider( - "Momentum Lookback (Months)", 1, 24, DEFAULT_MOMENTUM_WINDOW, 1, - help="Lookback months for Momentum signal." + "Momentum Lookback (Months)", + 1, + 24, + DEFAULT_MOMENTUM_WINDOW, + 1, + help="Lookback months for Momentum signal.", ) else: factor_window = st.slider( - "Factor Beta Window (days)", 20, 252, 63, 7, - help="Rolling window for calculating factor betas (e.g., 63 days ≈ 3 months)." + "Factor Beta Window (days)", + 20, + 252, + 63, + 7, + help="Rolling window for calculating factor betas (e.g., 63 days ≈ 3 months).", ) vol_window = st.slider( - "Regime Vol Window (days)", 10, 60, 21, 5, - help="Rolling window for calculating annualized volatility (e.g., 21 days ≈ 1 month)." + "Regime Vol Window (days)", + 10, + 60, + 21, + 5, + help="Rolling window for calculating annualized volatility (e.g., 21 days ≈ 1 month).", ) adv_pct = st.slider( - "ADV Participation %", 0.01, 0.30, float(DEFAULT_ADV_PCT), 0.01, - help="Maximum percentage of Average Daily Volume to trade (e.g., 0.10 = 10% of ADV)." + "ADV Participation %", + 0.01, + 0.30, + float(DEFAULT_ADV_PCT), + 0.01, + help="Maximum percentage of Average Daily Volume to trade (e.g., 0.10 = 10% of ADV).", ) st.markdown("---") @@ -187,7 +207,7 @@ def get_cache_key(*args) -> str: 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") @@ -195,16 +215,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, - help="Threshold for 'High' volatility regime (e.g., 0.75 means top 25% of historically most volatile days)." + "High Volatility Quantile", + 0.5, + 0.95, + DEFAULT_VOL_QUANTILE_HIGH, + 0.05, + help="Threshold for 'High' volatility regime (e.g., 0.75 means top 25% of historically most volatile days).", ) if mode == "Single-Asset": st.subheader("5. Backtest Settings") - bt_cost = st.number_input( - "Transaction Cost (bps)", value=DEFAULT_COST_BPS, step=1, - help="Transaction friction per trade (e.g., 10 bps = 0.10%)." - ) / 10000 + bt_cost = ( + st.number_input( + "Transaction Cost (bps)", + value=DEFAULT_COST_BPS, + step=1, + help="Transaction friction per trade (e.g., 10 bps = 0.10%).", + ) + / 10000 + ) allow_short = st.checkbox("Allow Short Selling?", value=False) else: st.subheader("5. Alert Thresholds") From f7611804e93ee881770f6a3a7a89aa7b7cf4508d Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 03:18:51 +0000 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Add=20UX=20toolti?= =?UTF-8?q?ps=20to=20financial=20parameters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: aarjava <218419324+aarjava@users.noreply.github.com> From 7a3c5df5808da189c1b8eeb2d8d3fc5539bf0a07 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 03:22:08 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Add=20UX=20toolti?= =?UTF-8?q?ps=20to=20financial=20parameters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: aarjava <218419324+aarjava@users.noreply.github.com>