diff --git a/src/prompts.rs b/src/prompts.rs index c4fde39..01c94c9 100644 --- a/src/prompts.rs +++ b/src/prompts.rs @@ -110,10 +110,13 @@ Buy a fixed number of base units (semantic alias for a decimal string): Alternatively, `"9999"` works for exits: sell quantities are automatically capped to the open position size, so a large fixed number is equivalent to `position_quantity`. -CRITICAL mistakes to never make: -- `{{"method":"position_quantity"}}` is WRONG — `position_quantity` is an Expr, not a SizingMethod. - CORRECT: `{{"kind":"position_quantity"}}`. The `"method"` field belongs ONLY to the three - declarative sizing objects (`fixed_sum`, `percent_of_balance`, `fixed_units`). +CRITICAL — the `"method"` vs `"kind"` distinction: +- `"method"` belongs ONLY to the three declarative sizing objects: `fixed_sum`, `percent_of_balance`, `fixed_units`. +- `"kind"` belongs to Expr objects: `position_quantity`, `bin_op`, `func`, `field`, `literal`, etc. +- `{{"method":"position_quantity"}}` is ALWAYS WRONG. It will be rejected every time. + CORRECT: `{{"kind":"position_quantity"}}`. +- If you used `{{"method":"percent_of_balance",...}}` for the buy, use `{{"kind":"position_quantity"}}` for the sell. + These are different object types — buy uses a SizingMethod (`method`), sell uses an Expr (`kind`). - `{{"method":"fixed_sum","amount":"100","multiplier":"2.0"}}` is WRONG — `fixed_sum` has no `multiplier` field. Only `amount` is accepted alongside `method`. - NEVER add extra fields to SizingMethod objects — they use `additionalProperties: false`. @@ -483,8 +486,8 @@ CRITICAL: `apply_func` uses `"input"`, not `"expr"`. Writing `"expr":` will be r - Don't ignore fees — a strategy needs to overcome 0.1% per round trip - Always gate buy rules with position state "flat" and sell rules with "long" - Never add a short-entry (sell when flat) rule — spot markets are long-only -- Never use an expression object for `quantity` — it must always be a plain decimal string like `"0.01"` -- Never use a placeholder string for `quantity` — `"ATR_SIZED"`, `"FULL_BALANCE"`, `"dynamic"`, etc. are all invalid and will be rejected. Use `"0.01"` or similar. +- Never use a placeholder string for `quantity` — `"ATR_SIZED"`, `"FULL_BALANCE"`, `"dynamic"`, etc. are all invalid and will be rejected. +- `{{"method":"position_quantity"}}` is WRONG for exit rules — use `{{"kind":"position_quantity"}}` (see Quantity section above). "## ) }