[R-SIG-Finance] blotter updatePortf issue..

pie trader pietrader at gmail.com
Tue Sep 4 08:46:02 CEST 2012


Hi Garrett,
Thank you very much for the patch and the instructions. I was able to
execute the updatePortf, updateAcct and updateEndEq without any errors
after updating the package followed by date changes you suggested.

Regards,
Pie

On Mon, Sep 3, 2012 at 5:11 PM, G See <gsee000 at gmail.com> wrote:
> FYI, R-Forge has built Rev. 1151.  So, you should be able to install with
>
>     install.packages("blotter", repos="http://R-Forge.R-project.org")
>
> On Mon, Sep 3, 2012 at 3:37 PM, G See <gsee000 at gmail.com> wrote:
>> If you are able to checkout the code using an svn client, but can't
>> figure out how to build it, you can probably install it with something
>> similar to this:
>>
>>     install.packages("/path/to/svn/blotter/pkg/blotter/", repos=NULL,
>> type='source')
>>
>> You want to see
>>     > packageVersion("blotter")
>>     [1] ‘0.8.11’
>>
>> Good luck,
>> Garrett
>>
>> On Mon, Sep 3, 2012 at 3:14 PM, pie trader <pietrader at gmail.com> wrote:
>>> Hi Garrett,
>>> Thank you for both the fix as well as for your guidance. I will go
>>> through the links and try to build the latest version and try again
>>> along with the changes suggested.
>>>
>>> Regarding warning messages (while downloading data from Yahoo), I have
>>> been getting these messages right from the time I started using R
>>> (including on demo code). So I just assumed it was a harmless message
>>> everyone gets. I will check it out.
>>>
>>> Regards,
>>> Pie
>>>
>>> On Mon, Sep 3, 2012 at 12:14 PM, G See <gsee000 at gmail.com> wrote:
>>>>
>>>> Hi Pie,
>>>>
>>>> Thanks for providing reproducible code.  I committed a patch in Rev.
>>>> 1151 that I believe will fix your problem.  If you need help checking
>>>> out and building the latest revision, see this post on SO:
>>>> http://stackoverflow.com/a/11105132/967840
>>>>
>>>> Internally, the code was checking to see if "Dates" was timeBased.  If
>>>> it wasn't, it was being converted to a timeBased vector.  But, later,
>>>> the code was treating "Dates" as if it were not timeBased.  Hopefully
>>>> my patch fixes your problem and doesn't create others.
>>>>
>>>> There are a couple other things to mention.  First, these lines are
>>>> not going to work:
>>>>
>>>>     updateAcct(account, Dates=paste('::',as.Date(Sys.time()),sep=''))
>>>>     updateEndEq(account, Dates=paste('::',as.Date(Sys.time()),sep=''))
>>>>
>>>> These functions do not support that type of "Dates" strings.  You'll
>>>> have to either use Dates=NULL, or supply both starting and ending
>>>> dates like this:
>>>>
>>>>     updateAcct(account, Dates=paste(initDate, as.Date(Sys.time()),sep='::') )
>>>>     updateEndEq(account, Dates=paste(initDate, as.Date(Sys.time()),sep='::') )
>>>>
>>>>
>>>> Second, I didn't get these warnings that you got
>>>>
>>>> >> > getSymbols(symbols, src='yahoo',
>>>> >> index.class=c("POSIXt","POSIXct"),from='2001-01-01')
>>>> >> [1] "QQQ" "IWM"
>>>> >> Warning messages:
>>>> >> 1: In download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m,  :
>>>> >>   downloaded length 147933 != reported length 200
>>>> >> 2: In download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m,  :
>>>> >>   downloaded length 147996 != reported length 200
>>>>
>>>> I'm not sure why you get those warnings, but your version of quantmod
>>>> is a little older than mine (the R-forge version).
>>>>
>>>> HTH,
>>>> Garrett
>>>>
>>>>
>>>> On Sun, Sep 2, 2012 at 11:27 PM, pie trader <pietrader at gmail.com> wrote:
>>>> > Hi,
>>>> > Currently I am stuck on an error with updatePortf function in blotter. The
>>>> > error message is same as the issue mentioned on R-sig-finance previously
>>>> > i.e.,
>>>> > http://r.789695.n4.nabble.com/blotter-updatePortf-issues-tp4635933.html
>>>> >
>>>> >>
>>>> >> updatePortf(Portfolio=portfolio,Dates=paste('::',as.Date(Sys.time()),sep=''))
>>>> >> Error in if (length(c(year, month, day, hour, min, sec)) == 6 && c(year,
>>>> >>  :
>>>> >>   missing value where TRUE/FALSE needed
>>>> >> In addition: Warning message:
>>>> >> In as_numeric(YYYY) : NAs introduced by coercion
>>>> >
>>>> >



More information about the R-SIG-Finance mailing list