Brian G. Peterson
ph: +1.773.459.4973
im: bgpbraverock
On Tue, 2022-06-21 at 22:06 +0000, Mike wrote:
> I like to backtest this strategy on EOD data:
> 1. If a long/short signal occurs on day 0 (signal day) then
> ? enter long/short on day 1 if the price exeeds signal day's high
> ? (long) or drops below signal day's low (short).
> 2. On execution of the entry order issue 2 exit orders combined by
> ? OCO:
> ? a. Stop loss at x% of entry price
> ? b. MOC of entry day (later I also like to backtest longer periods)
> So the basic strategy holds the stock/asset for one day only (=one
> bar).
>
> Is there a way to exit on the entry bar anyway?
> How would I to this by setting allowMagicalThinking=T?
>
> Or can I trigger entry and the 2 exit orders by the same sigcol?
> Would I have to make the entry rule non-path-dependent to have it
> executed before the exit rule?
>
> Mike
>
> _______________________________________________
> R-SIG-Finance at r-project.org?mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R
> questions should go.