Re: [R] testing if xts date exists ?

2014-01-27 Thread Joshua Ulrich
You can use the which.i argument to [.xts: > is.null(SPY["2009-01-18",which.i=TRUE]) [1] TRUE Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com On Sat, Jan 25, 2014 at 9:27 AM, ce wrote: > Dear all > > > How to test if xts date

Re: [R] testing xts values in if command?

2014-01-29 Thread Joshua Ulrich
>> as.numeric(SPY["2007-01-03"]$SPY.Adjusted) > >> as.numeric(SPY["2007-01-04"]$SPY.Adjusted) > [1] FALSE > > > Is this the expected behavior ? > Yes, see: http://stackoverflow.com/q/7097437/271616 -- Joshua Ulrich | about.me/joshuaulrich FOSS Tr

Re: [R] Merging xts List created using panel data

2014-02-04 Thread Joshua Ulrich
This is related to: http://stackoverflow.com/q/21393866/271616 http://stackoverflow.com/q/21484267/271616 -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com On Tue, Feb 4, 2014 at 6:07 PM, Jairaj Gupta wrote: > Hi, > > I have done the following: > >

Re: [R] ts instead of xts object

2014-03-11 Thread Joshua Ulrich
will work if you drop the dimensions of your single-column xts object: testt <- cpt.mean(drop(testTSRad)) > My data is below. Is there a way to convert it to ts? > Yes, as is generally the case, use the "as" method: as.ts(testTSRad) Best, -- Joshua Ulrich | about.me/joshua

Re: [R] ts instead of xts object

2014-03-16 Thread Joshua Ulrich
wrote: >> >> Hello, >> >> On Tue, Mar 11, 2014 at 8:45 PM, Joshua Ulrich >> wrote: >> > On Tue, Mar 11, 2014 at 12:14 AM, Bill wrote: >> >> >> >> Hello. I have a dataframe that has a date column. The intervals between >> >

Re: [R] package ‘build-essential’ is not available (for R version 3.0.2)

2013-11-11 Thread Joshua Ulrich
Have you read these instructions? http://cran.r-project.org/bin/linux/ubuntu/README.html They say to run sudo apt-get install r-base-dev which should install 'build-essential' (which is an Ubuntu package, not an R package). -- Joshua Ulrich | about.me/joshuaulrich FO

Re: [R] xts objects comparison

2013-11-14 Thread Joshua Ulrich
n common, so there's nothing to compare. Convert series1's index to yearmon, and the comparison works. > index(series1) <- as.yearmon(index(series1)) > tail(series1 > series2) GSPC 2013-06-01 TRUE 2013-07-01 TRUE 2013-08-01 TRUE 2013-09-01 TRUE 2013-10-01 TRUE

Re: [R] Column Name Matching in xts Objects

2013-11-14 Thread Joshua Ulrich
or > expected for xts objects? > xts doesn't have a $<- method, so $<-.zoo is dispatched. I'm not familiar with the function, but the behavior you found is explicitly defined, so that seems to suggest it was intended. >From "$<-.zoo": wi <- match(x, colnames(o

Re: [R] Merge xts and Return.portfolio

2013-11-15 Thread Joshua Ulrich
9 >> #2013-11-07 -0.004390787 -0.0188959585NA >> #2013-11-07 NANA 0.0068094113 >> #2013-11-080.0 0.0136779259NA >> #2013-11-10 NANA 0.0010398246 >> #2013-11-110.003

Re: [R] Installing quantstrat

2013-11-26 Thread Joshua Ulrich
s the end of it. > Does anyone know if it is possible to run quantstrat with the current version > of R? Yep, see here: http://stackoverflow.com/q/11105131/271616 Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com _

Re: [R] Installing quantstrat

2013-11-26 Thread Joshua Ulrich
esume that if it > were that simple, why would the version crated a week ago not work? > I don't know; that's a question for the R-Forge maintainers. It looks like they're building with 3.0.2, but I'm not sure that matters. The easiest thing to do it just check out

Re: [R] Averaging half hourly data to hourly

2010-06-28 Thread Joshua Ulrich
69-12-31 20:30:009 1969-12-31 21:30:00 13 1969-12-31 22:30:00 17 1969-12-31 23:00:00 10 > period.apply(x, endpoints(x,"hours"), mean) [,1] 1969-12-31 18:30:00 1.0 1969-12-31 19:30:00 2.5 1969-12-31 20:30:00 4.5 1969-12-31 21:30:00 6.

Re: [R] R-help Digest, Vol 93, Issue 5

2010-11-05 Thread Joshua Ulrich
[,1]) # assumes "date" in first column You will need to ensure that Data[,"date"] is a time-based class (e.g. Date, POSIXt). If it is character, you will need to convert it to a time-based class before calling xts(). Best, -- Joshua Ulrich | FOSS Trading: www.fosstrading.co

Re: [R] Zoo - bug ???

2010-11-30 Thread Joshua Ulrich
> A1b <- rollapply(A1a,4,mean, na.rm=TRUE, na.pad=FALSE, align="right") > cbind(A1a,A1b) A1a A1b 1 NA NA 2 NA NA 31 1.0 42 1.5 53 2.0 6 4 3.0 75 4.0 86 5.0 9 NA 5.5 10 NA 6.0 HTH, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com >

Re: [R] Downloading quote data from yahoo finance

2010-12-04 Thread Joshua Ulrich
onnection(con) : >   unable to connect to 'quote.yahoo.com' on port 80. > The example works for me. Are you behind a firewall or proxy? > 2. How can I download Key Statistics Data from Yahoo Finance > > A. http://finance.yahoo.com/ > > B. ASH.AX (Using GET QUOTES) >

Re: [R] as.xts error

2010-12-06 Thread Joshua Ulrich
lease help me to use the function as.xts correctly. >> I recommend you use Gabor's solution, but I would like to expand on what as.xts is doing. as.xts.data.frame and as.xts.matrix attempt to coerce the object's rownames into the index attribute, unless specified otherwise via or

Re: [R] XTS : merge.xts seems to have problem with character vectors

2011-01-04 Thread Joshua Ulrich
NA NA > 2011-01-04 11:45:42  5 NA NA > > Warning message: > In merge.xts(y1, y2) : NAs introduced by coercion > > Why do I lose the character columns ? > Because zoo / xts objects are matrices with an ordered index (a time index in the case of xts). You can't mix types i

Re: [R] Interpolate xts

2011-01-11 Thread Joshua Ulrich
Use na.approx: set.seed(21) x <- xts(rnorm(10), Sys.time()-10:1) is.na(x) <- 2:4 is.na(x) <- 8:9 na.approx(x) na.spline(x) Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Tue, Jan 11, 2011 at 12:08 AM, Rustamali Manesiya wrote: > Hello, > >       I have a x

Re: [R] Aggragating subsets of data in larger vector with sapply

2011-01-11 Thread Joshua Ulrich
Hi Chris, This seems to work on the sample data you provided. FUN <- function(x) { x <- xts(as.numeric(x),index(x)) period.apply(x, endpoints(x,"secs"), sum) } lapply(split.default(xSym$Size,xSym$Direction), FUN) Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com

Re: [R] to append a column to a data frame, has I use loop/if in my case?

2011-01-18 Thread Joshua Ulrich
Please do not cross post: http://stackoverflow.com/q/4720076/271616 At the minimum, it would be polite to respond here with the answer you accepted on Stack Overflow. -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Mon, Jan 17, 2011 at 8:59 AM, Daniel Wu wrote: > days=Sys.Date(

Re: [R] Plotting multiple xts/zoo time series on a single plot.

2011-01-22 Thread Joshua Ulrich
See ?plot.zoo, specifically plot.type="single". -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Sat, Jan 22, 2011 at 8:02 PM, Nick Torenvliet wrote: > So I've got a 154 column wide xts time series object and I want to plot the > 154 series on a single plot and h

Re: [R] Another quantmod question

2011-05-08 Thread Joshua Ulrich
ion" manual to see how method dispatch is normally done. But you've been writing quite sophisticated code for a fairly long time, so I'm not telling you anything you don't know... you just don't think you should have to do the legwork. > -- Russ > > -- Joshua Ulri

Re: [R] More effective calculation for loop

2011-05-13 Thread Joshua Ulrich
stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Joshua Ulrich | FOSS Trading: www.fosstrading.com __ R-

Re: [R] How to do a moving window on standard deviation

2011-01-30 Thread Joshua Ulrich
TTR::runSD will do what you want and the same call will work on data.frame, matrix, vector, xts/zoo, or any other time-series object. Note that time-series objects will generally put time periods in ascending order. library(TTR) d$st.dev <- runSD(d$Close,4) z <- zoo(d[,2,FALS

Re: [R] SMA and EMA in package TTR

2011-02-02 Thread Joshua Ulrich
t. I would appreciate patches. Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Sat, Jan 29, 2011 at 7:39 PM, Anyi Zhu wrote: > Hi, > > Just wondering for the SMA and EMA in package TTR, is it possible to me to > code it so that, say if I need to calculate SMA (x, n=100)

[R] R Users Group in Saint Louis, MO

2011-02-27 Thread Joshua Ulrich
data analysis, statistical modeling, visualization, and programming. Anyone with a background or interest in R is welcome! The group will use meetup.com to communicate with members. Please sign up to receive updates and RSVP to events: http://www.meetup.com/Saint-Louis-RUG/ Best, -- Joshua Ulrich

Re: [R] xts POSIXct index format

2011-03-05 Thread Joshua Ulrich
Hi Chris, Perhaps something like this? require(xts) ds <- options(digits.secs=6) # so we can see sub-seconds x <- xts(1:10, as.POSIXct("2011-01-21") + c(1,1,1,2:8)/1e3) x indexFormat(x) <- "%H:%M:%OS3" x Hope that helps, -- Joshua Ulrich  |  FOSS Trading: www.fos

Re: [R] xts POSIXct index format

2011-03-06 Thread Joshua Ulrich
Hi David, On Sat, Mar 5, 2011 at 11:00 PM, David Winsemius wrote: > > On Mar 5, 2011, at 11:28 AM, Joshua Ulrich wrote: > >> Hi Chris, >> >> Perhaps something like this? >> >> require(xts) >> ds <- options(digits.secs=6) # so we can see sub-second

Re: [R] pass character vector in instrument field of get.hist.quote function

2011-03-13 Thread Joshua Ulrich
-01-05 31.36 19.90 57.87 137.2938.40 # 2011-01-06 32.04 19.79 57.49 138.0737.23 # 2011-01-07 31.95 19.77 57.20 138.3537.30 # 2011-01-10 31.55 19.76 58.22 142.69 37.04 Hope that helps, -- Joshua Ulrich  |  FOSS

Re: [R] possible problem with "endpoints"?

2011-03-17 Thread Joshua Ulrich
roject.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Joshua Ulrich | FOSS Trading: www.fosstrading.com _

Re: [R] Need to abstract changing name of column within loop

2011-03-17 Thread Joshua Ulrich
> > How can I change the name of that column within my big loop?  Any > ideas?  Thanks! > I usually make a copy of the object, change it, then overwrite the original: tmp <- get(i) colnames(tmp)[7] <- "foo" assign(i,tmp) Hope that helps. > Best regards, > > &g

Re: [R] quantmod Some Single Letter Tickers Not getFin

2011-03-19 Thread Joshua Ulrich
NYSE:F works, while http://www.google.com/finance?fstype=ii&q=F results in a 400 'Bad request' error. This seems to work for this one symbol, maybe it will work for others as well. getFin("NYSE:F") Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Thu, Mar 17,

Re: [R] Package Installation

2011-03-21 Thread Joshua Ulrich
http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Joshua Ulrich | FOSS Trading: www.fosstrading.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinf

Re: [R] multiple plots with QQplot of PerformanceAnalytics

2011-03-25 Thread Joshua Ulrich
Please don't cross-post. -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Fri, Mar 25, 2011 at 8:33 AM, William Mok wrote: > Hi All, > > I am trying to plot 4 graphs on to 1 page using layout(...), or par(mfcol = > c(...)); with the function QQplot

Re: [R] How to speed up grouping time series, help please

2011-04-04 Thread Joshua Ulrich
t;, buildTimeSeriesFromDataFrame, >      env = e1) >  return(get("xx", e1)) # return xx from env > } > > ##replicate 100 times > #Time03 <- replicate(100, > #  system.time(tsDaply(X, X$ID))[[1]]) > #median(Time03) > > # result > tsDaply(X, X$ID) > >

Re: [R] 'RQuantLib for 2.12 version

2011-04-04 Thread Joshua Ulrich
Hi Mauricio, A Windows binary is now available on CRAN: http://dirk.eddelbuettel.com/blog/2011/04/04/#rquantlib_0.3.7 Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Tue, Mar 29, 2011 at 10:38 AM, Mauricio Romero wrote: > Dear R users, > > I have been trying to use

Re: [R] Avoiding for Loop for moving average

2011-09-02 Thread Joshua Ulrich
WMA. > SMA still calls Fortran code, so that's why it's slower than caTools::runmean. I've moved the EMA code to C, so it's about as fast as it can be. Noah, use EMA's ratio argument to replicate your for loop. > Hope this helps, > > Michael Weylandt > Be

Re: [R] Avoiding for Loop for moving average

2011-09-02 Thread Joshua Ulrich
faster language? > As I said, the function is in C. You could also use the compiler package to compile your pure R function for a 3-4x speedup. Best, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com > > -- > Noah Silverman > UCLA Department of Statistics > 8117 Math Sciences

Re: [R] Getting Rcpp SEXP data in C++

2011-09-13 Thread Joshua Ulrich
?  I have tried googling it > to no avail. > See the R Internals manual: http://cran.r-project.org/doc/manuals/R-ints.html > cheers > Worik > Best, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com __ R-help@r-project.org mailing list h

Re: [R] Gaps on merging xts objects

2012-06-11 Thread Joshua Ulrich
Eric, I'd be happy to help. Please follow the posting guide (specifically the "Surprising behavior and bugs" section) and provide a *minimal*, reproducible example and the output from sessionInfo(). http://www.r-project.org/posting-guide.html Best, -- Joshua Ulrich  

Re: [R] what does .indexDate() do - R::xts

2012-06-12 Thread Joshua Ulrich
. '2010-01-01' is a character string. > > I am sure i am missing something - what is .indexDate() supposed to do? > Though it's not well documented, what it's doing is pretty clear from the source: R> .indexDate function (x) { .index(x)%/%86400L } > > than

Re: [R] DEoptim example illustrating use of fnMap parameter for enforcement of cardinality constraints

2012-06-15 Thread Joshua Ulrich
=lower, upper=upper, control=controlDE, fnMap=mappingFun) Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Fri, Jun 15, 2012 at 3:24 AM, David-Michael Lincke wrote: > Function DEoptim in package DEoptim for differential evolution defines an > optional parameter fnMap: > > fn

Re: [R] DEoptim example illustrating use of fnMap parameter for enforcement of cardinality constraints

2012-06-16 Thread Joshua Ulrich
meant that the mapping example near the end of slimLargeN_map.R uses the objective function in the vignette. > Best regards, > David > Best, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com > -Original Message- > From: Joshua Ulrich [mailto:josh.m.ulr...@gmail.co

Re: [R] Profit calculation

2012-06-19 Thread Joshua Ulrich
On Tue, Jun 19, 2012 at 6:07 PM, Bert Gunter wrote: > 1. Don't double post. (obviously belongs on finance list) > 2. Homework? (we don't do homework on r-help) > We don't do homework on R-SIG-Finance either... > -- Bert > Best, -- Joshua Ulrich | FOSS Trading:

Re: [R] Getting objects from quantmod ticker list

2012-07-07 Thread Joshua Ulrich
Load the data into an environment, then merge them using do.call(): series.env <- new.env() getSymbols(ticker.list, src='FRED', env=series.env) series <- do.call(merge, as.list(series.env)) HTH, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com On Sat, Jul 7, 2012 at 7:00

Re: [R] RES: time series interpolation

2011-06-30 Thread Joshua Ulrich
$time), format="%d.%m.%y > %H:%M:%S")) > w03_11temp_y <- merge(w03_11temp_z, zoo(order.by=seq(start(w03_11temp_z), > end(w03_11temp_z), by=1))) > w03_11temp_x <- na.approx(w03_11temp_y) > w03_11temp_w <- data.frame(date=format(index(w03_11temp_x), "%d.%m.%y&qu

Re: [R] AR-GARCH with additional variable - estimation problem

2011-07-13 Thread Joshua Ulrich
Please don't cross-post: https://mailman.stat.ethz.ch/pipermail/r-sig-finance/2011q3/008230.html -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Wed, Jul 13, 2011 at 11:11 AM, Marcin P?�ciennik wrote: > Dear list members, > > I am trying to estimate parameters of the A

Re: [R] FOMULATING TIME SERIES DATA FROM DATA FRAME

2011-07-17 Thread Joshua Ulrich
; d <- as.xts(d,order.by =year, frequency = 1) > > #Error in xts(coredata(x), order.by = order.by, frequency = frequency,  : >  # order.by requires an appropriate time-based object > > > Peter Maclean > Department of Economics > UDSM > Best, -- Joshua Ulrich | FOSS Tra

Re: [R] Plotting intraday data in quantmod

2011-07-18 Thread Joshua Ulrich
What's your problem? What have you tried? -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Mon, Jul 18, 2011 at 11:39 PM, kev946 wrote: > Hello, I'm new to R and am having trouble plotting intraday data on a chart. > I haven't had any success with using ideas fro

Re: [R] Plotting intraday data in quantmod

2011-07-19 Thread Joshua Ulrich
) > This is not a plot command. What plot command are you using? Dates don't have "H:M:S"; they're all zero. You don't provide a sample of Dataset, so we don't know what your data look like. Best, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com

Re: [R] Picking returns from particular days of the month from a zoo object

2011-07-23 Thread Joshua Ulrich
- index(SPY)[endpoints(SPY, "months")[-1]-3] > Thanks in advance, > > John B. Nicholas, Ph.D > 650-315-9895 > HTH, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] Plot.xts - how to change the x-axis labels to show weekly labels.

