EngineSQL-Inspired Rules / SQX

Getting started

Run a complete SQX example that updates an order note without sending an order.

Use a fresh app or Agent Lab experiment with one instrument and available historical bars. Put this source in the SQX editor. Keep other execution layers disabled for this first check.

Paste the complete source

--- Observe a price band without submitting an order
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=false

The numbers define an illustrative band. Choose a known historical window containing prices inside and outside the band, or adjust both thresholds to your fixture.

What should happen

The IF line configures one order primitive with transmission disabled. It is a declaration, not an ordinary JavaScript condition. The TICK line adds an L2 rule with two comparisons joined by AND.

On the flat-position branch, a price strictly between 50 and 60 changes the existing order primitive's note. The later primitive callback logs an order description but does not call placement because transmit is false. At exactly 50 or 60 the rule does not match.

The configured tick parameters are restored after the normal tick branch. Here the declared note and transmission setting provide the next frame's baseline. Do not assume all arbitrary runtime state is reset.

Check the result

Save and run a short historical test. Look for matching/non-matching calculation diagnostics and the order primitive's “not transmitting” log. This source should produce no orders or trades when it is the only execution configuration.

The guide tests compile these exact lines with the current parser and check the resulting model and target settings. Runtime results still depend on the selected data and surrounding app configuration.

Before enabling execution

Define duplicate-order, pending-order, position, and sizing behavior first. Changing transmission to true changes this from an observation into an execution path; it does not supply those guards automatically.

Continue with syntax and actions.

On this page