Message-ID: <5020D450.3010307@braverock.com>
Date: 2012-08-07T08:39:44Z
From: Brian G. Peterson
Subject: pennyPerShare function not working with Quantstrat rules
In-Reply-To: <CAB_TmjVcYWOdYT7X7HgE41y4RA5UButQifBfbrGTMag8Um0zqA@mail.gmail.com>
On 08/07/2012 12:32 AM, Danny D wrote:
> I have been trying to figure out why the TxnFees argument does not
> evaluate the pennyPerShare function when it is passed via add.rule. I
> receive the following error..
>
> out<-try(applyStrategy(strategy=stratBBands ,
> portfolios='bbands',parameters=list(sd=SD,n=N)) )
> Error in rbind(deparse.level, ...) :
> (list) object cannot be coerced to type 'double'
> In addition: Warning messages:
> 1: In rbind(deparse.level, ...) :
> mismatched types: converting objects to numeric
> 2: In rbind(deparse.level, ...) : NAs introduced by coercion
>
> I am using the BBands demo to demonstrate below.
>
> Am I doing something wrong or is there something wrong with the code?
> Thank you for taking the time to help.
It's a bug (more precisely a missing feature). We'll try to fix this week.
addTxn takes either a numeric TxnFees argument or a function. It does
not evaluate a string *name* of a function to locate the function via
match.fun. We'll try to add that feature shortly.
Regards,
- Brian
--
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock