u/CommercialPurple3490

Built an AI auto-tuner for my Polymarket bot that reads live BTC market regime before adjusting parameters — sharing the approach

Following up on my previous post about the bot itself. This week I built something on top of it that I found interesting enough to share.

The problem

The bot has ~12 tunable parameters (min edge, trailing stop activation, conviction threshold, etc.). I was adjusting them manually after reviewing trade history. That works, but it's reactive — you're optimizing for what already happened, not what the market is doing right now.

What I built

An auto-tuner that runs on a daily cron (06:00 UTC) and does this:

  1. Pulls the last 48h of closed trades from SQLite and computes performance buckets (PnL by edge range, by exit reason, by hour)
  2. Fetches live BTC candles from Binance (50×1h + 32×15m) and computes:
    • ATR as % of price (1h and 15m)
    • Volatility regime: LOW / MEDIUM / HIGH
    • Momentum over 4h and 24h
    • Volume ratio (recent 4h avg vs 24h baseline)
    • Trend classification: BULLISH / BEARISH / RECOVERING / FADING / NEUTRAL
  3. Sends both the historical metrics AND the live market context to Claude (Haiku) with a prompt that includes forward-looking rules — e.g. "in LOW volatility, raise MIN_EDGE to filter noise; in HIGH volatility, tighten trailing"
  4. Validates the suggested values against hard bounds, applies them to .env, restarts the service
  5. Sends an email with the full reasoning, what changed, and the market regime snapshot

Example output from today

BTC was at ~$81k, ATR-15m at 0.22%, regime LOW, trend BEARISH (-1.9% in 24h).

Claude's suggestions (all applied in dry-run):

  • POLY_MIN_EDGE: 0.22 → 0.36 (filter out noise entries in tight markets)
  • POLY_MAX_SECONDS_LEFT: 240 → 220 (avoid late entries in compressed windows)
  • POLY_TRAILING_ACTIVATION_PCT: 0.08 → 0.12 (TP at 0.97 is the realistic exit anyway)
  • POLY_MIN_CONVICTION: 0.55 → 0.60 (skip marginal setups in choppy conditions)

The reasoning it generated was actually coherent — it tied each change back to a specific regime characteristic, not just the historical bucket.

What I'd like feedback on

  • Is this kind of "regime-aware parameter switching" a known pattern in algo trading? Curious if there's literature or common approaches I should be looking at.
  • The market context is currently just price/ATR/momentum/volume. What else would you add? Funding rate? OI? Implied vol proxy?
  • Daily cadence feels right for now, but wondering if intraday regime shifts (e.g. pre/post US session) would justify more frequent runs — or if that's just overfitting noise.

Happy to discuss the technical side. The prompt engineering for the parameter suggestions is the part I'm least confident about — it works, but it feels fragile.

reddit.com
u/CommercialPurple3490 — 7 days ago

Built an automated trading bot for Polymarket BTC/ETH 15min markets — sharing my journey & looking for feedback

Hey everyone,

I've been building a trading bot for Polymarket's BTC and ETH 15-minute up/down markets. Here's the honest recap.

How it evolved:

  • Started with no filters, almost no logic — results were rough
  • Built a backtester and kept it in sync with the live engine on every change
  • Added fair value estimation, entry filters, conviction scoring for position sizing, and adaptive exits (trailing stop, time-based stall exits)
  • Every change goes through backtest before touching real funds

Test numbers so far:

  • 130 total trades
  • 50% win rate
  • ~+$18.88 net P&L

Still in testing mode, but the logic is holding up.

What I'd love input on:

  1. ETH vs BTC 15min — Is ETH liquidity/spread comparable to BTC, or noticeably worse in your experience?
  2. Correlation risk — BTC and ETH slots move together a lot. How do you think about that exposure when trading both simultaneously?
  3. Market hours — Any times of day where 15min markets feel more predictable (or more random)?

Happy to discuss the technical side. Strategy stays private, but the engineering is fair game. AMA.

reddit.com
u/CommercialPurple3490 — 9 days ago