[R-SIG-Finance] Quantstrat - Entering a limit order below the open price
Smith Jimmy
smithyj2727 at gmail.com
Thu Feb 11 07:50:24 CET 2016
I'm wanting to enter a limit order at a set percentage below the open price
if that's possible with Quantstrat.
I'm not sure if I have set this out correctly but here is an example. I was
trying to set the limit 1% below the open price.
I'm not quite sure how to use order.price to achieve this.
add.rule(strategy.st, name="ruleSignal",
arguments=list(sigcol="longentry", sigval=TRUE, ordertype="limit",
orderside="long", replace=FALSE, prefer="Open",
order.price=mktdata*(0.99),tmult=TRUE, orderqty=tradeSize,
osFUN=osMaxDollar, tradeSize=tradeSize,
maxSize=tradeSize),
type="enter", path.dep=TRUE, label="enterlong")
I'd ideally like to have a trailing stop that would be based on the
executed price.
add.rule(strategy.st, name="ruleSignal", arguments=list(sigcol="longentry",
sigval=TRUE,
ordertype="stoptrailing",
orderside="long",
replace=FALSE,
orderqty="all",
threshold=0.05,
tmult=TRUE,
TxnFees=-2,
orderset="ocolong"),
type="chain",
parent="enterlong",
label="stopLossLong",
path.dep=TRUE,
enable=TRUE)
Any advice would be much appreciated. At this point this strategy doesn't
produce any errors but it also doesn't trade.
Thank you in advance.
[[alternative HTML version deleted]]
More information about the R-SIG-Finance
mailing list