Grupos OCA

//@version=4
strategy("oca_cancel demo")
if year > 2014 and year < 2016
    strategy.entry("LE", strategy.long)
    strategy.entry("SE", strategy.short)
//@version=4
strategy("oca_cancel demo")
if year > 2014 and year < 2016
    strategy.entry("LE", strategy.long, oca_type = strategy.oca.cancel, oca_name="Entry")
    strategy.entry("SE", strategy.short, oca_type = strategy.oca.cancel, oca_name="Entry")
//@version=4
strategy("My Script")
if year > 2014 and year < 2016
    strategy.entry("Compra", strategy.long, oca_name="My oca", oca_type=strategy.oca.reduce)
    strategy.exit("DaCompra", "Compra", profit=100, loss=200, oca_name="My oca")
    strategy.entry("Venda", strategy.short, oca_name="My oca", oca_type=strategy.oca.cancel)
    strategy.order("Ordem", strategy.short, oca_name="My oca", oca_type=strategy.oca.none)