full-plus-sizing   btcusdc   qwen3-coder:480b-cloud

2026-05-08_full-plus-sizing_btcusdc_qwen3-coder-480b-cloud_bfe48831
window: 2026-02-01T00:00:00Z → 2026-03-01T00:00:00Z tick: 1h model: qwen3-coder:480b-cloud fingerprint: c27d60d41e3a943f
PnL
-6.46%
$-646.00 on $10,000
Final balance
$9354.00
9354.00 USDC + 0.000000 BTC
Trades
52
26 BUY · 26 SELL
Win rate
7.7%
2/26 sells profitable
Realized total
$-646.00
sum of SELL realized PnL
Ticks
673
parse fails: 0 · invalid sells: 0

Price + trades (hover markers for details)

$62102$66545$70988$75430$7987302-01 00:0002-05 16:0002-10 08:0002-15 00:0002-19 16:0002-24 08:0003-01 00:002026-02-01T08:00:00Z · BUY E · $2000.00 @ $78752.51E2026-02-01T09:00:00Z · SELL stop · $1985.85 @ $78604.02 · pnl=-14.15$ (-0.71%)stop2026-02-01T13:00:00Z · BUY E · $1997.17 @ $78869.77E2026-02-01T14:00:00Z · SELL stop · $1972.88 @ $78317.51 · pnl=-24.29$ (-1.22%)stop2026-02-02T04:00:00Z · BUY A · $3486.54 @ $76703.24A2026-02-02T05:00:00Z · SELL stop · $3431.33 @ $75894.15 · pnl=-55.22$ (-1.58%)stop2026-02-03T11:00:00Z · BUY E · $1981.27 @ $78528.56E2026-02-03T13:00:00Z · SELL tp · $1965.99 @ $78330.26 · pnl=-15.28$ (-0.77%)tp2026-02-03T17:00:00Z · BUY E · $1978.21 @ $76887.73E2026-02-03T18:00:00Z · SELL stop · $1917.47 @ $74915.79 · pnl=-60.74$ (-3.07%)stop2026-02-04T15:00:00Z · BUY E · $1966.06 @ $74747.97E2026-02-04T16:00:00Z · SELL stop · $1939.85 @ $74136.36 · pnl=-26.22$ (-1.33%)stop2026-02-05T02:00:00Z · BUY E · $1960.82 @ $72799.53E2026-02-05T03:00:00Z · SELL stop · $1914.60 @ $71454.44 · pnl=-46.22$ (-2.36%)stop2026-02-05T06:00:00Z · BUY E · $1951.58 @ $71102.11E2026-02-05T07:00:00Z · SELL stop · $1937.33 @ $70951.51 · pnl=-14.25$ (-0.73%)stop2026-02-05T12:00:00Z · BUY E · $1948.73 @ $70685.55E2026-02-05T13:00:00Z · SELL tp · $1907.84 @ $69563.57 · pnl=-40.89$ (-2.10%)tp2026-02-06T00:00:00Z · BUY E · $1940.55 @ $63238.32E2026-02-06T01:00:00Z · SELL stop · $1938.74 @ $63509.39 · pnl=-1.81$ (-0.09%)stop2026-02-06T07:00:00Z · BUY E · $1940.19 @ $65327.57E2026-02-06T08:00:00Z · SELL stop · $1916.18 @ $64856.00 · pnl=-24.01$ (-1.24%)stop2026-02-07T21:00:00Z · BUY A · $3386.92 @ $70004.91A2026-02-07T22:00:00Z · SELL tp · $3344.46 @ $69497.99 · pnl=-42.47$ (-1.25%)tp2026-02-08T08:00:00Z · BUY A · $3372.06 @ $70084.75A2026-02-08T09:00:00Z · SELL tp · $3381.85 @ $70665.59 · pnl=+9.79$ (+0.29%)tp2026-02-08T12:00:00Z · BUY A · $3375.49 @ $71380.98A2026-02-08T13:00:00Z · SELL tp · $3351.31 @ $71249.95 · pnl=-24.18$ (-0.72%)tp2026-02-08T17:00:00Z · BUY E · $1924.01 @ $70783.54E2026-02-08T20:00:00Z · SELL tp · $1931.31 @ $71422.97 · pnl=+7.30$ (+0.38%)tp2026-02-09T01:00:00Z · BUY E · $1925.47 @ $70870.38E2026-02-09T02:00:00Z · SELL stop · $1901.94 @ $70369.53 · pnl=-23.53$ (-1.22%)stop2026-02-09T09:00:00Z · BUY A · $3361.34 @ $70248.85A2026-02-09T11:00:00Z · SELL stop · $3271.04 @ $68727.88 · pnl=-90.30$ (-2.69%)stop2026-02-10T04:00:00Z · BUY A · $3329.74 @ $69884.52A2026-02-10T05:00:00Z · SELL stop · $3309.47 @ $69831.62 · pnl=-20.26$ (-0.61%)stop2026-02-10T13:00:00Z · BUY A · $3322.64 @ $68977.93A2026-02-10T16:00:00Z · SELL tp · $3320.04 @ $69293.37 · pnl=-2.61$ (-0.08%)tp2026-02-14T12:00:00Z · BUY E · $1898.13 @ $67717.00E2026-02-14T13:00:00Z · SELL stop · $1878.48 @ $67365.56 · pnl=-19.65$ (-1.04%)stop2026-02-16T00:00:00Z · BUY E · $1894.20 @ $67716.97E2026-02-16T01:00:00Z · SELL tp · $1874.60 @ $67365.56 · pnl=-19.61$ (-1.04%)tp2026-02-16T11:00:00Z · BUY E · $1890.28 @ $67716.95E2026-02-16T12:00:00Z · SELL tp · $1870.72 @ $67365.56 · pnl=-19.56$ (-1.03%)tp2026-02-17T01:00:00Z · BUY E · $1886.37 @ $67716.92E2026-02-17T03:00:00Z · SELL tp · $1866.85 @ $67365.56 · pnl=-19.52$ (-1.03%)tp2026-02-17T17:00:00Z · BUY E · $1882.46 @ $67716.89E2026-02-17T19:00:00Z · SELL stop · $1862.98 @ $67365.56 · pnl=-19.48$ (-1.03%)stop2026-02-18T16:00:00Z · BUY E · $1878.57 @ $67716.87E2026-02-18T17:00:00Z · SELL stop · $1859.13 @ $67365.56 · pnl=-19.44$ (-1.03%)stop2026-02-19T04:00:00Z · BUY E · $1874.68 @ $67716.84E2026-02-19T05:00:00Z · SELL tp · $1855.28 @ $67365.56 · pnl=-19.40$ (-1.03%)tp
BUY SELL position open

