Cancel All

[[cancel_all]] cancels all pending orders in the order book. This includes market, limit, and stop entries and orders, as well as price-based exits (take profit, stop loss, trailing).

Important Note: market exits that are already scheduled remain active and will be executed normally.

Block declaration

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

Examples

Minimal global cancellation

This example cancels all pending orders and continues to resume_logic.

[[cancel_all]]
id            = "purge_orders"
next_block_id = "resume_logic"

Cancel all with immediate reroute

This example cancels all pending orders and immediately continues to start_logic.

[[cancel_all]]
id            = "reset_strategy"
wait_candles  = 0
next_block_id = "start_logic"

Block Parameters

ParameterDescription
id
 Text
 Required
Unique identifier for the block.
wait_candles
 Integer
 Optional
Number of candles to wait before executing the next block. Use 0 to disable the delay.
Default value: 0
next_block_id
 Text
 Required
Identifier of the block to execute next.