[Blotter-commits] r175 - pkg/blotter/demo

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jan 18 14:59:21 CET 2010


Author: braverock
Date: 2010-01-18 14:59:20 +0100 (Mon, 18 Jan 2010)
New Revision: 175

Added:
   pkg/blotter/demo/amzn_test.R
Modified:
   pkg/blotter/demo/00Index
Log:
- add amzn example

Modified: pkg/blotter/demo/00Index
===================================================================
--- pkg/blotter/demo/00Index	2010-01-18 13:14:46 UTC (rev 174)
+++ pkg/blotter/demo/00Index	2010-01-18 13:59:20 UTC (rev 175)
@@ -1,2 +1,3 @@
 turtles     Example of a trend following system 
 longtrend   Example of a trend following system
+amzn_test   Example of some intra-day data and transactions
\ No newline at end of file

Added: pkg/blotter/demo/amzn_test.R
===================================================================
--- pkg/blotter/demo/amzn_test.R	                        (rev 0)
+++ pkg/blotter/demo/amzn_test.R	2010-01-18 13:59:20 UTC (rev 175)
@@ -0,0 +1,14 @@
+require(blotter)
+# load the example data
+data("amzn")
+# Initialize the Portfolio
+initPortf("amzn_port",symbols="amzn",initDate="2010-01-14")
+# look at the transactions data
+amzn.trades
+# Add the transactions to the portfolio
+# if you wanted to avoid the contract multiplier warning, you would add an instrument first
+addTxns("amzn_port","amzn",TxnData=amzn.trades,verbose=TRUE)
+# update the portfolio stats
+updatePortf("amzn_port",Dates="2010-01-14")
+# and look at it
+chart.Posn("amzn_port","amzn",Dates="2010-01-14")
\ No newline at end of file


Property changes on: pkg/blotter/demo/amzn_test.R
___________________________________________________________________
Name: svn:keywords
   + Revision Id



More information about the Blotter-commits mailing list