no-bear-pathB   btcusdc   qwen3-coder:480b-cloud

2026-05-08_no-bear-pathB_btcusdc_qwen3-coder-480b-cloud_f4012f5b
window: 2026-02-01T00:00:00Z → 2026-03-01T00:00:00Z tick: 1h model: qwen3-coder:480b-cloud fingerprint: 1c4fe6a536c9d03a
PnL
-6.74%
$-673.69 on $10,000
Final balance
$9326.31
9326.31 USDC + 0.000000 BTC
Trades
46
23 BUY · 23 SELL
Win rate
8.7%
2/23 sells profitable
Realized total
$-673.68
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-01T15:00:00Z · BUY E · $2000.00 @ $78619.94E2026-02-01T16:00:00Z · SELL stop · $1963.63 @ $77593.40 · pnl=-36.37$ (-1.82%)stop2026-02-01T20:00:00Z · BUY E · $1992.73 @ $77578.13E2026-02-01T21:00:00Z · SELL stop · $1970.23 @ $77103.04 · pnl=-22.50$ (-1.13%)stop2026-02-02T23:00:00Z · BUY E · $1988.23 @ $79206.98E2026-02-03T00:00:00Z · SELL stop · $1966.20 @ $78738.61 · pnl=-22.03$ (-1.11%)stop2026-02-03T04:00:00Z · BUY A · $3471.68 @ $79176.69A2026-02-03T06:00:00Z · SELL stop · $3412.30 @ $78240.45 · pnl=-59.38$ (-1.71%)stop2026-02-03T08:00:00Z · BUY A · $3450.90 @ $79218.10A2026-02-03T10:00:00Z · SELL stop · $3397.02 @ $78400.01 · pnl=-53.88$ (-1.56%)stop2026-02-04T08:00:00Z · BUY E · $1961.17 @ $76913.95E2026-02-04T11:00:00Z · SELL tp · $1935.46 @ $76302.10 · pnl=-25.71$ (-1.31%)tp2026-02-04T18:00:00Z · BUY E · $1956.03 @ $72955.13E2026-02-04T19:00:00Z · SELL stop · $1958.42 @ $73425.96 · pnl=+2.39$ (+0.12%)stop2026-02-05T12:00:00Z · BUY E · $1956.50 @ $70685.61E2026-02-05T13:00:00Z · SELL stop · $1915.45 @ $69563.57 · pnl=-41.05$ (-2.10%)stop2026-02-05T14:00:00Z · BUY A · $3409.51 @ $70063.14A2026-02-05T15:00:00Z · SELL stop · $3359.45 @ $69404.76 · pnl=-50.07$ (-1.47%)stop2026-02-05T19:00:00Z · BUY A · $3391.99 @ $66703.14A2026-02-05T20:00:00Z · SELL stop · $3301.19 @ $65265.65 · pnl=-90.80$ (-2.68%)stop2026-02-10T01:00:00Z · BUY A · $3360.21 @ $70201.93A2026-02-10T02:00:00Z · SELL tp · $3355.84 @ $70486.82 · pnl=-4.37$ (-0.13%)tp2026-02-10T03:00:00Z · BUY A · $3358.68 @ $70478.96A2026-02-10T06:00:00Z · SELL stop · $3291.89 @ $69447.64 · pnl=-66.79$ (-1.99%)stop2026-02-10T12:00:00Z · BUY E · $1905.89 @ $68892.60E2026-02-10T13:00:00Z · SELL stop · $1888.22 @ $68610.12 · pnl=-17.67$ (-0.93%)stop2026-02-10T15:00:00Z · BUY A · $3329.12 @ $68827.45A2026-02-10T16:00:00Z · SELL stop · $3333.78 @ $69293.37 · pnl=+4.65$ (+0.14%)stop2026-02-11T04:00:00Z · BUY E · $1903.29 @ $68543.75E2026-02-11T05:00:00Z · SELL stop · $1866.91 @ $67584.46 · pnl=-36.37$ (-1.91%)stop2026-02-11T07:00:00Z · BUY E · $1896.01 @ $67168.90E2026-02-11T14:00:00Z · SELL tp · $1894.19 @ $67454.49 · pnl=-1.82$ (-0.10%)tp2026-02-20T15:00:00Z · BUY E · $1895.65 @ $67716.98E2026-02-20T16:00:00Z · SELL stop · $1876.03 @ $67365.56 · pnl=-19.62$ (-1.04%)stop2026-02-22T09:00:00Z · BUY E · $1891.72 @ $67716.95E2026-02-22T10:00:00Z · SELL stop · $1872.14 @ $67365.56 · pnl=-19.58$ (-1.03%)stop2026-02-22T16:00:00Z · BUY E · $1887.81 @ $67716.93E2026-02-22T18:00:00Z · SELL tp · $1868.27 @ $67365.56 · pnl=-19.54$ (-1.03%)tp2026-02-23T22:00:00Z · BUY A · $3296.82 @ $67726.52A2026-02-24T00:00:00Z · SELL stop · $3261.78 @ $67365.56 · pnl=-35.04$ (-1.06%)stop2026-02-25T07:00:00Z · BUY E · $1876.89 @ $67716.85E2026-02-25T10:00:00Z · SELL tp · $1857.47 @ $67365.56 · pnl=-19.42$ (-1.03%)tp2026-02-25T19:00:00Z · BUY E · $1873.01 @ $67716.83E2026-02-25T20:00:00Z · SELL stop · $1853.63 @ $67365.56 · pnl=-19.38$ (-1.03%)stop2026-02-26T10:00:00Z · BUY E · $1869.13 @ $67716.80E2026-02-26T11:00:00Z · SELL stop · $1849.79 @ $67365.56 · pnl=-19.34$ (-1.03%)stop
BUY SELL position open

Equity curve (vault total_usd vs time)

$10000$10000$9326

Trades

sim_tssidepathamount $price $cost %realized $realized %
2026-02-01 15:00:00 BUY E $2000.00 $78211.12 0.52%
2026-02-01 16:00:00 SELL stop $1963.63 $77593.40 0.52% $-36.37 -1.82%
2026-02-01 20:00:00 BUY E $1992.73 $77174.78 0.52%
2026-02-01 21:00:00 SELL stop $1970.23 $77103.04 0.52% $-22.50 -1.13%
2026-02-02 23:00:00 BUY E $1988.23 $78795.20 0.52%
2026-02-03 00:00:00 SELL stop $1966.20 $78738.61 0.52% $-22.03 -1.11%
2026-02-03 04:00:00 BUY A $3471.68 $78753.32 0.53%
2026-02-03 06:00:00 SELL stop $3412.30 $78240.45 0.53% $-59.38 -1.71%
2026-02-03 08:00:00 BUY A $3450.90 $78794.67 0.53%
2026-02-03 10:00:00 SELL stop $3397.02 $78400.01 0.53% $-53.88 -1.56%
2026-02-04 08:00:00 BUY E $1961.17 $76514.30 0.52%
2026-02-04 11:00:00 SELL tp $1935.46 $76302.10 0.52% $-25.71 -1.31%
2026-02-04 18:00:00 BUY E $1956.03 $72576.08 0.52%
2026-02-04 19:00:00 SELL stop $1958.42 $73425.96 0.52% +$2.39 +0.12%
2026-02-05 12:00:00 BUY E $1956.50 $70318.35 0.52%
2026-02-05 13:00:00 SELL stop $1915.45 $69563.57 0.52% $-41.05 -2.10%
2026-02-05 14:00:00 BUY A $3409.51 $69688.94 0.53%
2026-02-05 15:00:00 SELL stop $3359.45 $69404.76 0.53% $-50.07 -1.47%
2026-02-05 19:00:00 BUY A $3391.99 $66347.00 0.53%
2026-02-05 20:00:00 SELL stop $3301.19 $65265.65 0.53% $-90.80 -2.68%
2026-02-10 01:00:00 BUY A $3360.21 $69827.33 0.53%
2026-02-10 02:00:00 SELL tp $3355.84 $70486.82 0.53% $-4.37 -0.13%
2026-02-10 03:00:00 BUY A $3358.68 $70102.89 0.53%
2026-02-10 06:00:00 SELL stop $3291.89 $69447.64 0.53% $-66.79 -1.99%
2026-02-10 12:00:00 BUY E $1905.89 $68535.01 0.52%
2026-02-10 13:00:00 SELL stop $1888.22 $68610.12 0.52% $-17.67 -0.93%
2026-02-10 15:00:00 BUY A $3329.12 $68460.40 0.53%
2026-02-10 16:00:00 SELL stop $3333.78 $69293.37 0.53% +$4.65 +0.14%
2026-02-11 04:00:00 BUY E $1903.29 $68187.99 0.52%
2026-02-11 05:00:00 SELL stop $1866.91 $67584.46 0.52% $-36.37 -1.91%
2026-02-11 07:00:00 BUY E $1896.01 $66820.32 0.52%
2026-02-11 14:00:00 SELL tp $1894.19 $67454.49 0.52% $-1.82 -0.10%
2026-02-20 15:00:00 BUY E $1895.65 $67365.56 0.52%
2026-02-20 16:00:00 SELL stop $1876.03 $67365.56 0.52% $-19.62 -1.04%
2026-02-22 09:00:00 BUY E $1891.72 $67365.56 0.52%
2026-02-22 10:00:00 SELL stop $1872.14 $67365.56 0.52% $-19.58 -1.03%
2026-02-22 16:00:00 BUY E $1887.81 $67365.56 0.52%
2026-02-22 18:00:00 SELL tp $1868.27 $67365.56 0.52% $-19.54 -1.03%
2026-02-23 22:00:00 BUY A $3296.82 $67365.56 0.53%
2026-02-24 00:00:00 SELL stop $3261.78 $67365.56 0.53% $-35.04 -1.06%
2026-02-25 07:00:00 BUY E $1876.89 $67365.56 0.52%
2026-02-25 10:00:00 SELL tp $1857.47 $67365.56 0.52% $-19.42 -1.03%
2026-02-25 19:00:00 BUY E $1873.01 $67365.56 0.52%
2026-02-25 20:00:00 SELL stop $1853.63 $67365.56 0.52% $-19.38 -1.03%
2026-02-26 10:00:00 BUY E $1869.13 $67365.56 0.52%
2026-02-26 11:00:00 SELL stop $1849.79 $67365.56 0.52% $-19.34 -1.03%

Prompts used (captured at run launch — frozen)

Variant no-bear-pathB — 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)
+ - `previous.regime != "bear"` (DO NOT fire Path B inside a bear regime — historical evidence shows Path B + bear → reversal exit loop with net negative expectation)
- 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)
- `previous.regime != "bear"` (DO NOT fire Path B inside a bear regime — historical evidence shows Path B + bear → reversal exit loop with net negative expectation)

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/