[R-SIG-Finance] Quantstrat help

Joshua Ulrich josh.m.ulrich at gmail.com
Fri Mar 14 16:52:11 CET 2014


On Fri, Mar 14, 2014 at 10:30 AM, Noah Silverman <noahsilverman at ucla.edu> wrote:
>
> Hi,
>
> Working on developing a complex portfolio and backtesting strategy.
> >From what I've read, the quantstrat package looks ideal for working
> through the ideas.
>
> Two questions:
>
> 1) I have an indicator that is pre-calculated.  (From a bunch of
> complicated functions and outside data.)  I'd like to simply pass the
> vector of values into quantstrat, but can't figure out how to do that.
> The function to add a signal appears to only accept functions, not
> data.  Is there a way for me to do this?
>
If it needed a function and there was no way to pass data, you could
wrap your data in a function.
datafun <- function(...) mydata

But nothing *requires* that you call/use add.indicator().  Simply
merge your indicator with your market data.

> 2) Along the lines of #1 above:  I have my financial data directly from
> a vendor.  It already has OHLC defined.  Can I simply pass this to
> quanstrat?  If so, what is the proper order/formant/naming of columns to
> make quanstrat happy?
>
That depends on the specifics of the strategy you're trying to build,
which you haven't provided.

> Thanks!
>
> --
> *Noah Silverman, PhD* | UCLA Department of Statistics
> 8117 Math Sciences Building, Los Angeles, CA 90095
>

--
Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com



More information about the R-SIG-Finance mailing list