2011-07-30 Thread Joshua Ulrich
le to give you what you want. Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Sat, Jul 30, 2011 at 9:10 AM, Eduardo M. A. M.Mendes wrote: > Dear R-users > > > > I am new to R and struggling not to bother the list with silly questions. > > > > I read

Re: [R] Switching log(J) to log(J+1) to avoid log(0) in HAR-RVJ model

2012-07-19 Thread Joshua Ulrich
Cross-posted on Stack Overflow: http://stackoverflow.com/q/11567745/271616 -- Joshua Ulrich | FOSS Trading: www.fosstrading.com On Thu, Jul 19, 2012 at 12:23 PM, cursethiscure wrote: > I am working with xts dependent data, and my code is as follows (the problem > is explained thro

Re: [R] Change log(J) to log(J+1) to stop log(0) from occurring in harModel

2012-07-19 Thread Joshua Ulrich
Same post on Stack Overflow (again): http://stackoverflow.com/q/11567745/271616 -- Joshua Ulrich | FOSS Trading: www.fosstrading.com On Thu, Jul 19, 2012 at 11:15 AM, cursethiscure wrote: > I think the code is part of the RTAQ package but is not included in it, as I > obtained it from &

Re: [R] timeBasedSeq stumbles over the year 2038 (xts package)