Equity curve (vault total_usd vs time)

$10000$10000$9354

Trades

sim_tssidepathamount $price $cost %realized $realized %
2026-02-01 08:00:00 BUY E $2000.00 $78343.00 0.52%
2026-02-01 09:00:00 SELL stop $1985.85 $78604.02 0.52% $-14.15 -0.71%
2026-02-01 13:00:00 BUY E $1997.17 $78459.67 0.52%
2026-02-01 14:00:00 SELL stop $1972.88 $78317.51 0.52% $-24.29 -1.22%
2026-02-02 04:00:00 BUY A $3486.54 $76292.98 0.53%
2026-02-02 05:00:00 SELL stop $3431.33 $75894.15 0.53% $-55.22 -1.58%
2026-02-03 11:00:00 BUY E $1981.27 $78120.36 0.52%
2026-02-03 13:00:00 SELL tp $1965.99 $78330.26 0.52% $-15.28 -0.77%
2026-02-03 17:00:00 BUY E $1978.21 $76488.08 0.52%
2026-02-03 18:00:00 SELL stop $1917.47 $74915.79 0.52% $-60.74 -3.07%
2026-02-04 15:00:00 BUY E $1966.06 $74359.53 0.52%
2026-02-04 16:00:00 SELL stop $1939.85 $74136.36 0.52% $-26.22 -1.33%
2026-02-05 02:00:00 BUY E $1960.82 $72421.26 0.52%
2026-02-05 03:00:00 SELL stop $1914.60 $71454.44 0.52% $-46.22 -2.36%
2026-02-05 06:00:00 BUY E $1951.58 $70732.72 0.52%
2026-02-05 07:00:00 SELL stop $1937.33 $70951.51 0.52% $-14.25 -0.73%
2026-02-05 12:00:00 BUY E $1948.73 $70318.35 0.52%
2026-02-05 13:00:00 SELL tp $1907.84 $69563.57 0.52% $-40.89 -2.10%
2026-02-06 00:00:00 BUY E $1940.55 $62909.86 0.52%
2026-02-06 01:00:00 SELL stop $1938.74 $63509.39 0.52% $-1.81 -0.09%
2026-02-06 07:00:00 BUY E $1940.19 $64988.26 0.52%
2026-02-06 08:00:00 SELL stop $1916.18 $64856.00 0.52% $-24.01 -1.24%
2026-02-07 21:00:00 BUY A $3386.92 $69631.18 0.53%
2026-02-07 22:00:00 SELL tp $3344.46 $69497.99 0.53% $-42.47 -1.25%
2026-02-08 08:00:00 BUY A $3372.06 $69710.69 0.53%
2026-02-08 09:00:00 SELL tp $3381.85 $70665.59 0.53% +$9.79 +0.29%
2026-02-08 12:00:00 BUY A $3375.49 $70999.98 0.53%
2026-02-08 13:00:00 SELL tp $3351.31 $71249.95 0.53% $-24.18 -0.72%
2026-02-08 17:00:00 BUY E $1924.01 $70416.00 0.52%
2026-02-08 20:00:00 SELL tp $1931.31 $71422.97 0.52% +$7.30 +0.38%
2026-02-09 01:00:00 BUY E $1925.47 $70502.38 0.52%
2026-02-09 02:00:00 SELL stop $1901.94 $70369.53 0.52% $-23.53 -1.22%
2026-02-09 09:00:00 BUY A $3361.34 $69873.99 0.53%
2026-02-09 11:00:00 SELL stop $3271.04 $68727.88 0.53% $-90.30 -2.69%
2026-02-10 04:00:00 BUY A $3329.74 $69511.83 0.53%
2026-02-10 05:00:00 SELL stop $3309.47 $69831.62 0.53% $-20.26 -0.61%
2026-02-10 13:00:00 BUY A $3322.64 $68610.12 0.53%
2026-02-10 16:00:00 SELL tp $3320.04 $69293.37 0.53% $-2.61 -0.08%
2026-02-14 12:00:00 BUY E $1898.13 $67365.56 0.52%
2026-02-14 13:00:00 SELL stop $1878.48 $67365.56 0.52% $-19.65 -1.04%
2026-02-16 00:00:00 BUY E $1894.20 $67365.56 0.52%
2026-02-16 01:00:00 SELL tp $1874.60 $67365.56 0.52% $-19.61 -1.04%
2026-02-16 11:00:00 BUY E $1890.28 $67365.56 0.52%
2026-02-16 12:00:00 SELL tp $1870.72 $67365.56 0.52% $-19.56 -1.03%
2026-02-17 01:00:00 BUY E $1886.37 $67365.56 0.52%
2026-02-17 03:00:00 SELL tp $1866.85 $67365.56 0.52% $-19.52 -1.03%
2026-02-17 17:00:00 BUY E $1882.46 $67365.56 0.52%
2026-02-17 19:00:00 SELL stop $1862.98 $67365.56 0.52% $-19.48 -1.03%
2026-02-18 16:00:00 BUY E $1878.57 $67365.56 0.52%
2026-02-18 17:00:00 SELL stop $1859.13 $67365.56 0.52% $-19.44 -1.03%
2026-02-19 04:00:00 BUY E $1874.68 $67365.56 0.52%
2026-02-19 05:00:00 SELL tp $1855.28 $67365.56 0.52% $-19.40 -1.03%

