Monthly Archives: August 2012

Is the smartest way to parallelize this ARIMA function within R? Only for Windows? Use quantstart and backtest R packages?

Is the smartest way to parallelize this ARIMA function within R? Only for Windows? Use quantstart and backtest R packages?

This came from https://stat.ethz.ch/pipermail/r-sig-finance/2011q2/008143.html

I don’t think this is the most intelligent way to parallelize this. Comment on what you think!

 

The easiest probably would be to use the multicore package (linux) on
one machine, but if you’re feeling ambitious, there’s also the
possibility of using doSNOW, but there’s some small idosyncracies that
will leave you (or at least it did for me) pulling your hair out trying
to figure out why certain things aren’t working.

If you’re on Windows only, another single box solution would be the
“doSMP” and “foreach” packages that were released by Revolution into CRAN.

here’s a short example of how I use it on Windows (I have a more
complicated multiple computer script buried somewhere using doSNOW on
linux32):

require(doSMP)
require(foreach)

clust <- startWorkers(4)
registerDoSMP(clust)

symbols = c(“SPX”,”DIA”,”QQQQ”)

# the function that you want to parallelize, gets exported to each
“node” — could insert your backtest code here
parallel.arima <- function(data) {
library(forecast)
library(quantmod)
tmp = get(data)
fit = auto.arima(ts(Cl(tmp)), approximation=TRUE, allowdrift=TRUE,
stepwise=TRUE)
}

res <- foreach(dat=symbols, .export=symbols) %dopar% parallel.arima(dat))

There’s more info on the r-sig-hpc list regarding some of the finer
details of the packages mentioned above. Standard disclaimer, this
probably isn’t the “best” way to do it but it should give you some idea
of where to start.

HTH,
C