2012-08-01 Thread Joshua Ulrich
")) unclass(y1) (z1 <- as.POSIXct(y1, tz="GMT")) do_asPOSIXct is at line 733 of main/datetime.c, for anyone interested in digging further. Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com On Wed, Aug 1, 2012 at 6:10 PM, Jeff Newmiller wro

Re: [R] xts/time-series and plot questions...

2011-10-03 Thread Joshua Ulrich
<- ind # label column with year of last obs colnames(x) <- paste(colnames(x),xyear,sep=".") x } # split data into a list of xts objects by year tmp_dat_yr_list <- split(temp_data, "years") # convert each list element to be "2011" tmp_dat_yr_list <-

Re: [R] R and Forex

2011-10-12 Thread Joshua Ulrich
nd between R-help and R-devel. Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Wed, Oct 12, 2011 at 9:05 PM, R. Michael Weylandt wrote: > To be honest, I don't frequently have occasion to wander over to R-devel and > most of what goes on over there is over my leve

Re: [R] cbind giving NA's?

2011-10-24 Thread Joshua Ulrich
NA 2010-04-02 7.6343 NA 2010-04-03 7.5458 NA 2010-04-04 7.4532 28.30 2010-04-05 7.4040 28.38 2010-04-06 7.3317 28.21 2010-04-07 NA 28.31 2010-04-08 NA 28.47 Jeff's answer on StackOverflow explains why this works. Best, -- Joshua

Re: [R] Extract Data from Yahoo Finance

2011-11-03 Thread Joshua Ulrich
Deb, See getQuote in the quantmod package. For example: getQuote("SPY") Be sure to read ?getQuote. Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Thu, Nov 3, 2011 at 5:05 PM, Deb Midya wrote: > Michael, > > Thanks for your response. > > The

Re: [R] Extract Data from Yahoo Finance

2011-11-04 Thread Joshua Ulrich
Deb, Sorry, you can't do that with getQuote because Yahoo does not make those data available historically. Generally, you will need to pay for historical bid/ask (tick) data. Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Fri, Nov 4, 2011 at 6:10 AM, Deb Midya

Re: [R] Store vectors as values in xts time-series object

2012-03-04 Thread Joshua Ulrich
Hi Sergey, Internally, xts objects are a matrix with an index attribute. While you *can* make a matrix of lists, that is not supported in zoo or xts. Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com R/Finance 2012: Applied Finance with R www.RinFinance.com On Sun, Mar 4, 2012 at

Re: [R] Wrong output due to what I think might be a data type issue (zoo read in problem)

2012-03-20 Thread Joshua Ulrich
l', got 'M'" > > What is "M"? Is that matrix? Any clarification of the issue and solution is There is an "M" in your data at line 9954: 1/3/2012 9:53 48 1/3/2012 10:53 M 1/3/2012 11:53 51 > appreciated. I apologize in advance for any noob mistake

