Cancel command
What it does
Section titled “What it does”cancel cancels working orders for the current symbol.
Use TradingView Order Syntax first if you need the full command structure before working through individual command types.
Minimal example
Section titled “Minimal example”ALPHA(BTCUSDT){type=cancel}Common use case
Section titled “Common use case”A very common pattern is:
- cancel existing orders
- wait briefly
- place a fresh order
Example:
ALPHA(BTCUSDT){ type=cancel; wait(1s); type=limit,side=buy,amount=0.001,offset=-1%}When to use it
Section titled “When to use it”Use cancel when you want to clear old resting orders before sending a new setup.
Common mistakes
Section titled “Common mistakes”Assuming it changes the position
Section titled “Assuming it changes the position”cancel only manages working orders. It does not flatten the position by itself.
Using it without verifying the symbol
Section titled “Using it without verifying the symbol”cancel applies in the context of the current payload symbol.