On 06/24/2011 07:00 AM, benjamin sigel wrote:
> Hi, > > I would like to run multiple backtests with R on intraday data, using > “quantstrat” and “backtest package” and I was wondering what would be the > most time efficient hardware solution between these two: > > – 1 PC: *1 Quad-Core* (Intel® Core™ i5-2300, 2.8 GHz (up to 3.1 GHz with > Turbo Boost) /6GB installed DDR3 RAM (1066 MHz) + *16GB maximum RAM capacity > * > > OR > > – *2 PC’s Hooked-up:* 2 Dual-core (Intel® Core™ i3-550 Processor, 3.20 GHz, > 4 MB Smart Cache, 4GB DDR3 + *maximum expandable memory 16GB* *each* > > Many Thanks for your help, > > Ben

Here is an R package to interface R and IQFeed together for market data and tick feed

Here is an R package to interface R and IQFeed together for market data and tick feed

https://github.com/bwlewis/iqfeed

I will try this out with a potential review.

NOTE: This appears it does not run. There is an Python version ut I gave up as I don’t know it

https://github.com/sobotklp/pyqfeed/blob/master/setup.py

daily <- HDX("XOM",days=3)
Warning message:
In doTryCatch(return(expr), name, parentenv, handler) :
  could not find function "xts"
> fix(daily)
Error in file(filename, "r") : cannot open the connection
In addition: Warning message:
In file(filename, "r") :
  cannot open file 'C:UserscausticAppDataLocalTempRtmp0wKFX8Redit1af0306278cd': No such file or directory
Error in edit(name, file, title, editor) : expression parsing error

To get running, you could follow the instructions in the README but to get working, download the iqfeed. Run the following script:

## If you want to source() a bunch of files, something like
> ## the following may be useful:
> sourceDir <- function(path, trace = TRUE, ...) {
+   for (nm in list.files(path, pattern = "\.[RrSsQq]$")) {
+     if(trace) cat(nm,":")
+     source(file.path(path, nm), ...)
+     if(trace) cat("n")
+   }
+ }
> sourceDir("C:\Users\caustic\Documents\R\bwlewis-iqfeed-27273bc\bwlewis-iqfeed-27273bc\R")

R and Java bridge demo with Youtube posted with Eclispe Juno IDE project consisting of Java source code

 

R and Java bridge demo with Youtube posted with Eclispe Juno IDE project consisting of Java source code

Hey

I have now posted an extended demo video of how to bridge Java and R together with this neat open source package.

Get details and video here:

quantlabs.net/blog/2012/08/using-rcaller-to-bridge-r-and-java-together-easily-and-flawlessly/

Get the Eclipse project with Java source code here:

 

R Intro Files Are Available at Meetup

R Intro Files Are Available at Meetup

From a member at my Meetup at:

Thanks for the great broadcasts last night. I learned plenty about the HFT environments and the R programming language. As I received your email, about the downloaded information to the Files section of R Matlab Users, I did not notice anything available. I did log in, and was wondering if I may have missed something.

http://www.meetup.com/R-Matlab-Users/files/

From Meetup.com: Free R Introduction scripts and Powerpoint slides now posted

From Meetup.com: Free R Introduction scripts and Powerpoint slides now posted

From Meetup.com: Free R Introduction scripts and Powerpoint slides now posted

Ram had uploaded  his R files and Powerpoint slide. Goto:

http://www.meetup.com/R-Matlab-Users/files/

Details on this Meetup for those that missed it:

  • Online meetup through GotoMeeting. May have limit so sign up early to guage interest.

Intro to R with topics on:
R environment and installation
R packages and sample data sets
R objects and classes
Data input and cleaning
Graphic power and statistical computing
Quantmod and other important packages
Books and tutorials
Ram’s Bio:

” I am a software professional with 3 decades of experience. I hold a Masters degree in industrial engineering from Indian Institute of Technology, Chennai, India. with Dawn Analytics i focus on software development and consultancy with R, Python and Hadoop.”

 

Tonite’s Goto Meeting webinar details on R Intro 7pm

Hi All
I will be posting login details towards 7pm tonite to login. Remember there will be limited slots so everything will be on a first come first basis.

These details will be posted either at:

http://www.meetup.com/R-Matlab-Users/events/75562422/

http://www.meetup.com/quant-finance/events/75560792/
Thanks.

 

Goto Meeting webinar details on R Intro 7pm

The R Intro presentation is coming this Monday at 7PM EST!

The R Intro presentation is coming this Monday at 7PM EST!

Monday Aug 13 is coming up for one of the most anticipated Meetups I have hosted. This is where a local member ,Ram Venkat, will be doing an intro of R. This will be geared towards those wanting to learn this powerful statistical programming language.

GotoMeeting login details will be posted both at:

http://www.meetup.com/R-Matlab-Users/events/75562422/

http://www.meetup.com/quant-finance/events/75560792/

This will be towards the time of the presentation (at 7PM EST) so keep your eyes peeled at these locations.

It will be a free for all meaning first come first served with our limited slots.

Thanks for your interest in this.

Coming August 13th: the R webinar you’ve been waiting for!

Hi there,

Just days from now I’m hosting new webinar that’s free to all meet-up members and Quantlabs.net Premium members.

It’s all happening on August 13 at 7 PM Eastern Standard Time.

Mark that on your calendars right now! Because Ram Venkat — one of my valued members — is giving a brief introduction to the R programming language in the R environment. This course will include:

* topics covering key points about the language itself
* exactly which R packages you need for financial modeling, and
* what books and online video resources are worth it

As a quant trader, you couldn’t ask for anything better for learning about R and understanding the importance of model development. All of which leads to profitable trading strategies, of course!

August 13 at 7 PM Eastern Standard Time. Join now to reserve your spot today:

http://www.meetup.com/R-Matlab-Users/events/75562422/

I’ve saved probably well over $100,000 by not using Matlab’s Parallel Computing toolbox with a set of workers in which the licensing fees would have financially killed me.

R integrated with an open-source NoSQL database does the same thing. For free!

So get a massive leg up on the competition at no extra charge. A seat at this webinar (and all the others I’ve planned) is part of the standard Premium membership fee. Become part of the Quantlabs.net community today:

http://www.meetup.com/R-Matlab-Users/events/75562422/

Once you’re a member, you lock in the current low rate for as long as you remain part of the club.

Good trading,
Bryan
Quantlabs.net Editor
“Those that know, don’t tell. Until now.”

P.S. Ram will answer your questions about R during the presentation. Tap into his extensive R knowledge as well as further programming ideas/concepts on your mind.

Even if you’re an experienced developer, you’re going to learn something useful!
http://www.meetup.com/R-Matlab-Users/events/75562422/

Get a tour of the entire membership here:

http://quantlabs.net/blog/2012/07/how-to-get-introduced-to-our-quant-membership-with-a-welcome-tour-video-and-model-and-software-solution-sections/

FREE WEBINAR MEETUP: Intro to R by Ram Venkat

FREE WEBINAR MEETUP: Intro to R by Ram Venkat

This a reminder for Premium members about this webinar. If you are wanting to be introduced to R for free, this is the time to do it. Details follow. Meetup takes place:

 

Monday, August 13, 2012 at 7PM EST

Online meetup through GotoMeeting. May have limit so sign up early to guage interest.

Intro to R with topics on:
R environment and installation
R packages and sample data sets
R objects and classes
Data input and cleaning
Graphic power and statistical computing
Quantmod and other important packages
Books and tutorials

Ram’s Bio:

” I am a software professional with 3 decades of experience. I hold a Masters degree in industrial engineering from Indian Institute of Technology, Chennai, India. with Dawn Analytics i focus on software development and consultancy with R, Python and Hadoop.”

Get registered now at: http://www.meetup.com/quant-finance/events/75560792/

Bryan

Question and Answer to Anyone know R, RStudio, RBG package, or RBloomberg package to help out

Question and Answer to  Anyone know R, RStudio, RBG package, or RBloomberg package to help out

> Hey Bryan,
>
> I ran into a similar situation in my learning curve with R and
> installing some quant finance-specific packages. R-Forge often has
> issues building packages (for one reason or
> another), so that’s why they’re “not available”. That said, you can
> check out the source yourself (using subversion) and build with R CMD
> build and R CMD INSTALL.
>
> I’m on a mac, so in Terminal I modified the following code:
> https://gist.github.com/1861292
>
> Hope that helps!

This was from Jonnie L so thanks to him!

 

 

A nsw
Hey Bryan,

I ran into a similar situation in my learning curve with R and installing some quant finance-specific packages. R-Forge often has issues building packages (for one reason or
another), so that's why they're "not available". That said, you can check out the source yourself (using subversion) and build with R CMD build and R CMD INSTALL.

I'm on a mac, so in Terminal I modified the following code:
https://gist.github.com/1861292

Hope that helps!