Skip to content
Prev 5861 / 15274 Next

Error in Blotter's Longtrend Demo

Thanks Brian,

I do get the following warnings but my knowledge of R is unfortunately reaching its limit to evaluate if they are relevant or not.

[1] "1998-10-30 GSPC 91 @ 1098.67"
Error: object 'ConMult' not found
In addition: There were 15 warnings (use warnings() to see them)
Warning messages:
1: In rm("account.longtrend", "portfolio.longtrend", pos = .blotter) :
  object 'account.longtrend' not found
2: In rm("account.longtrend", "portfolio.longtrend", pos = .blotter) :
  object 'portfolio.longtrend' not found
3: In rm("ltaccount", "ltportfolio", "ClosePrice", "CurrentDate",  ... :
  object 'ltaccount' not found
4: In rm("ltaccount", "ltportfolio", "ClosePrice", "CurrentDate",  ... :
  object 'ltportfolio' not found
5: In rm("ltaccount", "ltportfolio", "ClosePrice", "CurrentDate",  ... :
  object 'ClosePrice' not found
6: In rm("ltaccount", "ltportfolio", "ClosePrice", "CurrentDate",  ... :
  object 'CurrentDate' not found
7: In rm("ltaccount", "ltportfolio", "ClosePrice", "CurrentDate",  ... :
  object 'equity' not found
8: In rm("ltaccount", "ltportfolio", "ClosePrice", "CurrentDate",  ... :
  object 'GSPC' not found
9: In rm("ltaccount", "ltportfolio", "ClosePrice", "CurrentDate",  ... :
  object 'i' not found
10: In rm("ltaccount", "ltportfolio", "ClosePrice", "CurrentDate",  ... :
  object 'initDate' not found
11: In rm("ltaccount", "ltportfolio", "ClosePrice", "CurrentDate",  ... :
  object 'initEq' not found
12: In rm("ltaccount", "ltportfolio", "ClosePrice", "CurrentDate",  ... :
  object 'Posn' not found
13: In rm("ltaccount", "ltportfolio", "ClosePrice", "CurrentDate",  ... :
  object 'UnitSize' not found
14: In rm("ltaccount", "ltportfolio", "ClosePrice", "CurrentDate",  ... :
  object 'verbose' not found
15: In download.file(paste(yahoo.URL, "s=", Symbols.name,  ... :
  downloaded length 187356 != reported length 200



It seems like the error happens in the first iteration of the loop with 
i=10. 
When I run the following statement I get the same error:
Dates = CurrentDate)
Error: object 'ConMult' not found
[1] 10
CurrentDate
[1] "1998-10-30 GMT"
getPortfolio(ltportfolio)
$GSPC
$GSPC$txn
          Txn.Qty Txn.Price Txn.Fees Txn.Value Txn.Avg.Cost Pos.Qty Pos.Avg.Cost Realized.PL Con.Mult
1997-12-31       0      0.00        0      
0.00         0.00       0         0.00           0        0
1998-10-30      91   1098.67        0  99978.97      1098.67      91      1098.67           0        1

$GSPC$posPL
           Pos.Qty Con.Mult 
Ccy.Mult Pos.Value Txn.Value Txn.Fees Realized.PL Unrealized.PL 
Trading.PL
1997-12-31       0        1        1         0         0        0           0             0          0


attr(,"class")
[1] "blotter_portfolio" "portfolio"        


Thanks.

Regards,


 Wolfgang Wu





----- Urspr?ngliche Mail ----
Von: Brian G. Peterson <brian at braverock.com>
An: r-sig-finance at stat.math.ethz.ch
Gesendet: Donnerstag, den 25. M?rz 2010, 11:11:46 Uhr
Betreff: Re: [R-SIG-Finance] Error in Blotter's Longtrend Demo

I am unable to reproduce your error.  Current SVN works fine for me on 
two different machines, one of them only updated after your email.

If it is failing, I'm guessing it is happening earlier in the script.  
Are there any warnings?  The one I would expect is related to the 
instrument definition.

If there is no instrument defined, blotter attempts to proceed forward 
with a contract multiplier of 1.

It is possible that we have not made this assumption everywhere, 
expectially in updatePosn or updateAcct.  If there is a warning earlier 
in the demo, that would confirm that this is where I need to look.

Regards,

     - Brian
On 03/25/2010 03:37 AM, Wob Wu wrote: