Skip to content

Release note

Combine up to four conditions in one strategy

3 min read
agentbacktestnew

Until 27 September a strategy could use only one kind of rule, so "golden cross on SPY, but only buy when RSI is under 70" quietly dropped the RSI part. You can now combine up to four entry conditions with AND (all must hold) or OR (any one is enough), and the result card lists every condition exactly as it ran.

What a condition can be. The price above or below a simple or exponential moving average; one moving average crossing or sitting above another, golden and death crosses included; RSI above or below a level, with any period; MACD above or crossing its signal line; the close against the upper, middle or lower Bollinger band; a breakout above the highest close of the last N days, or below the lowest; and the return over the last N days above or below a level. Each is calculated exactly as in the single-rule strategies: a rule with one condition reproduces each of them trade for trade on real SPY prices.

Exits. You can give the exit its own conditions ("sell when RSI(2) goes above 70"), sell on the first day the entry rule stops holding, or sell only on a stop. Fixed, trailing and ATR stops and a portfolio drawdown cap work on top of any of these. When you don't give an exit, the card says which default it used and why. In "golden cross but only buy when RSI is under 70", the RSI part only decides when to buy, so the rule sells on the death cross.

One symbol or a small basket. A rule can trade one symbol or up to 12, each timed on its own prices. The symbols that are in the market share the money equally, and cash earns the risk-free rate when none is. Signals use closing prices up to the previous trading day and orders fill at the next close, which the card states. If your rule names no symbol, the agent asks, with "Run it on SPY" and "Run it on QQQ" buttons, instead of running it on a default basket as the old parser did with the Magnificent Seven.

What it can't test, and says so. The engine reads daily closing prices, plus highs and lows for ATR stops. So conditions on trading volume, company fundamentals, news, intraday prices, VWAP, Keltner channels, stochastics, "N days in a row", a different symbol from the one traded, short selling or a fixed holding period can't be tested. The agent names the part it can't run and offers the rest of your rule in one click. Nothing is run or charged until you choose.

Defaults are labelled. Anything your prompt didn't specify is marked on the card, for example "RSI(14) is below 70 (period 14 is the default: your prompt gave none)", or that "moving average" was read as a simple one. For quants: RSI uses simple averages of gains and losses (Cutler's variant), not Wilder's smoothing, and the card says so; the Prove it parameter test scales every look-back window in the rule together.