Lipi Reference
Lipi

Constants

strategy.oca_reduce

A one-cancels-all type, for the `oca_type` argument of `strategy.entry` and `strategy.order`. When one order of the group fills, the quantity of the other orders of the same group is reduced by the filled quantity.

Example


          //@lipi=2
strategy("strategy.oca_reduce Example", overlay=true, initial_capital=10000)
// Two breakout entries in one group: the first to fill decides
if strategy.position_size == 0 {
    strategy.entry("Up", strategy.long, stop=high + syminfo.mintick, oca_name="Breakout", oca_type=strategy.oca_reduce)
    strategy.entry("Down", strategy.short, stop=low - syminfo.mintick, oca_name="Breakout", oca_type=strategy.oca_reduce)
}
        

Type

const string