And

[[and]] evaluates a list of conditional blocks referenced in conditions.

Each entry must be the id of an existing conditional block. For the Logical AND block to validate, all conditional blocks listed in conditions must validate on the same candle. If all conditions validate, the Logical AND block itself validates, and the strategy execution proceeds to the block specified in next_block_id. If any of the referenced conditions do not validate, the Logical AND block also does not validate, and this execution path is halted for the current candle.

Block declaration

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

Example

[[and]]
id            = "entry_filters"
conditions    = ["ma_filter", "rsi_filter"]
next_block_id = "entry"

Logical Nesting and Transitions

Blocks referenced in the conditions key are logical children of the [[and]] block. They are evaluated in the declared order. As soon as one child does not validate, the [[and]] block stops and does not validate on that candle.

When a conditional block is used as a child of [[and]], it must not define next_block_id. This applies to all logical children, including [[wait]], [[or]], and another [[and]] when they are nested inside [[and]].

If the [[and]] block is itself used as a child of another logical block, [[and]] or [[or]], its own next_block_id must also be omitted. In that case, the transition is fully controlled by the parent block.

Block parameters

ParameterDescription
id
 Text
 Required
Unique identifier of the block.
conditions
 Array
 Required
List of conditional block IDs to evaluate.
next_block_id
 Text
 Conditional
Required when the [[and]] block is used on its own. Must be omitted when it is used as a child of an [[and]] or [[or]] block.

This block does not produce any output variable; it only controls the execution flow.