Lipi Reference
Lipi

Functions

strategy.cancel_all()

Cancels every pending order that has not filled yet.

Syntax

                strategy.cancel_all() → void
              

Return Type

void

Example


          //@lipi=2
strategy("strategy.cancel_all Example", overlay=true, initial_capital=10000, default_qty_type=strategy.fixed, default_qty_value=1)
if close > open {
    strategy.entry("Breakout", strategy.long, stop=high * 1.01)
}
// Cancel all waiting orders when volume dries up
if volume < talib.sma(volume, 20) * 0.5 {
    strategy.cancel_all()
}