[R-SIG-Finance] Quantstrat: Multiple instruments, pre-generated signals

Ilya Kipnis ||y@@k|pn|@ @end|ng |rom gm@||@com
Wed Dec 18 23:49:59 CET 2024


Mike,

Yes, you definitely can. You can definitely inject pre-generated signals as
additional columns on your data ahead of time, and then use add.signal to
work with them later, skipping the add.indicator step entirely.
Quantstrat/R *can* handle such an amount of data, but understand that
quantstrat will loop over each instrument individually, and the loops occur
by signal observations.

That said, the "handle these prior to close" is a bit *vague* as far as
objective implementation goes. What does "prior to close" mean? 3:55 PM EST?

The rest of the logic seems implementable through various order chains.

Hope this helps.

Best,

Ilya

On Wed, Dec 18, 2024 at 5:40 PM Mike <mike9 using posteo.nl> wrote:

> My strategy involves a universe with more than 1000 stocks. Since
> the entry rules are complex, I've generated the entry signals with
> a separate program. The resulting table for entry signals includes
> these columns: Symbol, EntryDate, EntryTime, ExitDate.
>
> The backtest has to run on intraday basis. I have intraday data
> OHLCV for every stock involved.  The period to be tested spans
> several years.
>
> Each trade has to be closed market on close on ExitDate at the
> latest (time stop).
>
> Stop loss and take profit have to be handled prior to close on
> ExitDate. Stop loss has to be tightened up once if a profit target
> is met.
>
> Can I backtest such a type of strategy using quantstrat?
> Especially:
> - Can I inject pre-generated signals to quantstrat?
> - Can quantstrat/R handle such an amount of data?
>
> Mike
>
> _______________________________________________
> R-SIG-Finance using 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.
>

	[[alternative HTML version deleted]]



More information about the R-SIG-Finance mailing list