Commit Graph

8 Commits

Author SHA1 Message Date
mindesbunister
c7f2df09b9 critical: Fix v11 missing use_quality_filters parameter + RSI index bug
TWO CRITICAL BUGS FIXED:

1. Missing use_quality_filters parameter (Pine Script parity):
   - Added use_quality_filters: bool = True to MoneyLineV11Inputs
   - Implemented bypass logic in signal generation for both long/short
   - When False: only trend flips generate signals (no filtering)
   - When True: all filters must pass (original v11 behavior)
   - Matches Pine Script: finalSignal = buyReady and (not useQualityFilters or (...filters...))

2. RSI index misalignment causing 100% NaN values:
   - np.where() returns numpy arrays without indices
   - pd.Series(gain/loss) created NEW integer indices (0,1,2...)
   - Result: RSI values misaligned with original datetime index
   - Fix: pd.Series(gain/loss, index=series.index) preserves alignment
   - Impact: RSI NaN count 100 → 0, all filters now work correctly

VERIFICATION:
- Test 1 (no filters): 1,424 signals ✓
- Test 2 (permissive RSI): 1,308 signals ✓
- Test 3 (moderate RSI 25-70/30-80): 1,157 signals ✓

Progressive sweep can now proceed with corrected signal generation.
2025-12-06 22:26:50 +01:00
copilot-swe-agent[bot]
f678a027c2 feat: Implement v11 progressive parameter sweep starting from zero filters
Co-authored-by: mindesbunister <32161838+mindesbunister@users.noreply.github.com>
2025-12-06 20:30:57 +00:00
mindesbunister
e97ab483e4 fix: v11 test sweep - performance fix + multiprocessing fix
Critical fixes applied:
1. Performance: Converted pandas .iloc[] to numpy arrays in supertrend_v11() (100x speedup)
2. Multiprocessing: Changed to load CSV per worker instead of pickling 95k row dataframe
3. Import paths: Fixed backtester module imports for deployment
4. Deployment: Added backtester/ directory to EPYC cluster

Result: v11 test sweep now completes (4 workers tested, 129 combos in 5 min)

Next: Deploy with MAX_WORKERS=27 for full 256-combo sweep
2025-12-06 21:15:51 +01:00
copilot-swe-agent[bot]
4599afafaa chore: Add Python cache files to .gitignore and remove from repo
Co-authored-by: mindesbunister <32161838+mindesbunister@users.noreply.github.com>
2025-12-06 19:16:46 +00:00
copilot-swe-agent[bot]
eb0d41aed5 feat: Add v11 test sweep system (256 combinations) with office hours scheduling
Co-authored-by: mindesbunister <32161838+mindesbunister@users.noreply.github.com>
2025-12-06 19:15:54 +00:00
mindesbunister
7e1fe1cc30 feat: V9 advanced parameter sweep with MA gap filter (810K configs)
Parameter space expansion:
- Original 15 params: 101K configurations
- NEW: MA gap filter (3 dimensions) = 18× expansion
- Total: ~810,000 configurations across 4 time profiles
- Chunk size: 1,000 configs/chunk = ~810 chunks

MA Gap Filter parameters:
- use_ma_gap: True/False (2 values)
- ma_gap_min_long: -5.0%, 0%, +5.0% (3 values)
- ma_gap_min_short: -5.0%, 0%, +5.0% (3 values)

Implementation:
- money_line_v9.py: Full v9 indicator with MA gap logic
- v9_advanced_worker.py: Chunk processor (1,000 configs)
- v9_advanced_coordinator.py: Work distributor (2 EPYC workers)
- run_v9_advanced_sweep.sh: Startup script (generates + launches)

Infrastructure:
- Uses existing EPYC cluster (64 cores total)
- Worker1: bd-epyc-02 (32 threads)
- Worker2: bd-host01 (32 threads via SSH hop)
- Expected runtime: 70-80 hours
- Database: SQLite (chunk tracking + results)

Goal: Find optimal MA gap thresholds for filtering false breakouts
during MA whipsaw zones while preserving trend entries.
2025-12-01 18:11:47 +01:00
mindesbunister
cc56b72df2 fix: Database-first cluster status detection + Stop button clarification
CRITICAL FIX (Nov 30, 2025):
- Dashboard showed 'idle' despite 22+ worker processes running
- Root cause: SSH-based worker detection timing out
- Solution: Check database for running chunks FIRST

Changes:
1. app/api/cluster/status/route.ts:
   - Query exploration database before SSH detection
   - If running chunks exist, mark workers 'active' even if SSH fails
   - Override worker status: 'offline' → 'active' when chunks running
   - Log: ' Cluster status: ACTIVE (database shows running chunks)'
   - Database is source of truth, SSH only for supplementary metrics

2. app/cluster/page.tsx:
   - Stop button ALREADY EXISTS (conditionally shown)
   - Shows Start when status='idle', Stop when status='active'
   - No code changes needed - fixed by status detection

Result:
- Dashboard now shows 'ACTIVE' with 2 workers (correct)
- Workers show 'active' status (was 'offline')
- Stop button automatically visible when cluster active
- System resilient to SSH timeouts/network issues

Verified:
- Container restarted: Nov 30 21:18 UTC
- API tested: Returns status='active', activeWorkers=2
- Logs confirm: Database-first logic working
- Workers confirmed running: 22+ processes on worker1, workers on worker2
2025-11-30 22:23:01 +01:00
mindesbunister
5f7702469e remove: V10 momentum system - backtest proved it adds no value
- Removed v10 TradingView indicator (moneyline_v10_momentum_dots.pinescript)
- Removed v10 penalty system from signal-quality.ts (-30/-25 point penalties)
- Removed backtest result files (sweep_*.csv)
- Updated copilot-instructions.md to remove v10 references
- Simplified direction-specific quality thresholds (LONG 90+, SHORT 80+)

Rationale:
- 1,944 parameter combinations tested in backtest
- All top results IDENTICAL (568 trades, $498 P&L, 61.09% WR)
- Momentum parameters had ZERO impact on trade selection
- Profit factor 1.027 too low (barely profitable after fees)
- Max drawdown -$1,270 vs +$498 profit = terrible risk-reward
- v10 penalties were blocking good trades (bug: applied to wrong positions)

Keeping v9 as production system - simpler, proven, effective.
2025-11-28 22:35:32 +01:00