fix(prompts): forbid dynamic quantity expressions, require plain decimal string
The model was generating Expr objects for quantity (e.g. ATR-based sizing), causing consistent QuantitySpec deserialization failures. Replace the "prefer dynamic sizing" hint with an explicit rule: quantity must always be a fixed decimal string like "0.001". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -50,9 +50,9 @@ unrealised_pnl — current unrealised P&L
|
||||
bars_since_entry — complete bars elapsed since position was opened
|
||||
balance — free balance of a named asset (e.g. "usdt", "usdc")
|
||||
|
||||
### Dynamic quantity
|
||||
Action quantity can be a fixed string ("0.001") or an Expr for dynamic sizing.
|
||||
ATR-based sizing, percent-of-balance, etc.
|
||||
### Quantity
|
||||
Action quantity MUST be a fixed decimal string, e.g. `"quantity": "0.001"`.
|
||||
NEVER use an expression object for quantity — only plain decimal strings are accepted.
|
||||
|
||||
### Multi-timeframe
|
||||
Any expression can reference a different timeframe via "timeframe" field.
|
||||
@@ -311,6 +311,7 @@ Common mistakes to NEVER make:
|
||||
- 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.001"`
|
||||
"##
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user