SQL-like Trading Rules – Beginner Guide
Start with the current SQX syntax and follow the detailed engine guides.
SQX compiles line-based declarations and conditions into engine models. Start with a complete configuration that does not transmit orders:
IF order type="market" action="buy" size=1 transmit=false note="outside band"
TICK price > 50 AND price < 60 THEN order SET note="inside band", transmit=falseThe first line declares the primitive. The second changes its note when the current close is strictly inside the illustrative band. Run it alone in a historical experiment and inspect the matching and non-transmitting logs.
Continue in the SQX guides
- Getting started: prerequisites, expected output, and verification.
- Syntax: one rule per line and parameter formats.
- Conditions: comparisons and current boolean limitations.
- Actions: existing targets, writable fields, and execution.
- Working with SJS: ownership and frame order.
- Examples and debugging.
Current parser limits
Keep complete rules on one physical line. Use uppercase structural keywords. Text OR currently compiles as AND for multiple comparisons, and parentheses are unsupported. Use SJS for nested or OR decisions.
For the order primitive, use size and limitPrice; price or quantity are not equivalent target properties. SET updates an existing configured primitive rather than creating one or immediately confirming a trade.
This page replaces the original /docs/syntax entry point (now redirected here). The detailed guides replace earlier examples that implied multiline rules, nested OR, or unverified property names were supported.