Tag Archives: potential

Video of R, RCPP, RInside makes use of C++ so much easier than Matlab Builder NE for high frequency trading aka HFT potential

Video of R, RCPP, RInside makes use of C++ so much easier than Matlab Builder NE for high frequency trading aka HFT potential

So I am going from trying out an open source C# application trading platform to an open source C++ ‘platform’ using Interactive Brokers. I also switched from Matlab to R. Lastly; I am looking at more open source projects including Linux where Ubuntu is becoming my preferred distribution. As you can tell, I am straying away from expensive options like Matlab. Being a developer, I can quickly debug most applications if need be.

The benefit I am finding switching to R as compared to using Matlab with something like Matlab’s Builder JA (for Java) or Builder NE (for .NET languages like C#) toolboxes. When I tried out the combination of R packages RCpp and RInside, I was pleasantly surprised for a number of things. Installing any R package is quite easy. Building or ‘making’ the provided C++ examples for RInside was flawless and easy to execute. The most impressive were samples of parallelization of C++ which was jaw dropping.

Now I am hoping I can see my newer open source C++ trading solution Trading Shim (http://www.tradingshim.org/) will work at some point as well.   Hey…it is C++ so leave it alone. But the speed and scalability of it should be impressive. I just wish there was a complete open source trading platform in Java that could connect to my chosen broker Interactive Brokers.

Anyhow, back to the R packages of RCpp and Rinside. I need to give a shout out to the contributors for making these packages happen in a quick and easy way. The provided C++ examples really do make a difference to showcase how a C++ application can call the R shell processor and execute individual R functions directly. You could not do that with the Matlab NE Builder as you could only call M scripts with their archaic programming structure. The C++ code within RInside as compared to Matlab NE is much simpler, tighter, and smaller. The Matlab NE Builder is really meant for C# so trying it in Visual C++ would have been ‘interesting.’ I am just glad I found this deadly combination of R, RCpp/Rinside, with C++. It may work well for my hopeful high frequency trading platform with R for prototyping and analytics.

[youtube_sc url=”http://www.youtube.com/watch?v=wIzrJFy-VCA” playlist=”Calling R from a C application for HFT development with MPI parallelzation ” title=”Calling%20R%20from%20a%20C%20application%20for%20HFT%20development%20with%20MPI%20parallelzation%20″]

The mother load of R packages for financial trading, quant, and potential high frequency trading (HFT) needs

The mother load of R packages for financial trading, quant, and potential high frequency trading (HFT) needs

So there seems to be this endless supply of what look to be a decent list of R finance packages. Some of these include quant based ones. This is my first day researching so I cannot vouch for any of these yet. I do know some R packages can be duds but I am not sure if these ones will be either but are part of CRAN which says positive things. Here we go:

Extreme value analysis:

http://cran.r-project.org/web/packages/evir/evir.pdf

Refer to p 39 for parameter use in Gvt:

http://www.stat.colostate.edu/graybillconference2009/Workshop%20Files/ShortCourseGraybill.pdf

 

 

Potential fat tail analysis which lead to the ones below:

http://braverock.com/brian/R/PerformanceAnalytics/html/Return.Geltner.html

PerformanceAnalytics package is quite amazing and easy to use for the amount of analysis it has: i.e. VaR

http://r.789695.n4.nabble.com/Value-at-risk-td3516991.html

Overview and demo of PerformanceAnalytics (PA):

http://cran.r-project.org/web/packages/PerformanceAnalytics/vignettes/PerformanceAnalyticsChartsPresentation-Meielisalp-2007.pdf

http://www.rinfinance.com/RinFinance2009/presentations/PA%20Workshop%20Chi%20RFinance%202009-04.pdf

How read profitable data and convert to PA package

http://quant.stackexchange.com/questions/1536/use-trades-as-input-for-performanceanalytics

How to back test strategies with PA:

http://blog.fosstrading.com/2011/03/how-to-backtest-strategy-in-r.html

A technical package:

http://cran.r-project.org/web/packages/TTR/index.html

TradeAnalytics packages which includes quantstrat:

 

 

http://cran.r-project.org/web/packages/TTR/index.html

Intro to quantstrat:

http://blog.fosstrading.com/2011/08/introduction-to-quantstrat.html

General list of R packages for quant trading:

http://blog.fosstrading.com/2011/08/introduction-to-quantstrat.html

The motherload of all financial trading packages in CRAN:

http://cran.wustl.edu/web/views/Finance.html

I feel like a kid a candy factory with all this. Makes me wonder how Matlab is going to keep up. Wow! Thanks to all contributors above for all these. Now I have to start digging and play with everything. I will also keep reporting through this blog for those interested.