Re: [R] Weird POSIXct behaviour

2012-03-25 Thread Joshua Ulrich
t; class(Time) > [1] "POSIXct" "POSIXt" > > Browse[2]> class(index(DATA.ba[[p]]["2012-03-20 00:59:57","bid"])) > [1] "POSIXct" "POSIXt" > > So the variable 'Time' should be good to index DATA.ba[[p]].  I am > hopeles

Re: [R] Weird POSIXct behaviour

2012-03-25 Thread Joshua Ulrich
asing the objects in and out of matrices and vectors. > No need for it to be huge. dput(DATA.ba[[p]]["2012-03-20 00:59:57","bid"]) would be a sufficient start. > Using R version  2.12.1 > > The zoo documentation (?zoo) does not include a version.  Where can I find &

Re: [R] Weird POSIXct behaviour

2012-03-29 Thread Joshua Ulrich
On Thu, Mar 29, 2012 at 3:56 PM, Worik R wrote: > I have a reproducible example of my problem below > > On Mon, Mar 26, 2012 at 9:22 AM, Joshua Ulrich > wrote: >> >> > Given two identical string representations of POSIXct objects, can the >> > two &g

Re: [R] newbie question: strategy

2012-04-07 Thread Joshua Ulrich
mpt > assistance. > > I would be happy to help you with your project at my regular consulting rate. Best, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com R/Finance 2012: Applied Finance with R www.RinFinance.com [[alternative HTML version deleted]] __

