Route

[[route]] evaluates the conditional blocks listed in condition_ids in order. The first child that validates stops the evaluation, then execution continues to that child’s next_block_id.

If no child validates on the current candle, [[route]] does not validate and is evaluated again on the next candle. To define an immediate fallback branch, place an always-true condition last, for example with condition = "1".

Block declaration

A strategy can contain multiple [[route]] blocks.

Example

[[route]]
id            = "entry_router"
condition_ids = ["bullish_signal", "bearish_signal"]

[[condition]]
id            = "bullish_signal"
condition     = "rsi_fast > rsi_slow"
next_block_id = "enter_long"

[[condition]]
id            = "bearish_signal"
condition     = "rsi_fast < rsi_slow"
next_block_id = "enter_short"

Here, entry_router routes to enter_long if bullish_signal is the first child that validates, otherwise to enter_short if bearish_signal validates. If both signals are true on the same candle, bullish_signal wins because it is listed first.

Logical nesting and transitions

Blocks referenced in condition_ids are the logical children of [[route]]. They are evaluated in the declared order, and each one must define its own next_block_id.

The [[route]] block itself does not define next_block_id, because the destination always comes from the validated child. A child of [[route]] cannot be the target of another block; it is reached only through the [[route]] that references it.

Direct children can be [[condition]], [[trend]], [[position]], [[threshold]], [[cross]], [[crossover]], [[crossunder]], [[trailing]], [[wait]], [[and]], or [[or]]. [[if]], [[variable]], action blocks, and another [[route]] block cannot be used as direct children.

Block parameters

ParameterDescription
id
 Text
 Required
Unique identifier of the block.
condition_ids
 Array
 Required
One or more route child identifiers to evaluate in order. Each identifier must exist in the strategy, and each child must define its own next_block_id.

This block does not produce any output variable.