Skip to content

Get started

QuantFlow source is compiled by the host that runs it. The host supplies an input value and a function registry; a program returns one value or raises an explicit error.

This expression calculates the distance between a price and a reference:

math.abs($.price - $.reference)

The host must provide an input object with price and reference fields and register the math.abs built-in. $. means “the current program input.”

Programs can also use assignments and return a boolean:

distance = math.abs($.price - $.reference)
return distance >= $.minimum_move

The code expresses a decision; the host decides what to do with the returned value. In the planned signal service, for example, the host would decide how a true result becomes a signal.

The Rust API compiles source and executes it against an input value and registered functions. See Rust integration for a complete example.

QuantFlow supports scalar and object-path expressions, assignments, conditional expressions, indented if/else blocks, function calls, and return. It does not support general-purpose Python features such as imports, loops, classes, or function definitions. See Syntax for the full reference.