Re: [R] R problem: unable to read data in the xls-format in the PerformAnalytics package

2012-01-11 Thread Joshua Ulrich
> Please provide a reproducible example (your file was not attached). Use dput() to include a _small_ sample of your data. My guess is that Excel is not saving the dates to the CSV in a standard date format. > Apparently, I do not understand exactly how

Re: [R] plotOHLC(alpha3): Error in plotOHLC(alpha3) : x is not a open/high/low/close time series

2012-01-11 Thread Joshua Ulrich
. > > It seems everything works adequately until I try the plotOHLC function > itself, which gives me the error in the subject line. > > I would ask for two things: > 1) what the fix is to get rid of that error plotOHLC gives me > 2) some tips on the 'walk-forward' method I am looking at

Re: [R] plotOHLC(alpha3): Error in plotOHLC(alpha3) : x is not a open/high/low/close time series

2012-01-11 Thread Joshua Ulrich
rtSeries(to.minutes3(z, OHLC=TRUE)). I'm not familiar with the charting capabilities in the tseries package, but those in quantmod are quite extensive. See also www.quantmod.com. > Thanks again, > > Ted > Best, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com ___

Re: [R] the significance of BEKK estimation

2012-01-25 Thread Joshua Ulrich
I bet you're using an incompatible version of R. It will probably work if you build from source, which is also provided on the site. > Greetings. > > Carlos > Best, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com > -- > View this message in context: > http

