[R-SIG-Finance] Trigger a rule based on more than one signal?

Brian G. Peterson brian at braverock.com
Thu Sep 1 15:15:15 CEST 2011


On Thu, 2011-09-01 at 05:41 -0700, soren wilkening wrote:
> quantstrat allows you to build new signals from existing signals. That
> means you can use "or" (|) or "and" (&) plus the "sigFormula" function
> to do just that.


I'll note that sigFormula is very powerful, but it is usually too slow
to use on high frequency data.  Hourly might be fine, daily certainly is
ok for most formulations, but minutes, secods, or tick are probably too
slow.  

We're relying on a functionality in R that allows you to treat a
data.frame as an environment, and address each column as though it were
a separate variable.  

This is very flexible, and is a great way to do initial testing on an
idea. 

We have found that after testing something with sigFormula to prove out
a hypothesis, it makes a lot of sense to write a more efficient custom
signal function that incorporates the logic of the formula without
resorting to the expensive to/from conversion to a data.frame and an
environment that sigFormula requires.

Regards,

  - Brian
 
-- 
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock



More information about the R-SIG-Finance mailing list