Prompts used (captured at run launch — frozen)

Variant full-plus-sizing — diff vs base shown for stages that override.

01-research.mdunchanged from base

Full prompt

You are the **research** stage of the trading workflow.

You are running in **backtest replay mode**. The `trade_signals` tool was already invoked for you and its output is below. Your job: combine those signals with the vault state and emit a flat single-line JSON. **NO arithmetic** — copy values verbatim.

## trade_signals output (verbatim, do not modify)

```json
{{trade_signals}}
```

## Current vault state

```json
{{vault_state}}
```

## Open positions

```json
{{open_positions}}
```

## Output schema (your last message MUST be a single-line JSON object — no markdown fence, just one line)

```json
{
  "regime": "<bear|caution|normal|bull>",
  "price": <number>,
  "rsi_15m": <number>,
  "rsi_1h": <number>,
  "rsi_4h": <number>,
  "rsi_daily": <number>,
  "rsi_weekly": <number>,
  "macd_15m_histogram": <number>,
  "macd_15m_flipped_positive": <boolean>,
  "rsi_15m_crossed_up_from_below_35": <boolean>,
  "ema20_weekly": <number>,
  "atr_pct": <number>,
  "vol_ratio": <number>,
  "volume_confirm_15m": <boolean>,
  "is_red": <boolean>,
  "is_green": <boolean>,
  "lower_wick_ratio": <number>,
  "body_pct_price": <number>,
  "at_lower_bb": <boolean>,
  "close_above_low_12_pct": <number>,
  "breakout_last_24_periods": <boolean>,
  "tf_15m": "<STRONG_BUY|BUY|NEUTRAL|SELL|STRONG_SELL>",
  "tf_1h": "<...>",
  "tf_4h": "<...>",
  "tf_daily": "<...>",
  "tf_weekly": "<...>",
  "tf_buy_count": <0..4>,
  "tf_sell_count": <0..4>,
  "vault_idle_usd": <number>,
  "vault_position_token_usd": <number>,
  "vault_position_token_amount": <number or 0 if no position>,
  "open_position_cost_basis_usd": <number or null if no position>,
  "open_position_scalp_target_usd": <number or null>,
  "open_position_tp_target_usd": <number or null>,
  "open_position_stop_loss_usd": <number or null>,
  "open_position_entry_path": "<A|B|C|D|E or null if no position>",
  "open_position_last_buy_ts": "<ISO timestamp or null if no position>",
  "open_position_ticks_since_buy": <integer or null — tick count since the open BUY>
}
```

