Skip to content
Prev 7401 / 15274 Next

quantstrat - macross demo problem

On Wed, Jan 26, 2011 at 6:42 AM, Brian G. Peterson <brian at braverock.com> wrote:
I second that.  Aleksandr did most of the work, which made it very
easy to patch.
I've committed the patch below.  Rather than looping over
names(strategy$rules), I create a factor that will sort in the same
order as described in the documentation.  Obviously, if a new new rule
type is created, it must be added to this list.

types <- sort(factor(names(strategy$rules),
  levels=c("pre","risk","order","rebalance",
               "exit","enter","entry","post")))
for ( type in types ) {
  switch( type ,

The maCross demo now works correctly when the short rules are uncommented.

Best,
--
Joshua Ulrich  |  FOSS Trading: www.fosstrading.com