[tech-spec] report -> R plot script

  • From: "Henry Carstens" <carstens@xxxxxxxxxxxxxxxxxxxxx>
  • To: <tech-spec@xxxxxxxxxxxxx>
  • Date: Thu, 20 Jan 2005 10:03:04 -0800

This script loads a custom report from TradeStation and plots the result.

Since the report is automatically dumped by TradeStation w/ the same name
and path, all it takes is a single keypress to run this R script to load and
plot the contents.

Note the forward '/' in the pathname,


# R Chi2
# 011805 hac    v 1.0   Imports a TS Chi^2 csv report and plots it

# loadreport
# loads the chi2 report and returns a dataframe
loadreport<-function() {

       return(read.csv("c:/Chi2 Report.txt"))

# plotreport
# plots the chi2 report from the chi2 df
plotreport<-function(chi2df) {


       plot(chi2df$chi2, type='b', xlab='Trade No.', ylab='Chi^2',
       abline(h=10, col='blue')

       plot(chi2df$Act.to.Exp.Wins, type='b', xlab='Trade No.',
main='Act Wins/Exp Wins')
       abline(h=1, col='blue')

# loadandplot
# loads and plots the chi2 report



Other related posts:

  • » [tech-spec] report -> R plot script