๐ŸŒฑ Seed System Deep Dive

Deterministic Trading Strategy Generation & Optimization

What is the Seed System?

The seed system is the core of HARVEST's strategy optimization. Similar to how Minecraft uses seeds to generate identical worlds, HARVEST uses seeds to generate reproducible trading strategies.

Each unique combination of trading parameters (indicators, thresholds, multipliers) creates a deterministic "seed" that produces identical trading behavior every time it runs. This enables:

37.6B

Total Combinations

Tracked

4 Layers

Tracking System

Complete Audit Trail

SHA-256

Hash Verification

Immutable Snapshots

Per-TF

Independent

5 Timeframes

๐Ÿ”ง How Seeds Are Generated

Parameter Space

Each seed is a unique combination of these trading parameters:

Category Parameters Combinations
Indicators RSI period, MACD fast/slow/signal, Bollinger period/deviation, EMA periods ~500M
Thresholds RSI overbought/oversold, MACD crossover sensitivity, BB touch points ~200M
Position Sizing Base multiplier, ATR multipliers, timeframe-specific scaling ~100M
Risk Management Stop loss ATR multiplier, take profit targets, trailing stops ~150M
Time Filters Max hold time, entry cooldown, session hours ~50M

Total: 37,600,000,000+ unique combinations possible

Seed Generation Example

# Example seed configuration seed_config = { "rsi_period": 14, "rsi_oversold": 30, "rsi_overbought": 70, "macd_fast": 12, "macd_slow": 26, "macd_signal": 9, "bb_period": 20, "bb_std": 2.0, "atr_period": 14, "tp_atr_multiplier": 2.5, "sl_atr_multiplier": 1.5, "max_hold_minutes": 30 # For 1m timeframe } # This generates seed: 1234567890 # Same config always produces seed: 1234567890 # Same seed always produces same trades

๐Ÿ“Š 4-Layer Tracking System

Layer 1: Seed Registry

ml/seed_registry.json

Purpose: Master database of all tested seed configurations

Contains:

Example Entry:

{ "1234567890": { "config": { "rsi_period": 14, "rsi_oversold": 30, "tp_atr_multiplier": 2.5, ... }, "stats": { "total_trades": 150, "wins": 108, "losses": 42, "win_rate": 0.72, "total_pnl": 45.67, "max_drawdown": 8.23 }, "timeframe": "1m", "status": "whitelisted", "last_tested": "2024-12-18T08:30:00" } }

Layer 2: Seed Snapshots

ml/seed_snapshots.json

Purpose: Immutable configuration verification with cryptographic hashing

Contains:

Why SHA-256?

Example Entry:

{ "1234567890": { "sha256_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "snapshot": { "rsi_period": 14, ... }, "created_at": "2024-12-18T08:30:00Z", "verified": true } }

Layer 3: Seed Catalog

ml/seed_catalog.json

Purpose: Detailed trade-by-trade records with searchable metadata

Contains:

Use Cases:

Example Entry:

{ "trades": [ { "seed": "1234567890", "timeframe": "1m", "asset": "ETH", "date": "2024-12-18", "entry_time": "08:30:00", "exit_time": "08:45:00", "entry_price": 2250.50, "exit_price": 2258.30, "position_size": 3.00, "profit": 0.10, "win": true, "hold_duration_minutes": 15 }, ... ] }

Layer 4: Performance Tracker

ml/seed_performance_tracker.json + separate whitelist/blacklist files

Purpose: Automatic strategy optimization based on performance

Contains:

Whitelist Criteria:

Blacklist Criteria:

๐Ÿงช Testing Workflows

1. Test All Whitelisted Seeds

# Generate test file with all whitelisted seeds for 1m timeframe python ml/seed_tester.py test-all 1m # Output: ml/test_all_whitelisted_1m.json # Contains all seeds with WR โ‰ฅ 70%, positive P&L # Run backtest with all seeds python backtest_90_complete.py --test-seeds-file ml/test_all_whitelisted_1m.json # Results show which seeds perform best on recent data

2. Test Top 10 Performers

# Generate test file with top 10 seeds for 15m timeframe python ml/seed_tester.py test-top10 15m # Output: ml/test_top10_15m.json # Contains 10 seeds with highest combined WR ร— P&L score # Run backtest python backtest_90_complete.py --test-seeds-file ml/test_top10_15m.json # Identify the single best performer

3. Deploy Best Seed to Production

# After testing, overwrite BASE_STRATEGY with best performer python ml/seed_tester.py overwrite 15m --use-best # This updates core/strategy_config.py: # BASE_STRATEGY["15m"] = {best_seed_config} # Now live trading uses the optimized seed for 15m

4. Check System Status

# View current BASE_STRATEGY configuration python ml/seed_tester.py status # Shows active seed for each timeframe: # 1m: Seed 1234567890 (WR: 75%, P&L: +12.34) # 5m: Seed 9876543210 (WR: 72%, P&L: +8.91) # 15m: Seed 5555555555 (WR: 68%, P&L: +15.67) # 1h: Seed 3333333333 (WR: 70%, P&L: +22.45) # 4h: Seed 7777777777 (WR: 65%, P&L: +30.12)

5. Reset to Defaults

# Reset specific timeframe to default BASE_STRATEGY python ml/seed_tester.py reset --timeframe 1m # Reset all timeframes python ml/seed_tester.py reset

โšก Per-Timeframe Independence

Each timeframe has its own independent seed and optimization.

This means:

Why Independent?

๐Ÿ”ฌ Backtest Integration

Test Specific Seed

# Test seed 1234567890 on 90 days of data python backtest_90_complete.py --seed 1234567890 # Results show: # - Total trades # - Win rate # - P&L per timeframe # - Drawdown # - Position sizing stats

Test Multiple Seeds

# Create custom test file cat > ml/custom_seeds.json << EOF { "seeds": [ {"seed": "1111111111", "timeframe": "1m"}, {"seed": "2222222222", "timeframe": "5m"}, {"seed": "3333333333", "timeframe": "15m"} ] } EOF # Run batch test python backtest_90_complete.py --test-seeds-file ml/custom_seeds.json

Compare Seed Performance

After running multiple tests, compare results:

โœ… Best Practices

1. Regular Optimization

2. Validation Before Deployment

3. Monitor Degradation

4. Timeframe-Specific Testing

๐Ÿ“Š Dashboard Integration

The dashboard displays seed information in real-time:

Seed Status Panel

Performance Tracking

Press 'S' in dashboard to browse all seeds, whitelist, and blacklist!

๐Ÿ“ Summary

The seed system enables scientific strategy optimization at scale.

Key Advantages:

This is how HARVEST achieves 70%+ win rates consistently - by scientifically testing and deploying only the best-performing strategies.