Re: [R] wilderSum

2012-02-08 Thread Joshua Ulrich
HTH, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Wed, Feb 8, 2012 at 3:50 AM, yuanwei wrote: > Hi  Joshua, > >    Before I found your post here, I have viewed your source code for > 'wilderSum'<http://cran.r-project.org/src/contrib/TTR_0.21-0.tar.gz> to >

Re: [R] Control number of assets in resulting portfolio with optimizations using package fPortfolio

2012-02-17 Thread Joshua Ulrich
Alex, You may find an answer to your question by searching the R-SIG-Finance archives (via rseek.org). If not, you may want to consider asking your question on the R-SIG-Finance list. Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com R/Finance 2012: Applied Finance with R

Re: [R] Divide tick-data into intervalls

2012-05-08 Thread Joshua Ulrich
SIXct(paste(d$V1, d$V2))) to.minutes3(x) Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com R/Finance 2012: Applied Finance with R www.RinFinance.com On Tue, May 8, 2012 at 3:14 AM, oswi3605 wrote: > > Hello, > > Im currently writing my bachelor thesis in statistical finance and i

Re: [R] Quantmod, Xts, TTR and Postgresql

2012-05-22 Thread Joshua Ulrich
sn't, then using the default value of n = 252 may also be an issue (giving misleading results, if not an error). > But if I do this (fetch the data from yahoo): > > getSymbols("SDL.AX") > dvi <- DVI(Cl(SDL.AX)) > print(dvi) > > All seems to work fine, but I c

Re: [R] Quantmod, Xts, TTR and Postgresql

2012-05-22 Thread Joshua Ulrich
all out of whack, My guess was it > was the date format that postgres returns (being mm/dd/) but no luck, > any ideas? > See above. If my assumptions aren't correct, then please provide a small sample of the result from dbGetQuery. > Thanks! > Max > >  

Re: [R] Converting to XTS loses data.frame structure

2012-05-29 Thread Joshua Ulrich
rame so > that all the data are the correct type?? > You can't. xts/zoo objects are a matrix with an index attribute. Since you can't mix types in a matrix, you can't mix types in an xts/zoo object. That said, part of the xts Google Summer of Code project is to create an xts-lik

<    1   2