[Blotter-commits] r1483 - pkg/blotter/demo
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Jul 22 03:27:15 CEST 2013
Author: bodanker
Date: 2013-07-22 03:27:14 +0200 (Mon, 22 Jul 2013)
New Revision: 1483
Modified:
pkg/blotter/demo/longtrend.R
pkg/blotter/demo/turtles.R
Log:
- update demos to run with new quantmod/xts code
Modified: pkg/blotter/demo/longtrend.R
===================================================================
--- pkg/blotter/demo/longtrend.R 2013-07-02 15:45:19 UTC (rev 1482)
+++ pkg/blotter/demo/longtrend.R 2013-07-22 01:27:14 UTC (rev 1483)
@@ -47,6 +47,8 @@
require(TTR)
require(blotter)
+Sys.setenv(TZ="UTC")
+
# Try to clean up in case the demo was run previously
try(rm("account.longtrend","portfolio.longtrend",pos=.blotter),silent=TRUE)
try(rm("ltaccount","ltportfolio","ClosePrice","CurrentDate","equity","GSPC","i","initDate","initEq","Posn","UnitSize","verbose"),silent=TRUE)
@@ -61,7 +63,7 @@
currency("USD")
stock("GSPC",currency="USD",multiplier=1)
getSymbols('^GSPC', src='yahoo', index.class=c("POSIXt","POSIXct"),from='1998-01-01')
-GSPC=to.monthly(GSPC, indexAt='endof')
+GSPC=to.monthly(GSPC, indexAt='endof', drop.time=FALSE)
# Set up indicators with TTR
print("Setting up indicators")
Modified: pkg/blotter/demo/turtles.R
===================================================================
--- pkg/blotter/demo/turtles.R 2013-07-02 15:45:19 UTC (rev 1482)
+++ pkg/blotter/demo/turtles.R 2013-07-22 01:27:14 UTC (rev 1483)
@@ -6,6 +6,8 @@
require(TTR)
require(blotter)
+Sys.setenv(TZ="UTC")
+
# Try to clean up in case the demo was run previously
try(rm("account.turtles","portfolio.turtles",pos=.blotter),silent=TRUE)
try(rm("portfolio","account","N","symbol","symbols","ClosePrice","CurrentDate","equity","Units","maxUnits","size","Stop","equity","TxnPrice","initDate","initEq","Posn","verbose"),silent=TRUE)
More information about the Blotter-commits
mailing list