| sim_ts | side | path | amount $ | price $ | cost % | realized $ | realized % |
|---|---|---|---|---|---|---|---|
| 2026-02-01 06:00:00 | BUY | E | $2000.00 | $2430.51 | 0.52% | — | — |
| 2026-02-01 08:00:00 | SELL | stop | $1963.55 | $2411.22 | 0.52% | $-36.45 | -1.82% |
| 2026-02-01 15:00:00 | BUY | A | $3487.24 | $2373.07 | 0.53% | — | — |
| 2026-02-01 17:00:00 | SELL | stop | $3349.75 | $2304.06 | 0.53% | $-137.49 | -3.94% |
| 2026-02-02 02:00:00 | BUY | E | $1965.21 | $2291.29 | 0.52% | — | — |
| 2026-02-02 03:00:00 | SELL | stop | $1920.21 | $2262.27 | 0.52% | $-45.00 | -2.29% |
| 2026-02-02 04:00:00 | BUY | E | $1956.21 | $2239.02 | 0.52% | — | — |
| 2026-02-02 05:00:00 | SELL | stop | $1937.25 | $2240.54 | 0.52% | $-18.96 | -0.97% |
| 2026-02-03 03:00:00 | BUY | E | $1952.42 | $2298.72 | 0.52% | — | — |
| 2026-02-03 04:00:00 | SELL | tp | $1970.27 | $2344.03 | 0.52% | +$17.85 | +0.91% |
| 2026-02-03 10:00:00 | BUY | A | $3422.98 | $2292.06 | 0.53% | — | — |
| 2026-02-03 11:00:00 | SELL | stop | $3371.34 | $2281.79 | 0.53% | $-51.64 | -1.51% |
| 2026-02-03 18:00:00 | BUY | E | $1945.66 | $2195.11 | 0.52% | — | — |
| 2026-02-03 19:00:00 | SELL | stop | $1860.20 | $2120.65 | 0.52% | $-85.46 | -4.39% |
| 2026-02-04 17:00:00 | BUY | E | $1928.57 | $2135.05 | 0.52% | — | — |
| 2026-02-04 20:00:00 | SELL | tp | $1956.16 | $2188.27 | 0.52% | +$27.59 | +1.43% |
| 2026-02-05 17:00:00 | BUY | E | $1934.09 | $1998.68 | 0.52% | — | — |
| 2026-02-05 18:00:00 | SELL | stop | $1872.32 | $1955.09 | 0.52% | $-61.77 | -3.19% |
| 2026-02-07 04:00:00 | BUY | A | $3363.03 | $2080.81 | 0.53% | — | — |
| 2026-02-07 05:00:00 | SELL | stop | $3337.78 | $2087.40 | 0.53% | $-25.26 | -0.75% |
| 2026-02-07 07:00:00 | BUY | E | $1916.68 | $2047.73 | 0.52% | — | — |
| 2026-02-07 10:00:00 | SELL | stop | $1866.01 | $2014.45 | 0.52% | $-50.67 | -2.64% |
| 2026-02-07 11:00:00 | BUY | A | $3336.46 | $2010.68 | 0.53% | — | — |
| 2026-02-07 12:00:00 | SELL | stop | $3314.25 | $2018.77 | 0.53% | $-22.21 | -0.67% |
| 2026-02-07 18:00:00 | BUY | E | $1902.11 | $2061.16 | 0.52% | — | — |
| 2026-02-07 19:00:00 | SELL | stop | $1915.23 | $2097.10 | 0.52% | +$13.13 | +0.69% |
| 2026-02-07 21:00:00 | BUY | A | $3333.28 | $2105.32 | 0.53% | — | — |
| 2026-02-07 23:00:00 | SELL | stop | $3271.61 | $2088.58 | 0.53% | $-61.67 | -1.85% |
| 2026-02-08 00:00:00 | BUY | E | $1892.40 | $2087.08 | 0.52% | — | — |
| 2026-02-08 01:00:00 | SELL | tp | $1870.57 | $2084.58 | 0.52% | $-21.83 | -1.15% |
| 2026-02-08 06:00:00 | BUY | E | $1888.03 | $2084.77 | 0.52% | — | — |
| 2026-02-08 07:00:00 | SELL | stop | $1863.59 | $2079.30 | 0.52% | $-24.44 | -1.29% |
| 2026-02-08 16:00:00 | BUY | E | $1883.14 | $2108.64 | 0.52% | — | — |
| 2026-02-08 18:00:00 | SELL | stop | $1849.07 | $2092.13 | 0.52% | $-34.08 | -1.81% |
| 2026-02-09 09:00:00 | BUY | E | $1876.33 | $2050.07 | 0.52% | — | — |
| 2026-02-09 10:00:00 | SELL | tp | $1849.85 | $2042.27 | 0.52% | $-26.48 | -1.41% |
| 2026-02-09 14:00:00 | BUY | E | $1871.03 | $2022.52 | 0.52% | — | — |
| 2026-02-09 15:00:00 | SELL | tp | $1871.06 | $2043.70 | 0.52% | +$0.03 | +0.00% |
| 2026-02-09 17:00:00 | BUY | A | $3274.31 | $2091.21 | 0.53% | — | — |
| 2026-02-09 18:00:00 | SELL | stop | $3295.46 | $2127.33 | 0.53% | +$21.15 | +0.65% |
| 2026-02-10 03:00:00 | BUY | A | $3281.72 | $2108.18 | 0.53% | — | — |
| 2026-02-10 04:00:00 | SELL | stop | $3180.30 | $2064.96 | 0.53% | $-101.41 | -3.09% |
| 2026-02-10 12:00:00 | BUY | E | $1854.98 | $2003.21 | 0.52% | — | — |
| 2026-02-10 13:00:00 | SELL | stop | $1840.33 | $2008.16 | 0.52% | $-14.65 | -0.79% |
| 2026-02-13 21:00:00 | BUY | E | $1852.05 | $2045.61 | 0.52% | — | — |
| 2026-02-13 22:00:00 | SELL | tp | $1840.43 | $2054.02 | 0.52% | $-11.62 | -0.63% |
| 2026-02-13 23:00:00 | BUY | A | $3237.03 | $2054.20 | 0.53% | — | — |
| 2026-02-14 00:00:00 | SELL | stop | $3194.12 | $2048.72 | 0.53% | $-42.91 | -1.33% |
| 2026-02-14 01:00:00 | BUY | A | $3222.01 | $2055.20 | 0.53% | — | — |
| 2026-02-14 02:00:00 | SELL | stop | $3186.49 | $2054.35 | 0.53% | $-35.52 | -1.10% |
| 2026-02-14 13:00:00 | BUY | A | $3209.58 | $2070.97 | 0.53% | — | — |
| 2026-02-14 14:00:00 | SELL | stop | $3176.39 | $2071.54 | 0.53% | $-33.19 | -1.03% |
| 2026-02-14 15:00:00 | BUY | A | $3197.96 | $2085.09 | 0.53% | — | — |
| 2026-02-14 16:00:00 | SELL | stop | $3167.58 | $2087.43 | 0.53% | $-30.38 | -0.95% |
| 2026-02-14 19:00:00 | BUY | A | $3187.33 | $2085.39 | 0.53% | — | — |
| 2026-02-14 20:00:00 | SELL | tp | $3158.25 | $2088.52 | 0.53% | $-29.08 | -0.91% |
| 2026-02-14 21:00:00 | BUY | A | $3177.15 | $2089.82 | 0.53% | — | — |
| 2026-02-14 22:00:00 | SELL | stop | $3137.52 | $2085.87 | 0.53% | $-39.63 | -1.25% |
| 2026-02-14 23:00:00 | BUY | A | $3163.28 | $2090.47 | 0.53% | — | — |
| 2026-02-15 00:00:00 | SELL | stop | $3123.93 | $2086.59 | 0.53% | $-39.35 | -1.24% |
| 2026-02-15 02:00:00 | BUY | A | $3149.51 | $2064.19 | 0.53% | — | — |
| 2026-02-15 14:00:00 | SELL | stop | $3022.96 | $2002.46 | 0.53% | $-126.54 | -4.02% |
| 2026-02-15 16:00:00 | BUY | A | $3105.22 | $2011.29 | 0.53% | — | — |
| 2026-02-15 17:00:00 | SELL | stop | $3064.66 | $2006.27 | 0.53% | $-40.55 | -1.31% |
| 2026-02-15 18:00:00 | BUY | E | $1766.30 | $1971.30 | 0.52% | — | — |
| 2026-02-15 19:00:00 | SELL | stop | $1737.37 | $1959.24 | 0.52% | $-28.93 | -1.64% |
| 2026-02-15 20:00:00 | BUY | E | $1760.51 | $1942.23 | 0.52% | — | — |
| 2026-02-15 22:00:00 | SELL | tp | $1756.97 | $1958.55 | 0.52% | $-3.54 | -0.20% |
| 2026-02-16 22:00:00 | BUY | A | $3079.66 | $1999.14 | 0.53% | — | — |
| 2026-02-17 00:00:00 | SELL | tp | $3045.82 | $1998.33 | 0.53% | $-33.84 | -1.10% |
| 2026-02-17 01:00:00 | BUY | E | $1753.04 | $1998.44 | 0.52% | — | — |
| 2026-02-17 04:00:00 | SELL | stop | $1723.88 | $1985.70 | 0.52% | $-29.15 | -1.66% |
| 2026-02-17 11:00:00 | BUY | A | $3057.61 | $1966.93 | 0.53% | — | — |
| 2026-02-17 12:00:00 | SELL | stop | $3027.63 | $1968.47 | 0.53% | $-29.99 | -0.98% |
| 2026-02-18 04:00:00 | BUY | A | $3047.12 | $1997.07 | 0.53% | — | — |
| 2026-02-18 05:00:00 | SELL | tp | $3018.02 | $1999.15 | 0.53% | $-29.10 | -0.95% |
| 2026-02-18 06:00:00 | BUY | A | $3036.93 | $1996.49 | 0.53% | — | — |
| 2026-02-18 07:00:00 | SELL | stop | $3013.19 | $2002.06 | 0.53% | $-23.74 | -0.78% |
| 2026-02-18 11:00:00 | BUY | A | $3028.62 | $1997.27 | 0.53% | — | — |
| 2026-02-18 12:00:00 | SELL | stop | $2972.83 | $1981.43 | 0.53% | $-55.79 | -1.84% |
| 2026-02-18 14:00:00 | BUY | E | $1719.48 | $1970.68 | 0.52% | — | — |
| 2026-02-18 15:00:00 | SELL | stop | $1705.18 | $1974.66 | 0.52% | $-14.30 | -0.83% |
| 2026-02-18 21:00:00 | BUY | A | $3004.09 | $1939.67 | 0.53% | — | — |
| 2026-02-18 23:00:00 | SELL | stop | $2985.46 | $1948.24 | 0.53% | $-18.63 | -0.62% |
| 2026-02-19 14:00:00 | BUY | E | $1712.90 | $1921.40 | 0.52% | — | — |
| 2026-02-19 15:00:00 | SELL | stop | $1708.88 | $1936.87 | 0.52% | $-4.02 | -0.23% |
| 2026-02-19 18:00:00 | BUY | E | $1712.09 | $1920.72 | 0.52% | — | — |
| 2026-02-19 19:00:00 | SELL | stop | $1711.43 | $1939.99 | 0.52% | $-0.66 | -0.04% |
| 2026-02-20 09:00:00 | BUY | A | $2995.93 | $1960.00 | 0.53% | — | — |
| 2026-02-20 10:00:00 | SELL | tp | $2976.59 | $1968.15 | 0.53% | $-19.34 | -0.65% |
| 2026-02-20 19:00:00 | BUY | A | $2989.16 | $1975.56 | 0.53% | — | — |
| 2026-02-20 20:00:00 | SELL | stop | $2939.81 | $1963.69 | 0.53% | $-49.35 | -1.65% |
| 2026-02-20 21:00:00 | BUY | A | $2971.89 | $1971.05 | 0.53% | — | — |
| 2026-02-20 22:00:00 | SELL | stop | $2945.46 | $1974.38 | 0.53% | $-26.43 | -0.89% |
| 2026-02-21 00:00:00 | BUY | A | $2962.64 | $1968.88 | 0.53% | — | — |
| 2026-02-21 01:00:00 | SELL | stop | $2922.92 | $1963.22 | 0.53% | $-39.72 | -1.34% |
| 2026-02-21 02:00:00 | BUY | A | $2948.73 | $1966.24 | 0.53% | — | — |
| 2026-02-21 03:00:00 | SELL | stop | $2916.78 | $1965.69 | 0.53% | $-31.95 | -1.08% |
| 2026-02-21 05:00:00 | BUY | E | $1678.60 | $1962.40 | 0.52% | — | — |
| 2026-02-21 06:00:00 | SELL | stop | $1661.69 | $1962.86 | 0.52% | $-16.91 | -1.01% |
| 2026-02-21 20:00:00 | BUY | A | $2931.63 | $1988.35 | 0.53% | — | — |
| 2026-02-21 21:00:00 | SELL | stop | $2879.96 | $1974.14 | 0.53% | $-51.67 | -1.76% |
| 2026-02-22 01:00:00 | BUY | A | $2913.54 | $1972.87 | 0.53% | — | — |
| 2026-02-22 02:00:00 | SELL | stop | $2889.37 | $1977.37 | 0.53% | $-24.17 | -0.83% |
| 2026-02-22 05:00:00 | BUY | E | $1660.05 | $1973.62 | 0.52% | — | — |
| 2026-02-22 06:00:00 | SELL | stop | $1644.07 | $1974.97 | 0.52% | $-15.98 | -0.96% |
| 2026-02-22 18:00:00 | BUY | E | $1656.85 | $1940.27 | 0.52% | — | — |
| 2026-02-22 19:00:00 | SELL | tp | $1642.04 | $1942.95 | 0.52% | $-14.81 | -0.89% |
| 2026-02-22 20:00:00 | BUY | E | $1653.89 | $1943.74 | 0.52% | — | — |
| 2026-02-22 21:00:00 | SELL | stop | $1634.53 | $1940.99 | 0.52% | $-19.36 | -1.17% |
| 2026-02-23 18:00:00 | BUY | A | $2887.53 | $1863.92 | 0.53% | — | — |
| 2026-02-23 19:00:00 | SELL | stop | $2847.62 | $1857.75 | 0.53% | $-39.91 | -1.38% |
| 2026-02-24 04:00:00 | BUY | E | $1642.04 | $1832.03 | 0.52% | — | — |
| 2026-02-24 05:00:00 | SELL | stop | $1624.04 | $1830.81 | 0.52% | $-18.00 | -1.10% |
| 2026-02-24 12:00:00 | BUY | E | $1638.44 | $1826.75 | 0.52% | — | — |
| 2026-02-24 13:00:00 | SELL | tp | $1619.05 | $1823.92 | 0.52% | $-19.39 | -1.18% |
| 2026-02-25 00:00:00 | BUY | E | $1634.56 | $1851.94 | 0.52% | — | — |
| 2026-02-25 01:00:00 | SELL | stop | $1617.76 | $1851.98 | 0.52% | $-16.80 | -1.03% |
| 2026-02-25 05:00:00 | BUY | E | $1631.20 | $1906.30 | 0.52% | — | — |
| 2026-02-25 06:00:00 | SELL | stop | $1598.89 | $1887.98 | 0.52% | $-32.31 | -1.98% |
| 2026-02-25 07:00:00 | BUY | E | $1624.74 | $1885.05 | 0.52% | — | — |
| 2026-02-25 08:00:00 | SELL | tp | $1615.05 | $1893.31 | 0.52% | $-9.69 | -0.60% |
| 2026-02-25 11:00:00 | BUY | E | $1622.80 | $1912.61 | 0.52% | — | — |
| 2026-02-25 12:00:00 | SELL | tp | $1617.74 | $1926.48 | 0.52% | $-5.06 | -0.31% |
| 2026-02-25 19:00:00 | BUY | E | $1621.79 | $2074.12 | 0.52% | — | — |
| 2026-02-25 20:00:00 | SELL | tp | $1602.75 | $2071.10 | 0.52% | $-19.04 | -1.17% |
| 2026-02-26 06:00:00 | BUY | A | $2831.46 | $2066.13 | 0.53% | — | — |
| 2026-02-26 07:00:00 | SELL | stop | $2796.76 | $2062.54 | 0.53% | $-34.70 | -1.23% |
| 2026-02-26 08:00:00 | BUY | E | $1611.04 | $2053.37 | 0.52% | — | — |
| 2026-02-26 09:00:00 | SELL | stop | $1595.28 | $2054.43 | 0.52% | $-15.76 | -0.98% |
| 2026-02-26 12:00:00 | BUY | A | $2813.80 | $2057.66 | 0.53% | — | — |
| 2026-02-26 13:00:00 | SELL | tp | $2800.86 | $2070.00 | 0.53% | $-12.95 | -0.46% |
| 2026-02-26 15:00:00 | BUY | A | $2809.27 | $2051.19 | 0.53% | — | — |
| 2026-02-26 18:00:00 | SELL | tp | $2694.66 | $1988.43 | 0.53% | $-114.62 | -4.08% |
| 2026-02-26 19:00:00 | BUY | A | $2769.16 | $2004.23 | 0.53% | — | — |
| 2026-02-26 20:00:00 | SELL | tp | $2775.42 | $2030.14 | 0.53% | +$6.27 | +0.23% |
| 2026-02-26 22:00:00 | BUY | A | $2771.35 | $2030.36 | 0.53% | — | — |
| 2026-02-27 00:00:00 | SELL | tp | $2738.56 | $2027.68 | 0.53% | $-32.79 | -1.18% |
| 2026-02-27 02:00:00 | BUY | A | $2759.87 | $2021.90 | 0.53% | — | — |
| 2026-02-27 03:00:00 | SELL | stop | $2736.37 | $2026.00 | 0.53% | $-23.51 | -0.85% |
| 2026-02-27 04:00:00 | BUY | A | $2751.65 | $2045.39 | 0.53% | — | — |
| 2026-02-27 05:00:00 | SELL | stop | $2719.04 | $2042.64 | 0.53% | $-32.61 | -1.19% |
| 2026-02-27 10:00:00 | BUY | E | $1565.85 | $2010.01 | 0.52% | — | — |
| 2026-02-27 11:00:00 | SELL | stop | $1527.22 | $1980.80 | 0.52% | $-38.62 | -2.47% |
| 2026-02-27 12:00:00 | BUY | E | $1558.12 | $1962.08 | 0.52% | — | — |
| 2026-02-27 13:00:00 | SELL | stop | $1540.40 | $1959.92 | 0.52% | $-17.72 | -1.14% |
| 2026-02-27 15:00:00 | BUY | E | $1554.58 | $1942.95 | 0.52% | — | — |
| 2026-02-27 16:00:00 | SELL | stop | $1543.06 | $1948.59 | 0.52% | $-11.52 | -0.74% |
| 2026-02-27 17:00:00 | BUY | E | $1552.27 | $1927.15 | 0.52% | — | — |
| 2026-02-27 19:00:00 | SELL | stop | $1529.04 | $1918.02 | 0.52% | $-23.24 | -1.50% |
| 2026-02-27 22:00:00 | BUY | E | $1547.63 | $1921.26 | 0.52% | — | — |
| 2026-02-27 23:00:00 | SELL | stop | $1531.83 | $1921.40 | 0.52% | $-15.80 | -1.02% |
| 2026-02-28 02:00:00 | BUY | E | $1544.47 | $1924.61 | 0.52% | — | — |
| 2026-02-28 03:00:00 | SELL | tp | $1533.15 | $1930.36 | 0.52% | $-11.31 | -0.73% |
| 2026-02-28 04:00:00 | BUY | E | $1542.20 | $1924.49 | 0.52% | — | — |
| 2026-02-28 06:00:00 | SELL | tp | $1522.74 | $1919.94 | 0.52% | $-19.46 | -1.26% |
| 2026-02-28 07:00:00 | BUY | E | $1538.31 | $1842.45 | 0.52% | — | — |
| 2026-02-28 08:00:00 | SELL | stop | $1542.56 | $1866.73 | 0.52% | +$4.25 | +0.28% |
Variant full-plus-sizing — diff vs base shown for stages that override.
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.
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-reversionLONG 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 pullbackLONG 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 momentumLONG 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"}`.
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"}`.
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.
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/