| sim_ts | side | path | amount $ | price $ | cost % | realized $ | realized % |
|---|---|---|---|---|---|---|---|
| 2026-02-01 05:00:00 | BUY | E | $2000.00 | $2448.23 | 0.52% | — | — |
| 2026-02-01 06:00:00 | SELL | stop | $1964.93 | $2430.51 | 0.52% | $-35.07 | -1.75% |
| 2026-02-01 07:00:00 | BUY | E | $1992.99 | $2418.65 | 0.52% | — | — |
| 2026-02-01 08:00:00 | SELL | stop | $1966.26 | $2411.22 | 0.52% | $-26.73 | -1.34% |
| 2026-02-01 18:00:00 | BUY | A | $3478.37 | $2313.96 | 0.53% | — | — |
| 2026-02-01 20:00:00 | SELL | stop | $3450.77 | $2320.35 | 0.53% | $-27.60 | -0.79% |
| 2026-02-01 21:00:00 | BUY | E | $1982.12 | $2316.36 | 0.52% | — | — |
| 2026-02-02 00:00:00 | SELL | stop | $1922.45 | $2270.15 | 0.52% | $-59.68 | -3.01% |
| 2026-02-02 01:00:00 | BUY | E | $1970.19 | $2293.20 | 0.52% | — | — |
| 2026-02-02 02:00:00 | SELL | stop | $1948.14 | $2291.29 | 0.52% | $-22.05 | -1.12% |
| 2026-02-02 05:00:00 | BUY | E | $1965.78 | $2240.54 | 0.52% | — | — |
| 2026-02-02 06:00:00 | SELL | stop | $1908.49 | $2198.02 | 0.52% | $-57.29 | -2.91% |
| 2026-02-03 19:00:00 | BUY | E | $1954.32 | $2120.65 | 0.52% | — | — |
| 2026-02-03 21:00:00 | SELL | tp | $2097.11 | $2299.46 | 0.52% | +$142.79 | +7.31% |
| 2026-02-03 23:00:00 | BUY | E | $1982.88 | $2236.38 | 0.52% | — | — |
| 2026-02-04 00:00:00 | SELL | stop | $1959.98 | $2233.72 | 0.52% | $-22.89 | -1.15% |
| 2026-02-04 10:00:00 | BUY | E | $1978.30 | $2260.65 | 0.52% | — | — |
| 2026-02-04 12:00:00 | SELL | stop | $1952.78 | $2254.86 | 0.52% | $-25.52 | -1.29% |
| 2026-02-04 15:00:00 | BUY | E | $1973.19 | $2171.87 | 0.52% | — | — |
| 2026-02-04 16:00:00 | SELL | stop | $1934.72 | $2151.83 | 0.52% | $-38.47 | -1.95% |
| 2026-02-05 03:00:00 | BUY | E | $1965.50 | $2124.31 | 0.52% | — | — |
| 2026-02-05 04:00:00 | SELL | stop | $1932.03 | $2110.00 | 0.52% | $-33.47 | -1.70% |
| 2026-02-05 18:00:00 | BUY | E | $1958.81 | $1955.09 | 0.52% | — | — |
| 2026-02-05 20:00:00 | SELL | stop | $1912.40 | $1928.76 | 0.52% | $-46.40 | -2.37% |
| 2026-02-05 21:00:00 | BUY | E | $1949.53 | $1869.59 | 0.52% | — | — |
| 2026-02-05 22:00:00 | SELL | stop | $1909.61 | $1850.48 | 0.52% | $-39.92 | -2.05% |
| 2026-02-06 01:00:00 | BUY | A | $3397.70 | $1870.61 | 0.53% | — | — |
| 2026-02-06 03:00:00 | SELL | stop | $3427.77 | $1907.49 | 0.53% | +$30.07 | +0.89% |
| 2026-02-06 11:00:00 | BUY | E | $1947.56 | $1926.94 | 0.52% | — | — |
| 2026-02-06 13:00:00 | SELL | stop | $1921.35 | $1920.91 | 0.52% | $-26.21 | -1.35% |
| 2026-02-06 14:00:00 | BUY | E | $1942.31 | $1950.31 | 0.52% | — | — |
| 2026-02-06 15:00:00 | SELL | stop | $1950.34 | $1978.88 | 0.52% | +$8.03 | +0.41% |
| 2026-02-08 01:00:00 | BUY | E | $1943.92 | $2084.58 | 0.52% | — | — |
| 2026-02-08 02:00:00 | SELL | tp | $1934.64 | $2096.35 | 0.52% | $-9.28 | -0.48% |
| 2026-02-08 16:00:00 | BUY | E | $1942.06 | $2108.64 | 0.52% | — | — |
| 2026-02-08 18:00:00 | SELL | stop | $1906.90 | $2092.13 | 0.52% | $-35.17 | -1.81% |
| 2026-02-09 23:00:00 | BUY | E | $1935.03 | $2115.22 | 0.52% | — | — |
| 2026-02-10 00:00:00 | SELL | stop | $1905.75 | $2105.02 | 0.52% | $-29.28 | -1.51% |
| 2026-02-10 01:00:00 | BUY | A | $3376.06 | $2096.72 | 0.53% | — | — |
| 2026-02-10 02:00:00 | SELL | stop | $3372.97 | $2117.35 | 0.53% | $-3.09 | -0.09% |
| 2026-02-10 12:00:00 | BUY | E | $1928.56 | $2003.21 | 0.52% | — | — |
| 2026-02-10 13:00:00 | SELL | tp | $1913.30 | $2008.16 | 0.52% | $-15.26 | -0.79% |
| 2026-02-10 15:00:00 | BUY | E | $1925.51 | $2009.80 | 0.52% | — | — |
| 2026-02-10 16:00:00 | SELL | stop | $1917.75 | $2022.66 | 0.52% | $-7.75 | -0.40% |
| 2026-02-11 05:00:00 | BUY | E | $1923.96 | $1971.39 | 0.52% | — | — |
| 2026-02-12 00:00:00 | SELL | stop | $1874.86 | $1941.18 | 0.52% | $-49.10 | -2.55% |
| 2026-02-12 08:00:00 | BUY | E | $1914.14 | $1968.07 | 0.52% | — | — |
| 2026-02-12 09:00:00 | SELL | stop | $1891.86 | $1965.52 | 0.52% | $-22.27 | -1.16% |
| 2026-02-12 16:00:00 | BUY | E | $1909.68 | $1948.47 | 0.52% | — | — |
| 2026-02-12 17:00:00 | SELL | stop | $1851.81 | $1909.18 | 0.52% | $-57.87 | -3.03% |
| 2026-02-13 15:00:00 | BUY | A | $3321.69 | $1990.86 | 0.53% | — | — |
| 2026-02-13 16:00:00 | SELL | stop | $3359.08 | $2034.93 | 0.53% | +$37.40 | +1.13% |
| 2026-02-14 09:00:00 | BUY | A | $3334.78 | $2082.35 | 0.53% | — | — |
| 2026-02-14 11:00:00 | SELL | tp | $3291.50 | $2077.42 | 0.53% | $-43.28 | -1.30% |
| 2026-02-14 12:00:00 | BUY | E | $1896.93 | $2099.58 | 0.52% | — | — |
| 2026-02-14 13:00:00 | SELL | tp | $1851.72 | $2070.97 | 0.52% | $-45.21 | -2.38% |
| 2026-02-14 17:00:00 | BUY | A | $3303.80 | $2082.83 | 0.53% | — | — |
| 2026-02-14 18:00:00 | SELL | stop | $3264.60 | $2080.23 | 0.53% | $-39.20 | -1.19% |
| 2026-02-14 20:00:00 | BUY | A | $3290.08 | $2088.52 | 0.53% | — | — |
| 2026-02-14 21:00:00 | SELL | tp | $3257.14 | $2089.82 | 0.53% | $-32.94 | -1.00% |
| 2026-02-15 00:00:00 | BUY | E | $1873.46 | $2086.59 | 0.52% | — | — |
| 2026-02-15 02:00:00 | SELL | tp | $1834.17 | $2064.19 | 0.52% | $-39.28 | -2.10% |
| 2026-02-15 03:00:00 | BUY | A | $3264.80 | $2059.58 | 0.53% | — | — |
| 2026-02-15 04:00:00 | SELL | stop | $3229.12 | $2058.94 | 0.53% | $-35.69 | -1.09% |
| 2026-02-15 09:00:00 | BUY | A | $3252.31 | $2069.20 | 0.53% | — | — |
| 2026-02-15 10:00:00 | SELL | stop | $3217.00 | $2068.70 | 0.53% | $-35.32 | -1.09% |
| 2026-02-15 11:00:00 | BUY | A | $3239.95 | $2061.57 | 0.53% | — | — |
| 2026-02-15 12:00:00 | SELL | stop | $3206.16 | $2061.96 | 0.53% | $-33.80 | -1.04% |
| 2026-02-15 13:00:00 | BUY | E | $1844.64 | $2011.00 | 0.52% | — | — |
| 2026-02-16 00:00:00 | SELL | tp | $1785.25 | $1966.58 | 0.52% | $-59.39 | -3.22% |
| 2026-02-16 06:00:00 | BUY | A | $3207.34 | $1958.00 | 0.53% | — | — |
| 2026-02-16 07:00:00 | SELL | stop | $3187.38 | $1966.69 | 0.53% | $-19.96 | -0.62% |
| 2026-02-17 01:00:00 | BUY | A | $3200.35 | $1998.44 | 0.53% | — | — |
| 2026-02-18 21:00:00 | SELL | stop | $3073.31 | $1939.67 | 0.53% | $-127.04 | -3.97% |
| 2026-02-19 06:00:00 | BUY | E | $1803.36 | $1970.33 | 0.52% | — | — |
| 2026-02-19 07:00:00 | SELL | tp | $1796.13 | $1982.92 | 0.52% | $-7.23 | -0.40% |
| 2026-02-19 13:00:00 | BUY | E | $1801.92 | $1947.30 | 0.52% | — | — |
| 2026-02-19 14:00:00 | SELL | stop | $1759.58 | $1921.40 | 0.52% | $-42.33 | -2.35% |
| 2026-02-19 15:00:00 | BUY | A | $3138.54 | $1936.87 | 0.53% | — | — |
| 2026-02-19 16:00:00 | SELL | stop | $3088.34 | $1926.30 | 0.53% | $-50.20 | -1.60% |
| 2026-02-20 12:00:00 | BUY | A | $3120.97 | $1943.98 | 0.53% | — | — |
| 2026-02-20 13:00:00 | SELL | stop | $3097.18 | $1949.82 | 0.53% | $-23.79 | -0.76% |
| 2026-02-20 14:00:00 | BUY | A | $3112.64 | $1934.11 | 0.53% | — | — |
| 2026-02-20 15:00:00 | SELL | stop | $3094.94 | $1943.70 | 0.53% | $-17.71 | -0.57% |
| 2026-02-20 16:00:00 | BUY | A | $3106.44 | $1963.95 | 0.53% | — | — |
| 2026-02-20 18:00:00 | SELL | tp | $3077.64 | $1966.57 | 0.53% | $-28.80 | -0.93% |
| 2026-02-20 19:00:00 | BUY | A | $3096.36 | $1975.56 | 0.53% | — | — |
| 2026-02-20 20:00:00 | SELL | stop | $3045.17 | $1963.69 | 0.53% | $-51.19 | -1.65% |
| 2026-02-20 22:00:00 | BUY | A | $3078.45 | $1974.38 | 0.53% | — | — |
| 2026-02-20 23:00:00 | SELL | stop | $3041.26 | $1971.40 | 0.53% | $-37.18 | -1.21% |
| 2026-02-21 00:00:00 | BUY | A | $3065.43 | $1968.88 | 0.53% | — | — |
| 2026-02-21 01:00:00 | SELL | stop | $3024.27 | $1963.22 | 0.53% | $-41.16 | -1.34% |
| 2026-02-21 02:00:00 | BUY | A | $3051.03 | $1966.24 | 0.53% | — | — |
| 2026-02-21 03:00:00 | SELL | stop | $3017.90 | $1965.69 | 0.53% | $-33.13 | -1.09% |
| 2026-02-21 08:00:00 | BUY | A | $3039.43 | $1962.71 | 0.53% | — | — |
| 2026-02-21 10:00:00 | SELL | stop | $3018.88 | $1970.28 | 0.53% | $-20.56 | -0.68% |
| 2026-02-21 21:00:00 | BUY | E | $1732.71 | $1974.14 | 0.52% | — | — |
| 2026-02-21 23:00:00 | SELL | stop | $1715.05 | $1974.40 | 0.52% | $-17.65 | -1.02% |
| 2026-02-22 01:00:00 | BUY | A | $3026.06 | $1972.87 | 0.53% | — | — |
| 2026-02-22 03:00:00 | SELL | stop | $2993.09 | $1972.23 | 0.53% | $-32.97 | -1.09% |
| 2026-02-22 04:00:00 | BUY | A | $3014.52 | $1974.71 | 0.53% | — | — |
| 2026-02-22 05:00:00 | SELL | stop | $2981.00 | $1973.62 | 0.53% | $-33.52 | -1.11% |
| 2026-02-22 06:00:00 | BUY | E | $1715.88 | $1974.97 | 0.52% | — | — |
| 2026-02-22 07:00:00 | SELL | stop | $1699.11 | $1976.05 | 0.52% | $-16.77 | -0.98% |
| 2026-02-22 12:00:00 | BUY | E | $1712.52 | $1980.78 | 0.52% | — | — |
| 2026-02-22 13:00:00 | SELL | tp | $1682.53 | $1966.37 | 0.52% | $-29.99 | -1.75% |
| 2026-02-22 14:00:00 | BUY | E | $1706.53 | $1950.95 | 0.52% | — | — |
| 2026-02-22 15:00:00 | SELL | tp | $1688.66 | $1950.64 | 0.52% | $-17.87 | -1.05% |
| 2026-02-22 19:00:00 | BUY | A | $2980.17 | $1942.95 | 0.53% | — | — |
| 2026-02-22 20:00:00 | SELL | stop | $2949.87 | $1943.74 | 0.53% | $-30.29 | -1.02% |
| 2026-02-23 02:00:00 | BUY | E | $1696.89 | $1856.88 | 0.52% | — | — |
| 2026-02-23 03:00:00 | SELL | stop | $1685.15 | $1863.24 | 0.52% | $-11.75 | -0.69% |
| 2026-02-23 06:00:00 | BUY | E | $1694.54 | $1866.08 | 0.52% | — | — |
| 2026-02-23 08:00:00 | SELL | tp | $1694.52 | $1885.50 | 0.52% | $-0.02 | -0.00% |
| 2026-02-24 00:00:00 | BUY | E | $1694.54 | $1856.30 | 0.52% | — | — |
| 2026-02-24 01:00:00 | SELL | tp | $1687.60 | $1867.96 | 0.52% | $-6.94 | -0.41% |
| 2026-02-24 02:00:00 | BUY | E | $1693.15 | $1840.95 | 0.52% | — | — |
| 2026-02-24 03:00:00 | SELL | stop | $1678.05 | $1843.54 | 0.52% | $-15.10 | -0.89% |
| 2026-02-24 04:00:00 | BUY | E | $1690.13 | $1832.03 | 0.52% | — | — |
| 2026-02-24 05:00:00 | SELL | stop | $1671.59 | $1830.81 | 0.52% | $-18.54 | -1.10% |
| 2026-02-24 10:00:00 | BUY | E | $1686.42 | $1827.14 | 0.52% | — | — |
| 2026-02-24 11:00:00 | SELL | tp | $1667.89 | $1825.88 | 0.52% | $-18.54 | -1.10% |
| 2026-02-24 13:00:00 | BUY | E | $1682.72 | $1823.92 | 0.52% | — | — |
| 2026-02-24 15:00:00 | SELL | tp | $1675.24 | $1834.73 | 0.52% | $-7.48 | -0.44% |
| 2026-02-24 19:00:00 | BUY | E | $1681.22 | $1855.08 | 0.52% | — | — |
| 2026-02-24 20:00:00 | SELL | stop | $1661.54 | $1852.46 | 0.52% | $-19.68 | -1.17% |
| 2026-02-24 22:00:00 | BUY | A | $2935.25 | $1854.17 | 0.53% | — | — |
| 2026-02-24 23:00:00 | SELL | stop | $2914.26 | $1860.56 | 0.53% | $-20.98 | -0.71% |
| 2026-02-25 06:00:00 | BUY | E | $1673.09 | $1887.98 | 0.52% | — | — |
| 2026-02-25 08:00:00 | SELL | tp | $1660.52 | $1893.31 | 0.52% | $-12.57 | -0.75% |
| 2026-02-25 09:00:00 | BUY | A | $2923.50 | $1910.29 | 0.53% | — | — |
| 2026-02-25 10:00:00 | SELL | tp | $2900.06 | $1915.19 | 0.53% | $-23.44 | -0.80% |
| 2026-02-26 06:00:00 | BUY | A | $2915.30 | $2066.13 | 0.53% | — | — |
| 2026-02-26 07:00:00 | SELL | tp | $2879.52 | $2062.54 | 0.53% | $-35.78 | -1.23% |
| 2026-02-26 11:00:00 | BUY | A | $2902.78 | $2065.31 | 0.53% | — | — |
| 2026-02-26 12:00:00 | SELL | stop | $2861.51 | $2057.66 | 0.53% | $-41.26 | -1.42% |
| 2026-02-26 13:00:00 | BUY | A | $2888.34 | $2070.00 | 0.53% | — | — |
| 2026-02-26 16:00:00 | SELL | tp | $2807.27 | $2033.34 | 0.53% | $-81.07 | -2.81% |
| 2026-02-26 17:00:00 | BUY | E | $1634.26 | $1983.80 | 0.52% | — | — |
| 2026-02-26 18:00:00 | SELL | stop | $1621.21 | $1988.43 | 0.52% | $-13.06 | -0.80% |
| 2026-02-26 19:00:00 | BUY | A | $2855.39 | $2004.23 | 0.53% | — | — |
| 2026-02-26 20:00:00 | SELL | tp | $2861.81 | $2030.14 | 0.53% | +$6.41 | +0.22% |
| 2026-02-26 22:00:00 | BUY | A | $2857.64 | $2030.36 | 0.53% | — | — |
| 2026-02-27 00:00:00 | SELL | stop | $2823.78 | $2027.68 | 0.53% | $-33.86 | -1.18% |
| 2026-02-27 01:00:00 | BUY | A | $2845.79 | $2014.79 | 0.53% | — | — |
| 2026-02-27 02:00:00 | SELL | tp | $2825.73 | $2021.90 | 0.53% | $-20.06 | -0.70% |
| 2026-02-27 03:00:00 | BUY | A | $2838.77 | $2026.00 | 0.53% | — | — |
| 2026-02-27 04:00:00 | SELL | tp | $2835.72 | $2045.39 | 0.53% | $-3.04 | -0.11% |
| 2026-02-27 06:00:00 | BUY | A | $2837.70 | $2041.61 | 0.53% | — | — |
| 2026-02-27 07:00:00 | SELL | stop | $2799.96 | $2035.91 | 0.53% | $-37.74 | -1.33% |
| 2026-02-27 16:00:00 | BUY | E | $1614.00 | $1948.59 | 0.52% | — | — |
| 2026-02-27 17:00:00 | SELL | stop | $1579.81 | $1927.15 | 0.52% | $-34.19 | -2.12% |
| 2026-02-27 19:00:00 | BUY | E | $1607.16 | $1918.02 | 0.52% | — | — |
| 2026-02-27 20:00:00 | SELL | tp | $1593.17 | $1921.10 | 0.52% | $-13.99 | -0.87% |
| 2026-02-27 22:00:00 | BUY | E | $1604.36 | $1921.26 | 0.52% | — | — |
| 2026-02-28 00:00:00 | SELL | tp | $1594.94 | $1929.84 | 0.52% | $-9.42 | -0.59% |
| 2026-02-28 02:00:00 | BUY | E | $1602.47 | $1924.61 | 0.52% | — | — |
| 2026-02-28 03:00:00 | SELL | tp | $1590.72 | $1930.36 | 0.52% | $-11.76 | -0.73% |
| 2026-02-28 05:00:00 | BUY | E | $1600.12 | $1925.12 | 0.52% | — | — |
| 2026-02-28 07:00:00 | SELL | stop | $1515.66 | $1842.45 | 0.52% | $-84.47 | -5.28% |
Variant no-bear-pathB — 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)+ - `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 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)
- `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"}`.
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/