Lipi Reference
Lipi

Functions

strategy.cancel()

Cancels the pending order named `id`: a limit or stop order that has not filled yet.

Syntax

                strategy.cancel(series string id) → void
              

Arguments

id required series string

Return Type

void

Example


          //@lipi=2
strategy("strategy.cancel Example", overlay=true, initial_capital=10000, default_qty_type=strategy.fixed, default_qty_value=1)
// A buy limit 1% below the close, cancelled if not filled within the bar
if close > open {
    strategy.entry("Dip Buy", strategy.long, limit=close * 0.99)
} else {
    strategy.cancel("Dip Buy")
}