Don't like ads? PRO users don't see any ads ;-)
Guest

tradechecker

By: a guest on Jun 21st, 2012  |  syntax: None  |  size: 0.60 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. tradechecker<-function(porty,sym){
  2.         #combine the string for ease of use
  3.         junk0<-paste(porty,sym,sep="$")
  4.         #get transactions, prices and order book
  5.         junk1<-getTxns(porty,sym)
  6.         junk2<-junk1$Txn.Price
  7.         junk3<-getOrberBook(porty)
  8.                 #trim order book down to executed orders
  9.                 #first combine string
  10.                 junk4<-paste("junk3",junk0,sep="$")
  11.                 junk5<-paste(junk4,"Order.Status",sep="$")
  12.                 junk6<-which(eval(parse(text=junk4))=='closed',arr.ind=FALSE)
  13.         #get times of trades
  14.         junk7<-index(eval(parse(text=junk4))[c(junk6)])
  15.         #get Mkt data at those times
  16.        
  17.         # Check if trades are within the HL range
  18.        
  19.        
  20.        
  21.        
  22.         }