How to enter orders that cancel each other in a quantum? For example, as soon as I enter a trade, I immediately open two orders: “stop loss” and “take profit”. As soon as someone fills, the other will be canceled.
strategy <- add.rule(strategy, name="ruleSignal",
arguments=list(sigcol="EnterBuy", sigval=TRUE, orderqty=100,
ordertype="market", orderside="long",
pricemethod="market", osFUN=osMaxPos),
type="enter", path.dep=TRUE)
strategy <- add.rule(strategy, name="ruleSignal",
arguments=list(sigcol="EnterBuy", sigval=TRUE,
orderqty="all", ordertype="stoplimit",
orderside="short", threshold=-5,
tmult=FALSE),
type="exit", path.dep=TRUE)
strategy <- add.rule(strategy, name="ruleSignal",
arguments=list(sigcol="EnterBuy", sigval=TRUE,
orderqty="all", ordertype="stoplimit",
orderside="short", threshold=5,
tmult=FALSE),
type="exit", path.dep=TRUE)
They are currently working independently.
source
share