From 9a7761b452fd2e6cd5dfc2b037ae9ecf20a5a363 Mon Sep 17 00:00:00 2001 From: rob thijssen Date: Mon, 9 Mar 2026 20:23:30 +0200 Subject: [PATCH] fix: add hma/ma to unsupported list, clarify quantity exit semantics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add `hma` (Hull MA) and generic `ma` to unsupported func names — both were used by R1 and rejected by the API - Note that Hull MA can be approximated via apply_func with wma - Add `"all"` to the quantity placeholder blacklist; explain that exit rules must repeat the entry decimal — there is no "close all" concept Observed in run 2026-03-09T20:10:55: 2 iterations failed on hma/ma, 3 iterations skipped by client-side validation on quantity="all". Co-Authored-By: Claude Sonnet 4.6 --- src/prompts.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/prompts.rs b/src/prompts.rs index 8e3cbbf..949e5da 100644 --- a/src/prompts.rs +++ b/src/prompts.rs @@ -78,7 +78,9 @@ Action quantity MUST be a fixed decimal string that parses as a floating-point n e.g. `"quantity": "0.001"`. NEVER use an expression object for quantity — only plain decimal strings are accepted. NEVER use placeholder strings like `"ATR_SIZED"`, `"FULL_BALANCE"`, `"percent_of_balance"`, -`"dynamic"`, or any non-numeric string — these will be rejected immediately. +`"dynamic"`, `"all"`, or any non-numeric string — these will be rejected immediately. +To exit a position, use the SAME decimal string as the entry rule — the backtester matches +open quantity automatically. There is no "close all" concept; just repeat the entry quantity. ### Multi-timeframe Any expression can reference a different timeframe via "timeframe" field. @@ -163,9 +165,10 @@ Common mistakes to NEVER make: - `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",...}}`. -- `roc` (rate of change), `hma` (Hull MA), `vwap`, `macd`, `cci`, `stoch` are NOT supported. +- `roc` (rate of change), `hma` (Hull MA), `ma` (generic), `vwap`, `macd`, `cci`, `stoch` are NOT supported. Use `sma`, `ema`, `wma`, `rsi`, `atr`, `adx`, `supertrend`, `std_dev`, `sum`, `highest`, `lowest`, - `bollinger_upper`, `bollinger_lower` only. + `bollinger_upper`, `bollinger_lower` only. There is no generic `ma` — use `sma` or `ema` explicitly. + Hull MA can be approximated as: WMA(2*WMA(n/2) - WMA(n)) using `apply_func`. ## Working examples