[R-SIG-Finance] Help required in getting SMA triggered entry with quantstrat add.rule

Brian G. Peterson brian at braverock.com
Mon Aug 1 12:22:16 CEST 2016


On 08/01/2016 05:07 AM, golam sakline wrote:
> In Quantstrat, is it possible to use add.rule that can pick the crossover
> between SMA and the price as entry rather than the bar close price? Is
> there a way I can add buy-stop and sell-stop order types using limits that
> look into the SMA figures.
>
> Also why does it seem like that the trade registration date is one day
> late? How can we fix this to register as per the day of the signal?-- See
> the mktdata and getTxns output.

Real markets are not instant. It is physically impossible to observe a 
signal and act on it at the same instant.  You must observe your signal, 
do some calculation, place an order, the market must receive your order, 
and the market must match your order.

If you want action at higher frequencies, use higher frequency data.

If you insist on proceeding with unrealistic expectations, pass

allowMagicalThinking=TRUE

-- 
Brian



More information about the R-SIG-Finance mailing list