Skip to content
Prev 11552 / 15274 Next

Issues about "maCross" demo in Quantstrat

On Sun, Apr 28, 2013 at 6:54 AM, John Han <john.xiaohan at gmail.com> wrote:
Hi John,
   I don't know but that demo doesn't seem to generate shorts for me
either. However there seem to be a number of small inconsistencies in
the code and the current documentation isn't easy to understand. (For
me anyway) The following is based on me running R ver 2.15.3

1) I get some errors starting the run in the first few lines which may
be caused by some package not being explicitly loaded?
Error in exists(paste("portfolio", name, sep = "."), envir = .blotter,  :
  object '.blotter' not found
Error in exists(paste("account", name, sep = "."), envir = .blotter,
inherits = TRUE) :
  object '.blotter' not found
Error in getPortfolio(portfolio) :
  Portfolio macross  not found, use initPortf() to create a new portfolio

2) The crossover rules use 'columns' and 'column'. Not sure if that
affects the underlying stratMACROSS structure.

3) The long entry/exit uses 100/all, which the short uses -100/100.
Why the inconsistency?

4) Really it's an initialization issue but in the rules greater
than/less than isn't the same as crosses above/crosses below. I'm
unclear if that's somehow handled in the code setup. Maybe this is
handled by name="sigCrossover", but the relationship="gte"/"lt"
implies (to me) just a logical check. (Would like to find the right
docs to better understand that.

5) In RStudio I don't know how to make sense of the stratMACROSS
structure. It's fairly unreadable to my old eyes.

6) It seems that chart.Posn command doesn't actually draw anything
until I run at least one of the add.SMA commands.

   Overall I'm actually pretty excited about all the capabilities
these geniuses are trying to give us. However right now it's a
learning experience.

HTH,
Mark