Emit on a single line. The next stage parses your last line as JSON; markdown fences break the parser and waste an iteration.
02-decide.mdoverridden

Diff vs base

You are the **decide** stage of the trading workflow.
… 10 unchanged lines …
**Default = HOLD.** Only emit `buy` / `sell` when an explicit rule fires below.
- Risk thresholds come from `strategy.config` in the system prompt: `entryRsiThreshold`, `fullAlignmentBars`, `spotEntryPct`, `maxExposurePct`, `scalpRsiThreshold`. Defaults below assume the aggressive tier; moderate / conservative override via the config knobs.
+ **Tier override = MODERATE.** Use the moderate tier values everywhere a tier is mentioned (`entryRsiThreshold = 42`, sizing as listed below). This caps the exposure on counter-trend entries vs the aggressive default.
### Position-already-open path (`previous.vault_position_token_amount > 0`)
Test exits in priority order. First match wins.
+ **Min-hold protection (counter-trend):** When `previous.open_position_entry_path ∈ {"B", "E"}` AND `previous.open_position_ticks_since_buy < 2`, the only exits allowed are `stop` (safety) and `tp` (full take-profit). Skip `scalp`, `trailing`, and `reversal` — counter-trend entries need at least 2 tick bars to let the rebound develop. If neither stop nor tp fires within this window → `hold`.
+
**Stop-loss:** `previous.price <= previous.open_position_stop_loss_usd` → `sell`, `path: "stop"`, full close.
… 4 unchanged lines …
**Trailing exit:** the orchestrator does not have a way to compute "NET PnL" without arithmetic, so this path requires `previous.tf_15m` flipping to `SELL` AND `previous.macd_15m_histogram < 0` AND `previous.price > previous.open_position_cost_basis_usd / previous.vault_position_token_amount`. (The position is up vs cost basis AND momentum is rolling over.) → `sell`, `path: "trailing"`.
- **Trend reversal:** `previous.tf_4h ∈ {SELL, STRONG_SELL}` AND `previous.tf_daily ∈ {SELL, STRONG_SELL}` → `sell`, `path: "reversal"`.
+ **Trend reversal:** `previous.tf_4h ∈ {SELL, STRONG_SELL}` AND `previous.tf_daily ∈ {SELL, STRONG_SELL}` AND `previous.open_position_entry_path ∉ {"B", "E"}` → `sell`, `path: "reversal"`. **Excluded for B/E entries**: those paths enter deliberately counter-trend, so a still-bearish HTF is the entry premise, not a reversal — let stop/tp/scalp/trailing handle the exit.
If none fire → `hold`.
… 3 unchanged lines …
**HARD GUARD — read before everything else in this section.** When `previous.vault_position_token_amount == 0` you hold zero of the trading token, so you have NOTHING to sell. Exits (`stop`, `tp`, `scalp`, `trailing`, `reversal`) are FORBIDDEN here regardless of how bearish the timeframes look — they exist ONLY in the Position-already-open path above. The only valid emissions when position is 0 are: `hold`, or `buy` with one of the entry paths A / B / C / D / E. Emitting `{"decision":"sell", ...}` with `vault_position_token_amount == 0` is a hard contract violation: there is no inventory to dispose of and the orchestrator will reject it.
- Test in priority order. First match wins. Use `config.entryRsiThreshold` (default 45 aggressive / 42 moderate / 40 conservative) where shown.
+ Test in priority order. First match wins. Use **moderate tier**: `entryRsiThreshold = 42`.
#### Path A — Short-timeframe mean-reversion
LONG fires when ALL hold:
- - `previous.rsi_1h < config.entryRsiThreshold`
+ - `previous.rsi_1h < 42` (moderate threshold)
- `previous.rsi_15m_crossed_up_from_below_35 == true` (15m oversold reversal confirmed)
- `previous.macd_15m_flipped_positive == true` (15m momentum flipped within the last 2 bars)
- `previous.tf_daily ∉ {SELL, STRONG_SELL}` (1d not bearish — daily-flat-or-better)
- Size: `config.spotEntryPct.A` (default 50% aggressive / 35% moderate / 20% conservative).
+ Size: **35%** (moderate).
#### Path E — Capitulation oversold (BYPASS HTF wall, SPOT-ONLY)
LONG fires when ALL hold:
- - `previous.rsi_1h < 22` (aggressive), `< 27` (moderate), `< 18` (conservative). DO NOT relax — this is the extreme-tail entry.
+ - `previous.rsi_1h < 27` (moderate threshold). DO NOT relax — this is the extreme-tail entry.
- `previous.rsi_15m > 30` (some recovery from the bottom)
- `previous.macd_15m_flipped_positive == true` (early momentum flip confirmed)
- `previous.close_above_low_12_pct >= 0.3` (proof the local bottom is in)
- No HTF filter. Size: 30% aggressive / 20% moderate / 12% conservative. 60-min anti-wash window after this entry's exit (no Path A re-entry inside that window).
+ No HTF filter. Size: **20%** (moderate). 60-min anti-wash window after this entry's exit.
#### Path C — Trend continuation pullback
LONG fires when ALL hold:
- `previous.tf_buy_count >= 3` (3-of-4 timeframes BUY or STRONG_BUY)
- - `previous.rsi_1h < 60` (not yet overbought — leaves room)
+ - `previous.rsi_1h < 60` (not yet overbought)
- `previous.macd_15m_histogram > 0` (15m is going up)
- - `previous.atr_pct >= 1.0` (enough volatility for a meaningful continuation)
+ - `previous.atr_pct >= 1.0`
- `previous.regime != "bear"`
- Catches the **mid-trend pullback** that Path A (oversold) and Path D (4/4 + breakout) both miss. Size: 35% aggressive / 25% moderate / 15% conservative. 30-min anti-wash window.
+ Size: **25%** (moderate). 30-min anti-wash window.
#### Path B — Deep-value counter-trend
… 3 unchanged lines …
- `previous.tf_4h ∈ {BUY, STRONG_BUY, NEUTRAL}` (4h reversing up)
- `previous.tf_1h ∈ {BUY, STRONG_BUY}` AND `previous.rsi_15m >= 50`
+ - `previous.macd_15m_flipped_positive == true` (15m momentum confirms — required to avoid catching a falling knife)
- Size: 65% aggressive / 50% moderate / 30% conservative.
+ Size: **50%** (moderate, down from 65% aggressive).
#### Path D — Confirmed momentum
LONG fires when ALL hold:
- - `previous.tf_buy_count >= config.fullAlignmentBars` (default 4 = strict, 3 = looser)
- - `previous.breakout_last_24_periods == true` (15m close above the 24-bar high)
- - `previous.volume_confirm_15m == true` (15m vol_ratio ≥ 1.3)
+ - `previous.tf_buy_count >= 3` (moderate alignment, looser than aggressive 4/4)
+ - `previous.breakout_last_24_periods == true`
+ - `previous.volume_confirm_15m == true`
- `previous.atr_pct >= 1.5`
- Size: 65% aggressive / 50% moderate / 30% conservative.
+ Size: **50%** (moderate).
### Default
… 3 unchanged lines …
## Anti-wash trade rule
- After a full take-profit / final scalp / stop / trailing / reversal exit, the next 30 min ONLY allows Path A (oversold dip) or Path E (capitulation). Path B / Path C / Path D are forbidden in that window regardless of signal. The runtime SELL GUARD + 2h BUY cooldown back this up at the code level — your job is to not even propose a forbidden re-entry.
+ After a full take-profit / final scalp / stop / trailing / reversal exit, the next 30 min ONLY allows Path A (oversold dip) or Path E (capitulation). Path B / Path C / Path D are forbidden in that window regardless of signal.
## Output schema (your last message MUST be a single-line JSON object — no markdown fences, just one line)
… 3 unchanged lines …
```
- The orchestrator parses your LAST line as JSON. Emit it on a single line, no code fence, no trailing prose. The skip_condition `previous.decision == "hold"` requires a parseable JSON; if you wrap the line in markdown the orchestrator falls back to a string and execute spawns wastefully.
+ The orchestrator parses your LAST line as JSON. Emit it on a single line, no code fence, no trailing prose.
If `previous.unavailable == true` → `{"decision":"hold","path":null,"size_pct":null,"scalp_pct":null,"reasoning":"indicators unavailable"}`.

Full prompt (variant)

You are the **decide** stage of the trading workflow.

Apply the strict v30 rules to research's output and pick exactly one action. **NO arithmetic.** Compare values directly with the listed thresholds. Do not derive flags, do not recompute MACD/RSI/EMA, do not interpolate.

## Previous stage output

```json
{{previous}}
```

## Decision rules

**Default = HOLD.** Only emit `buy` / `sell` when an explicit rule fires below.

**Tier override = MODERATE.** Use the moderate tier values everywhere a tier is mentioned (`entryRsiThreshold = 42`, sizing as listed below). This caps the exposure on counter-trend entries vs the aggressive default.

### Position-already-open path (`previous.vault_position_token_amount > 0`)

Test exits in priority order. First match wins.

**Min-hold protection (counter-trend):** When `previous.open_position_entry_path ∈ {"B", "E"}` AND `previous.open_position_ticks_since_buy < 2`, the only exits allowed are `stop` (safety) and `tp` (full take-profit). Skip `scalp`, `trailing`, and `reversal` — counter-trend entries need at least 2 tick bars to let the rebound develop. If neither stop nor tp fires within this window → `hold`.

**Stop-loss:** `previous.price <= previous.open_position_stop_loss_usd` → `sell`, `path: "stop"`, full close.

**Full take-profit:** `previous.price >= previous.open_position_tp_target_usd` → `sell`, `path: "tp"`, full close.

**Quick scalp (33%):** `previous.price >= previous.open_position_scalp_target_usd` AND (`previous.rsi_1h >= scalpRsiThreshold` OR `previous.rsi_15m >= scalpRsiThreshold + 5`) → `sell`, `path: "scalp"`, `scalp_pct: 33`.

**Trailing exit:** the orchestrator does not have a way to compute "NET PnL" without arithmetic, so this path requires `previous.tf_15m` flipping to `SELL` AND `previous.macd_15m_histogram < 0` AND `previous.price > previous.open_position_cost_basis_usd / previous.vault_position_token_amount`. (The position is up vs cost basis AND momentum is rolling over.) → `sell`, `path: "trailing"`.

**Trend reversal:** `previous.tf_4h ∈ {SELL, STRONG_SELL}` AND `previous.tf_daily ∈ {SELL, STRONG_SELL}` AND `previous.open_position_entry_path ∉ {"B", "E"}` → `sell`, `path: "reversal"`. **Excluded for B/E entries**: those paths enter deliberately counter-trend, so a still-bearish HTF is the entry premise, not a reversal — let stop/tp/scalp/trailing handle the exit.

If none fire → `hold`.

### No-position path (`previous.vault_position_token_amount == 0`)

**HARD GUARD — read before everything else in this section.** When `previous.vault_position_token_amount == 0` you hold zero of the trading token, so you have NOTHING to sell. Exits (`stop`, `tp`, `scalp`, `trailing`, `reversal`) are FORBIDDEN here regardless of how bearish the timeframes look — they exist ONLY in the Position-already-open path above. The only valid emissions when position is 0 are: `hold`, or `buy` with one of the entry paths A / B / C / D / E. Emitting `{"decision":"sell", ...}` with `vault_position_token_amount == 0` is a hard contract violation: there is no inventory to dispose of and the orchestrator will reject it.

Test in priority order. First match wins. Use **moderate tier**: `entryRsiThreshold = 42`.

#### Path A — Short-timeframe mean-reversion

LONG fires when ALL hold:
- `previous.rsi_1h < 42` (moderate threshold)
- `previous.rsi_15m_crossed_up_from_below_35 == true` (15m oversold reversal confirmed)
- `previous.macd_15m_flipped_positive == true` (15m momentum flipped within the last 2 bars)
- `previous.tf_daily ∉ {SELL, STRONG_SELL}` (1d not bearish — daily-flat-or-better)

Size: **35%** (moderate).

#### Path E — Capitulation oversold (BYPASS HTF wall, SPOT-ONLY)

LONG fires when ALL hold:
- `previous.rsi_1h < 27` (moderate threshold). DO NOT relax — this is the extreme-tail entry.
- `previous.rsi_15m > 30` (some recovery from the bottom)
- `previous.macd_15m_flipped_positive == true` (early momentum flip confirmed)
- `previous.close_above_low_12_pct >= 0.3` (proof the local bottom is in)

No HTF filter. Size: **20%** (moderate). 60-min anti-wash window after this entry's exit.

#### Path C — Trend continuation pullback

LONG fires when ALL hold:
- `previous.tf_buy_count >= 3` (3-of-4 timeframes BUY or STRONG_BUY)
- `previous.rsi_1h < 60` (not yet overbought)
- `previous.macd_15m_histogram > 0` (15m is going up)
- `previous.atr_pct >= 1.0`
- `previous.regime != "bear"`

Size: **25%** (moderate). 30-min anti-wash window.

#### Path B — Deep-value counter-trend

LONG fires when ALL hold:
- `previous.rsi_daily < 30` AND `previous.rsi_weekly < 35`
- `previous.tf_4h ∈ {BUY, STRONG_BUY, NEUTRAL}` (4h reversing up)
- `previous.tf_1h ∈ {BUY, STRONG_BUY}` AND `previous.rsi_15m >= 50`
- `previous.macd_15m_flipped_positive == true` (15m momentum confirms — required to avoid catching a falling knife)

Size: **50%** (moderate, down from 65% aggressive).

#### Path D — Confirmed momentum

LONG fires when ALL hold:
- `previous.tf_buy_count >= 3` (moderate alignment, looser than aggressive 4/4)
- `previous.breakout_last_24_periods == true`
- `previous.volume_confirm_15m == true`
- `previous.atr_pct >= 1.5`

Size: **50%** (moderate).

### Default

If no path fires → `hold`.

## Anti-wash trade rule

After a full take-profit / final scalp / stop / trailing / reversal exit, the next 30 min ONLY allows Path A (oversold dip) or Path E (capitulation). Path B / Path C / Path D are forbidden in that window regardless of signal.

## Output schema (your last message MUST be a single-line JSON object — no markdown fences, just one line)

```json
{"decision":"<buy|sell|hold>","path":"<A|B|C|D|E|stop|tp|scalp|trailing|reversal|null>","size_pct":<number 0-100 or null>,"scalp_pct":<33|null>,"reasoning":"<one short sentence>"}
```

The orchestrator parses your LAST line as JSON. Emit it on a single line, no code fence, no trailing prose.

If `previous.unavailable == true` → `{"decision":"hold","path":null,"size_pct":null,"scalp_pct":null,"reasoning":"indicators unavailable"}`.
03-execute.mdunchanged from base

Full prompt

You are the **execute** stage of the trading workflow.

You are running in **backtest replay mode**. Instead of calling on-chain tools, you emit a SINGLE JSON describing the trade you would execute given the decide stage's output, and the backtest harness applies it to a mock vault with realistic slippage + fees.

## Previous stage output (decide)

```json
{{previous}}
```

## Current vault state

```json
{{vault_state}}
```

The orchestrator skips this stage entirely when `previous.decision == "hold"`, so if you reach this stage you have a real action to perform.

## Workflow

### decision = "buy"

Compute the USDC notional to spend. Read `previous.size_pct` (% of equity) and the current vault state's `total_usd`. The notional must respect:
- `previous.size_pct` of `total_usd` (e.g. size_pct=50 + total=100 → spend 50 USDC)
- never exceed `vault.usdc_idle`
- the harness applies a hard exposure cap of 75% (max_exposure_pct config) — if the resulting WETH position would exceed that, abort with `{"executed": false, "reason": "exposure_cap_exceeded"}`.

### decision = "sell" with `path` ∈ {stop, tp, scalp, trailing, reversal, timeout}

Compute the WETH amount to sell.
- `path == "scalp"` → sell `previous.scalp_pct` % of CURRENT remaining WETH (default 33).
- everything else → sell 100% (full close).

If selling at a NET loss while `path` is anything other than `stop` / `reversal`, abort: `{"executed": false, "reason": "would_realize_loss"}`. (Stop / reversal are loss-acceptable by definition.)

## Output schema (your last message MUST be a single-line JSON object — no markdown fence)

```json
{
  "executed": <boolean>,
  "side": "<buy|sell>",
  "path": "<A|B|C|D|E|stop|tp|scalp|trailing|reversal|timeout>",
  "amount_in_usd": <number; for BUY this is USDC spent, for SELL leave 0>,
  "amount_in_weth": <number; for SELL this is WETH sold, for BUY leave 0>,
  "scalp_pct": <33|null — only set when path=='scalp'>,
  "reason": "<short note when executed=false; null otherwise>"
}
```

The harness applies the trade verbatim from this JSON. Do not invent fields.
04-verify.mdunchanged from base

Full prompt

You are the **verify** stage of the trading workflow.

The execute stage's output is below. Your job is a one-shot read-only sanity check + a 1-line summary the operator will see in the UI.

## Previous stage output

```json
{{previous}}
```

## Workflow

If `previous.executed == false`, simply output a `{"verified": false, "summary": "<reason>"}` line — no on-chain reads.

If `previous.executed == true`:
1. Re-fetch the vault state via `factor_vault_analytics` to confirm the position now reflects the trade (a successful BUY means the trading token balance is non-zero; a successful SELL means it is dust).
2. Optionally read the receipt: `factor_get_transaction_status({ hash: previous.txHash })` — should be `status: success`.

## Output schema (your last message MUST be a JSON object on a single line)

```json
{
  "verified": <boolean>,
  "summary": "<one sentence the user will see in the UI: e.g. 'Bought $42 of WETH at $2256, vault now holds 0.0186 WETH'>"
}
```

generated 2026-05-11 08:10:55 UTC · raw data: meta.json · trades.ndjson · vault.ndjson · prompts/ · ticks/