On 02 apr 2016, at 16:18, Joshua Ulrich <josh.m.ulrich at gmail.com> wrote:
On Tue, Mar 29, 2016 at 9:46 AM, Diego Peroni <diegoperoni at vodafone.it> wrote:
Hi All,
my strategy exit an open position with a simple Signal based on 1 minute
OHLC bars.
This is my exit rule:
add.rule(qs.strategy, name='ruleSignal',
arguments=list(sigcol='upTrend', sigval=TRUE,
replace=TRUE,
orderside='short',
ordertype='market',
orderqty='all',
orderset='ocoshort'
),
type='exit',
label='ExitShort',
enabled=TRUE)
My question is: which price quantstrat use to sell market by default?
- Current Bar Close Price?
- Next Bar Open Price?
- Next Bar "worst"/"best" Price?
Assuming you haven't specified "prefer", it will be NULL by default,
which means getPrice will be called on mktdata with prefer=NULL. When
getPrice is called with prefer=NULL, it will search for a column name
containing "price", "trade", or "close" (in that order) and will
return the first it finds.
The transaction will occur on the observation after the order is
entered, since it's not safe to assume that your order will be filled
at the price you observed that triggered the order entry.