From 759439313ec412b9344b1bf49642c51e87131b2e Mon Sep 17 00:00:00 2001 From: rob thijssen Date: Tue, 10 Mar 2026 07:39:09 +0200 Subject: [PATCH] fix: two Bollinger Band DSL errors from 50-iteration run - bollinger_upper/lower func Exprs must NOT include a "field" parameter; they compute from close internally. Setting "field":"bollinger_upper" causes API rejection: expected one of open/high/low/close/volume. - bollinger Condition "band" only accepts "above_upper" or "below_lower"; "above_lower" and "below_upper" are invalid variants. Both errors appeared repeatedly across the 50-iteration run, causing failed backtest submissions on every Bollinger crossover strategy. Co-Authored-By: Claude Sonnet 4.6 --- src/prompts.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/prompts.rs b/src/prompts.rs index 949e5da..0b9af69 100644 --- a/src/prompts.rs +++ b/src/prompts.rs @@ -162,6 +162,11 @@ Common mistakes to NEVER make: - `bollinger_upper` and `bollinger_lower` are FUNC NAMES, not Expr kinds. To compare close to the upper band: `{{"kind":"compare","left":{{"kind":"field","field":"close"}},"op":">","right":{{"kind":"func","name":"bollinger_upper","period":20}}}}` NEVER write `{{"kind":"bollinger_upper",...}}` — `bollinger_upper` is not an Expr kind. + NEVER set `"field":"bollinger_upper"` on a func Expr — `bollinger_upper`/`bollinger_lower` have no `field` + parameter; they compute from close internally. Just `{{"kind":"func","name":"bollinger_upper","period":20}}`. +- The `{{"kind":"bollinger",...}}` Condition (shorthand) only accepts `"band": "above_upper"` or + `"band": "below_lower"`. There is NO `above_lower` or `below_upper` — those are invalid and will be + rejected. Use `above_upper` (price above the upper band) or `below_lower` (price below the lower band). - `adx` is a FUNC NAME, not a Condition kind. To filter for strong trends (ADX > 25): `{{"kind":"compare","left":{{"kind":"func","name":"adx","period":14}},"op":">","right":{{"kind":"literal","value":"25"}}}}` NEVER write `{{"kind":"adx",...}}` — `adx` is not a Condition kind, it is a FuncName used inside `{{"kind":"func",...}}`.