Sunday, February 20, 2011

R Project and R For MT4 mt4R.dll will give you the ability to start the R engine and call R functions directly from your MQL4 scripts, indicators and EAs. Its a thin wrapper/frontend around Rterm.exe with an easy and intuitive MQL4 API. All you need is a working installation of R ( on your trading PC and the two files (mt4R.dll and mt4R.mqh) installed in their appropriate MT4 folders.

There is documentation inside mt4R.mqh that should get you started without problems, the idea is quite simple, if you already know R you will intuitively understand what you can do with this library. Please read it before you ask any questions. The API reference is also available for browsing it online. Finally also the code of Trend-O-Mat and Arb-O-Mat may serve as an example how this API is meant to be used. 

Introduction to R

R is a language and environment for statistical computing and graphics. It is a GNU project which is similar to the S language and environment which was developed at Bell Laboratories (formerly AT&T, now Lucent Technologies) by John Chambers and colleagues. R can be considered as a different implementation of S. There are some important differences, but much code written for S runs unaltered under R.
R provides a wide variety of statistical (linear and nonlinear modelling, classical statistical tests, time-series analysis, classification, clustering, ...) and graphical techniques, and is highly extensible. The S language is often the vehicle of choice for research in statistical methodology, and R provides an Open Source route to participation in that activity.
One of R's strengths is the ease with which well-designed publication-quality plots can be produced, including mathematical symbols and formulae where needed. Great care has been taken over the defaults for the minor design choices in graphics, but the user retains full control.
R is available as Free Software under the terms of the Free Software Foundation's GNU General Public License in source code form. It compiles and runs on a wide variety of UNIX platforms and similar systems (including FreeBSD and Linux), Windows and MacOS.