[R-SIG-Finance] Why is blotter giving me this error?

Robert Nicholson robert.nicholson at gmail.com
Mon Apr 26 04:05:15 CEST 2010


addTxn(Portfolio=portfolio, Symbol = Transaction$Symbol, TxnDate = CurrentDate, TxnPrice = as.numeric(Transaction$Price), TxnQty = as.numeric(Transaction$Quantity), TxnFees = 0, verbose = TRUE, ConMult=1)
Error in if (PosQty == 0) PosAvgCost = 0 else { : 
  argument is of length zero
> as.numeric(Transaction$Price)
[1] 0.35
> as.numeric(Transaction$Quantity)
[1] 10


Is there anything I'm doing that's obviously wrong?


More information about the R-SIG-Finance mailing list