# Bot experiment

A deterministic, indicator-based paper bot has been built. The fitted pattern classifier reproduces 12/12 hindsight benchmark trades on its training week, with 0 extra trades, $83.03 net, and both 75% checks satisfied. **This is a training result, not proof of future performance.**

## Full month

Window: 2026-08-28 14:01 UTC to 2026-09-27 14:01 UTC. Coinbase BTC-USD, 43,200 one-minute candles plus 1,440 warmup candles, no gaps. 3x paper exposure; 0.10% fees and 0.05% slippage per order. Funding uses entry-notional approximation. Decisions see completed candles and execute at the next minute open.

| Test | Trades | Net profit | End pot | Maximum marked drawdown |
|---|---:|---:|---:|---:|
| Pattern classifier: fitted week | 12 | $83.03 | $183.03 | $4.09 |
| Pattern classifier: earlier 23 days | 28 | $0.39 | $100.39 | $34.51 |
| Pattern classifier: full month, fixed $100 stake | 40 | $83.42 | $183.42 | $35.37 |
| Pattern classifier: full month, available pot compounds | 40 | $117.02 | $217.02 | $41.99 |
| 12,000-rule search: selected week | 6 | $13.19 | $113.19 | $18.06 |
| Same rule policy: full month | 24 | $-34.98 | $65.02 | $51.41 |
| Chronological rule selection: first 20 days | 11 | $37.84 | $137.84 | $10.02 |
| Frozen chronological rules: final 10 days | 5 | $0.50 | $100.50 | $17.49 |

The classifier’s full-month profit is almost entirely the week it was fitted to. Its earlier-month 28 trades produced $0.39 net. The full month has 40 trades, so the requested absence of unwanted trades does not generalise to that period. Its earlier-month transfer is a backwards retrospective test, not a future holdout.

## How it learns and decides

The entry and exit trees are fitted using hindsight labels on the reviewed week. Labels are legitimate training targets; they are not information that was available for live decisions at those historical times. Runtime inputs contain only measured current/past factors. The two trees contain 90 nodes and depth up to 12; this flexibility can memorise a small training set. Used factors: rsi, rsiDelta, return60, trendGapATR, fromLow60ATR, fiveRsi, macdSignalATR, fromHigh60ATR, range24, return240, volumeRatio. The input vector contains no timestamp, date, future price, target opportunity identifier or future profit. RSI and ATR use Wilder-style recursive smoothing. MACD uses EMA12 minus EMA26 with a 9-period signal. Five-minute indicators use completed buckets only.

Each signal fills at the next minute open, including fees/slippage. A learned exit pattern closes a profitable position. Backup protection is a $3 close-based loss trigger, a 25% peak-profit give-back after reaching $10 net, and a 72-hour holding limit. Next-open fills can exceed protective levels. The trail activation was adjusted during fitting: it is not an independently validated optimal threshold. Live paper trading starts separately with $100 and reuses its available pot; other accounts are untouched.

## What 75% means

A one-to-one target match requires the same side, entry no earlier than 60 minutes before and no later than 120 minutes after the benchmark entry (and before its exit), and exit no later than 120 minutes after benchmark exit. A strong pass additionally requires realised net profit >=75% of the benchmark net profit and >=75% of its own observed completed-close peak profit during the executed holding period. It does not claim to capture 75% of every larger future peak after the trade closes. Prices are not used for the percentage.

| Target | Side | Benchmark net | Bot net | Peak retained | Pass |
|---|---|---:|---:|---:|---|
| 1 | LONG | $16.46 | $16.47 | 100.0% | YES |
| 2 | LONG | $6.85 | $6.85 | 100.0% | YES |
| 3 | LONG | $5.03 | $5.03 | 99.9% | YES |
| 4 | SHORT | $6.78 | $6.78 | 100.0% | YES |
| 5 | LONG | $6.56 | $6.56 | 100.0% | YES |
| 6 | SHORT | $5.87 | $5.87 | 100.0% | YES |
| 7 | SHORT | $7.09 | $7.09 | 99.9% | YES |
| 8 | SHORT | $5.16 | $5.10 | 99.0% | YES |
| 9 | LONG | $6.02 | $5.96 | 100.0% | YES |
| 10 | LONG | $5.25 | $5.26 | 100.0% | YES |
| 11 | SHORT | $6.31 | $6.30 | 99.8% | YES |
| 12 | LONG | $5.79 | $5.78 | 100.0% | YES |

## Search history

12,000 deterministic parameter combinations were tested across RSI turn thresholds, price confirmation, trend, volume, day range, holding period and exits. The strongest scored simple policy passed 2/12 targets, made $13.19 on the week, and lost $34.98 across the month. A separate 1,600-configuration chronological selection used the first20days only; its frozen final10day result is shown above. That final period includes the previously inspected week, so it is not wholly untouched.

Three classifier revisions were evaluated: broader label windows (6/12 passes; month -$20.77), exact labels with an early profit trail (8/12 passes; month +$77.40), then exact labels with learned exits and a later backup trail (12/12 passes; month +$83.42). These revisions were selected after examining results on the same week.

## Reproduce it

The Bot experiment tab includes a Repeat month backtest button using the saved candles, frozen trees and the same engine as the recorded simulation. Offline, run node replay-bot.mjs in this outputs folder. bot-month-candles.json, bot-pattern-model.json, bot-engine.mjs and bot-experiment-results.json are supplied together. Every trade, loss, entry evidence and result is saved. Model and data hashes are recorded in bot-replay-manifest.json. No live order is sent by a historical replay.

72 automated checks pass, including indicator-prefix invariance, no future/timestamp feature, next-open execution, costs, one-to-one opportunity matching, and live account isolation/stale command cancellation. Worker type checking and dashboard build are checked before publication.

The future paper trial is the next test of generalisation. No claim of 75% future capture or guaranteed profitability is made.
