Skip to content

quantstrat mktdata subsetting

4 messages · John Williams, Nick

#
Hi,

I am just starting to use quantstat.  To calculate quanstrat indicators, I
need access to multiple subsets (as granular as individual values) of the
mktdata object.

How can I subset mktdata for multiple variables/paramters to an indicator
function?

Thank you for your help.
John
#
I think this is an interesting question -- but I'm not sure what exactly it
is you're trying to achieve.

Perhaps you could try posting a detailed example of what your data is, how
you'd like the output to look and perhaps some code (even pseudo code) so
we don't have to guess at what you want.

On Sat, Apr 25, 2015 at 9:39 AM, John Williams <john.b.williams at gmail.com>
wrote:

  
  
#
Nick,

the strategy under test includes an indicator derived from yesterday's HLC:

x = (yesterday's high + yesteday's low + yesterday's close )/3
If (today's close > x)  {
...
} else {
...
}

Trying to figure out how to computer this x in a quantstrat indicator

Thanks for your help
On Fri, Apr 24, 2015 at 9:30 PM, Nick White <n-e-w at qtradr.net> wrote:

            

  
  
#
I am thinking that   TTR::lags() may do the trick ...   e.g.,
 lags(close,1)  would return yesterday's close?