Overview
Each bot’s trading strategy is encoded in a Genome containing 22 floating-point genes. All gene values are normalized to the range [0.0, 1.0], then decoded into actual trading parameters.Gene Categories
Genes are organized into 5 functional categories:- Market Selection (5 genes): Which markets to trade
- Entry Signals (8 genes): When to enter positions
- Side Selection (2 genes): Bias toward yes/no
- Position Sizing (3 genes): How much to risk
- Risk Management (4 genes): Loss limits and boundaries
Market Selection Genes
These genes filter which markets the bot will consider trading.min_volume_24h
Minimum 24-hour trading volume required.Decoding:Example:
0.0→ 0 (trade any volume)0.5→ 2,500 contracts1.0→ 5,000 contracts (high-volume only)
min_open_interest
Minimum open interest (total contracts held) required.Decoding:
min_time_to_expiry_hrs
Minimum time until market closes (hours).Decoding:Example:
0.0→ 0h (trade markets closing any time)0.5→ 12h (avoid markets closing too soon)1.0→ 24h (only trade far-dated markets)
max_time_to_expiry_hrs
Maximum time until market closes (hours).Decoding:
category_mask
Bit mask for selecting market categories.Decoding:Example (with 4 categories: [‘sports’, ‘finance’, ‘politics’, ‘climate’]):
0.0→ binary0000→ all categories (fallback)0.25→ binary0011→ sports + finance0.75→ binary1100→ politics + climate1.0→ binary1111→ all categories
The feed only provides markets closing within 24 hours, so the effective range for time-to-expiry is 0-24 hours.
Entry Signal Genes
These genes determine when and how the bot enters positions.signal_type
Discretized into one of 5 signal strategies.Decoding:Signal Types:
| Gene Range | Index | Signal Type | Strategy |
|---|---|---|---|
| 0.00-0.19 | 0 | price_level | Buy when ask is in target range |
| 0.20-0.39 | 1 | momentum | Follow price direction |
| 0.40-0.59 | 2 | mean_reversion | Buy deviations from mean |
| 0.60-0.79 | 3 | value | Buy cheapest side vs 50/50 |
| 0.80-1.00 | 4 | contrarian | Bet against confident crowd |
price_threshold_low
Lower bound for price_level signal.Decoding:Used by
price_level signal: buy when threshold_low <= ask <= threshold_high.price_threshold_high
Upper bound for price_level signal.Decoding:
momentum_lookback
How many ticks to look back for momentum calculation.Decoding:Used by
momentum signal to compute price change percentage over time.momentum_trigger
Percentage change threshold to trigger momentum trade.Decoding:Example:
- If price increased by more than
trigger_pct, buy YES - If price decreased by more than
-trigger_pct, buy NO
mean_rev_zscore
Z-score threshold for mean reversion signal.Decoding:Used by
mean_reversion signal:- If price > mean + threshold * stdev → buy NO (expect reversion down)
- If price < mean - threshold * stdev → buy YES (expect reversion up)
value_edge_min
Minimum edge vs fair value (50¢) to trigger value trade.Decoding:Used by
value signal:- Buy YES if
yes_ask < 0.50 - edge_min(cheap) - Buy NO if
no_ask < 0.50 - edge_min(cheap)
contrarian_threshold
Price level above which to bet against the crowd.Decoding:Used by
contrarian signal:- If
yes_ask > threshold→ buy NO (crowd too bullish) - If
no_ask > threshold→ buy YES (crowd too bearish)
Side Selection Genes
These genes introduce bias in which side (yes/no) the bot prefers.side_bias
Overall bias toward YES or NO.Decoding:Example:
0.0→ Always bet NO0.5→ No bias, follow signal1.0→ Always bet YES
side_flip_prob
Probability of flipping the signal’s recommended side.Decoding:Adds randomness/exploration to side selection.
Position Sizing Genes
These genes control how much capital to allocate per trade.bankroll_fraction
Fraction of current equity to risk per trade.Decoding:Example (with $100 equity):
0.0→ $0.50 per trade0.5→ $5.25 per trade1.0→ $10.00 per trade
max_concurrent_positions
Maximum number of open positions at once.Decoding:Prevents over-diversification or concentration.
max_single_market_pct
Maximum percentage of equity in a single market.Decoding:
Risk Management Genes
These genes define hard limits to protect capital.daily_loss_limit_pct
Maximum daily loss as percentage of equity.Decoding:Bot stops trading for the day if
daily_pnl <= -equity * loss_limit.max_trades_per_day
Maximum number of trades per day.Decoding:
min_price
Minimum ask price to consider trading.Decoding:Markets with both sides below this price are filtered out.
max_price
Maximum ask price to consider trading.Decoding:
Gene Decoding Example
Here’s a complete example of decoding a genome:Gene Inheritance
Genes are passed to offspring through:- Elitism: Top 5 bots keep exact gene values
- Crossover: Each gene randomly chosen from parent A or B
- Mutation: Each gene has 15% chance of Gaussian perturbation
Creating Custom Genomes
Next Steps
Fitness Evaluation
How genomes are scored based on trading performance
Evolution Operators
Selection, crossover, and mutation mechanics
Analysis
Analyzing gene distributions and correlations