Files
trading_bot_v4/cluster/analyze_results.sh
mindesbunister 2993bc8895 feat: Update v9 with optimal parameters from exhaustive sweep + consolidate files
Parameter updates (from 4,096 config sweep analysis):
- flipThreshold: 0.6 → 0.5 (optimal for reversal confirmation)
- adxMin: 18 → 21 (stronger trend filter)
- longPosMax: 85 → 75 (prevent chasing tops)
- shortPosMin: 15 → 20 (catch momentum shorts)
- volMin: 0.7 → 1.0 (stronger conviction requirement)

File consolidation:
- Archived moneyline_v9_ma_gap_clean.pinescript (suboptimal defaults)
- Archived moneyline_v9_test.pinescript (suboptimal defaults, missing MA gap)
- Kept moneyline_v9_ma_gap.pinescript as canonical v9 (optimal + MA gap analysis)

Result: Single v9 file with optimal defaults producing 19.44% returns
over 4 months (194.4% annualized) from sweep validation.
2025-12-01 16:04:42 +01:00

61 lines
2.9 KiB
Bash
Executable File

#!/bin/bash
echo "=================================================================================================="
echo "🏆 V9 MONEY LINE PARAMETER SWEEP RESULTS - 4,096 CONFIGURATIONS TESTED"
echo "=================================================================================================="
echo ""
# Top 10 unique by performance
echo "📊 TOP 10 CONFIGURATIONS BY P&L PER $1,000:"
echo ""
head -11 v9_exhaustive_4096_combined_sorted.csv | tail -10 | while IFS=',' read rank trades wr pnl pnl1k pf dd sr flip ma adx lp sp cool pos tp1 tp2 sl tp1c trail vol bars; do
wr_pct=$(awk "BEGIN {printf \"%.1f\", $wr * 100}")
echo "Rank #$rank: \$$pnl1k per \$1k | $trades trades | ${wr_pct}% WR | Total: \$$pnl"
echo " ├─ Trend: flip=$flip ma_gap=$ma adx=$adx long_pos=$lp short_pos=$sp cooldown=$cool"
echo " └─ Risk: TP1=${tp1}x TP2=${tp2}x SL=${sl}x Trail=${trail}x TP1_close=${tp1c}% vol=$vol"
echo ""
done
echo "=================================================================================================="
echo "📈 KEY FINDINGS:"
echo "=================================================================================================="
# Count unique pnl_per_1k values
unique_pnl=$(tail -n +2 v9_exhaustive_4096_combined_sorted.csv | cut -d',' -f5 | sort -u | wc -l)
total_configs=$(tail -n +2 v9_exhaustive_4096_combined_sorted.csv | wc -l)
echo "Total Configurations Tested: $total_configs"
echo "Unique P&L Results: $unique_pnl"
echo ""
# Best and worst
best=$(head -2 v9_exhaustive_4096_combined_sorted.csv | tail -1 | cut -d',' -f5)
worst=$(tail -1 v9_exhaustive_4096_combined_sorted.csv | cut -d',' -f5)
echo "💰 Best Performance: \$$best per \$1,000"
echo "💸 Worst Performance: \$$worst per \$1,000"
echo ""
# Parameter insensitivity check
echo "🔍 PARAMETER SENSITIVITY ANALYSIS:"
echo ""
# Check flip_threshold variation in top 10
flip_04=$(head -11 v9_exhaustive_4096_combined_sorted.csv | tail -10 | cut -d',' -f9 | grep -c "0.4")
flip_05=$(head -11 v9_exhaustive_4096_combined_sorted.csv | tail -10 | cut -d',' -f9 | grep -c "0.5")
echo " flip_threshold in top 10: 0.4 appears $flip_04 times, 0.5 appears $flip_05 times"
# Check ma_gap variation (should all be identical if insensitive)
ma_gaps=$(head -11 v9_exhaustive_4096_combined_sorted.csv | tail -10 | cut -d',' -f10 | sort -u | wc -l)
echo " ma_gap variations in top 10: $ma_gaps unique values (if >1, parameter matters)"
# Check cooldown impact
cool_1=$(head -11 v9_exhaustive_4096_combined_sorted.csv | tail -10 | cut -d',' -f14 | grep -c "^1$")
cool_2=$(head -11 v9_exhaustive_4096_combined_sorted.csv | tail -10 | cut -d',' -f14 | grep -c "^2$")
cool_4=$(head -11 v9_exhaustive_4096_combined_sorted.csv | tail -10 | cut -d',' -f14 | grep -c "^4$")
echo " cooldown in top 10: 1=$cool_1, 2=$cool_2, 4=$cool_4 (clear winner if one dominates)"
echo ""
echo "=================================================================================================="