SCM

SCM Repository

[blotter] Diff of /pkg/quantstrat/demo/maCross.R
ViewVC logotype

Diff of /pkg/quantstrat/demo/maCross.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 638, Fri Jun 24 14:03:50 2011 UTC revision 639, Fri Jun 24 14:29:06 2011 UTC
# Line 24  Line 24 
24  stratMACROSS <- add.indicator(strategy = stratMACROSS, name = "SMA", arguments = list(x=quote(Cl(mktdata)), n=50),label= "ma50" )  stratMACROSS <- add.indicator(strategy = stratMACROSS, name = "SMA", arguments = list(x=quote(Cl(mktdata)), n=50),label= "ma50" )
25  stratMACROSS <- add.indicator(strategy = stratMACROSS, name = "SMA", arguments = list(x=quote(Cl(mktdata)), n=200),label= "ma200")  stratMACROSS <- add.indicator(strategy = stratMACROSS, name = "SMA", arguments = list(x=quote(Cl(mktdata)), n=200),label= "ma200")
26    
27  stratMACROSS <- add.signal(strategy = stratMACROSS,name="sigCrossover",arguments = list(columns=c("ma50","ma200"), relationship="gt"),label="ma50.gt.ma200")  stratMACROSS <- add.signal(strategy = stratMACROSS,name="sigCrossover",arguments = list(columns=c("ma50","ma200"), relationship="gte"),label="ma50.gt.ma200")
28  stratMACROSS <- add.signal(strategy = stratMACROSS,name="sigCrossover",arguments = list(column=c("ma50","ma200"),relationship="lt"),label="ma50.lt.ma200")  stratMACROSS <- add.signal(strategy = stratMACROSS,name="sigCrossover",arguments = list(column=c("ma50","ma200"),relationship="lt"),label="ma50.lt.ma200")
29    
30  stratMACROSS <- add.rule(strategy = stratMACROSS,name='ruleSignal', arguments = list(sigcol="ma50.gt.ma200",sigval=TRUE, orderqty=100, ordertype='market', orderside='long'),type='enter')  stratMACROSS <- add.rule(strategy = stratMACROSS,name='ruleSignal', arguments = list(sigcol="ma50.gt.ma200",sigval=TRUE, orderqty=100, ordertype='market', orderside='long'),type='enter')
# Line 58  Line 58 
58  # R (http://r-project.org/) Quantitative Strategy Model Framework  # R (http://r-project.org/) Quantitative Strategy Model Framework
59  #  #
60  # Copyright (c) 2009-2010  # Copyright (c) 2009-2010
61  # Peter Carl, Dirk Eddelbuettel, Brian G. Peterson, Jeffrey Ryan, and Joshua Ulrich  # Peter Carl, Dirk Eddelbuettel, Brian G. Peterson,
62    # Jeffrey Ryan, Joshua Ulrich, and Garrett See
63  #  #
64  # This library is distributed under the terms of the GNU Public License (GPL)  # This library is distributed under the terms of the GNU Public License (GPL)
65  # for full details see the file COPYING  # for full details see the file COPYING

Legend:
Removed from v.638  
changed lines
  Added in v.639

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge