[Blotter-commits] r1460 - pkg/quantstrat/demo

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed May 8 00:07:51 CEST 2013


Author: opentrades
Date: 2013-05-08 00:07:51 +0200 (Wed, 08 May 2013)
New Revision: 1460

Modified:
   pkg/quantstrat/demo/luxor.1.strategy.basic.R
   pkg/quantstrat/demo/luxor.6.paramset.stoploss.R
   pkg/quantstrat/demo/luxor.6.paramset.stoptrailing.R
   pkg/quantstrat/demo/luxor.6.paramset.takeprofit.R
   pkg/quantstrat/demo/luxor.7.exit+risk.R
   pkg/quantstrat/demo/luxor.getSymbols.R
   pkg/quantstrat/demo/luxor.include.R
Log:
- prettified tradeStats() using View(t(tradeStats(...)))



Modified: pkg/quantstrat/demo/luxor.1.strategy.basic.R
===================================================================
--- pkg/quantstrat/demo/luxor.1.strategy.basic.R	2013-05-07 21:27:03 UTC (rev 1459)
+++ pkg/quantstrat/demo/luxor.1.strategy.basic.R	2013-05-07 22:07:51 UTC (rev 1460)
@@ -136,7 +136,7 @@
 
 ###############################################################################
 
-View(tradeStats(portfolio.st, 'GBPUSD'))
+View(t(tradeStats(portfolio.st, 'GBPUSD')))
 
 ###############################################################################
 

Modified: pkg/quantstrat/demo/luxor.6.paramset.stoploss.R
===================================================================
--- pkg/quantstrat/demo/luxor.6.paramset.stoploss.R	2013-05-07 21:27:03 UTC (rev 1459)
+++ pkg/quantstrat/demo/luxor.6.paramset.stoploss.R	2013-05-07 22:07:51 UTC (rev 1460)
@@ -67,7 +67,7 @@
 
 stats <- results$tradeStats
 
-print(stats)
+View(t(stats))
 
 plot(100*stats$StopLossLONG, stats$Net.Trading.PL, type='b', xlab='Stoploss %', ylab='Net.Trading.PL', main='Luxor')
 

Modified: pkg/quantstrat/demo/luxor.6.paramset.stoptrailing.R
===================================================================
--- pkg/quantstrat/demo/luxor.6.paramset.stoptrailing.R	2013-05-07 21:27:03 UTC (rev 1459)
+++ pkg/quantstrat/demo/luxor.6.paramset.stoptrailing.R	2013-05-07 22:07:51 UTC (rev 1460)
@@ -67,7 +67,7 @@
 
 stats <- results$tradeStats
 
-print(stats)
+View(t(stats))
 
 plot(100*stats$StopTrailingLONG, stats$Net.Trading.PL, type='b', xlab='StopTrailing %', ylab='Net.Trading.PL', main='Luxor')
 

Modified: pkg/quantstrat/demo/luxor.6.paramset.takeprofit.R
===================================================================
--- pkg/quantstrat/demo/luxor.6.paramset.takeprofit.R	2013-05-07 21:27:03 UTC (rev 1459)
+++ pkg/quantstrat/demo/luxor.6.paramset.takeprofit.R	2013-05-07 22:07:51 UTC (rev 1460)
@@ -67,7 +67,7 @@
 
 stats <- results$tradeStats
 
-print(stats)
+View(t(stats))
 
 plot(100*stats$TakeProfitLONG, stats$Net.Trading.PL, type='b', xlab='TakeProfit %', ylab='Net.Trading.PL', main='Luxor')
 

Modified: pkg/quantstrat/demo/luxor.7.exit+risk.R
===================================================================
--- pkg/quantstrat/demo/luxor.7.exit+risk.R	2013-05-07 21:27:03 UTC (rev 1459)
+++ pkg/quantstrat/demo/luxor.7.exit+risk.R	2013-05-07 22:07:51 UTC (rev 1460)
@@ -34,9 +34,9 @@
 
 ### BEGIN uncomment lines to activate StopLoss and/or StopTrailing and/or TakeProfit rules
 
-#enable.rule('luxor', 'chain', 'StopLoss')
-#enable.rule('luxor', 'chain', 'StopTrailing')
-#enable.rule('luxor', 'chain', 'TakeProfit')
+enable.rule('luxor', 'chain', 'StopLoss')
+enable.rule('luxor', 'chain', 'StopTrailing')
+enable.rule('luxor', 'chain', 'TakeProfit')
 
 ### END uncomment lines to activate StopLoss and/or StopTrailing and/or TakeProfit rules
 
@@ -60,7 +60,7 @@
 
 ###############################################################################
 
-View(tradeStats(portfolio.st, 'GBPUSD'))
+View(t(tradeStats(portfolio.st, 'GBPUSD')))
 
 ###############################################################################
 
@@ -71,7 +71,8 @@
 ### Uncomment to choose appropriate MAE of MFE graph
 
 chart.ME(portfolio.st, 'GBPUSD', scale='percent', type='MAE')
-#chart.ME(portfolio.st, 'GBPUSD', scale='percent', type='MFE')
+dev.new()
+chart.ME(portfolio.st, 'GBPUSD', scale='percent', type='MFE')
 
 ##### PLACE THIS BLOCK AT END OF DEMO SCRIPT ################### 
 # book  = getOrderBook(port)

Modified: pkg/quantstrat/demo/luxor.getSymbols.R
===================================================================
--- pkg/quantstrat/demo/luxor.getSymbols.R	2013-05-07 21:27:03 UTC (rev 1459)
+++ pkg/quantstrat/demo/luxor.getSymbols.R	2013-05-07 22:07:51 UTC (rev 1460)
@@ -26,8 +26,8 @@
 ### quantmod
 
 getSymbols.FI(Symbols='GBPUSD',
-	      dir=system.file('extdata',package='quantstrat'),
-#	      dir='~/R/OHLC',
+#	      dir=system.file('extdata',package='quantstrat'),
+	      dir='~/R/OHLC',
 	      from=.from, to=.to
 )
 

Modified: pkg/quantstrat/demo/luxor.include.R
===================================================================
--- pkg/quantstrat/demo/luxor.include.R	2013-05-07 21:27:03 UTC (rev 1459)
+++ pkg/quantstrat/demo/luxor.include.R	2013-05-07 22:07:51 UTC (rev 1460)
@@ -11,7 +11,7 @@
 
 .to='2008-07-04'
 #.to='2002-12-31'
-.to='2002-10-31'
+#.to='2002-10-31'
 
 ###
 



More information about the Blotter-commits mailing list