The short answer is yes, pretty easily with Rcpp, or Rinside, or (more difficult) writing an R Extension. But I think your question is misspecified. Languages like R, Matlab, or even Python are best for prototyping, testing ideas, or exploratory data analysis. MQL, on the other hand, is mostly designed for real-time trading and the analysis that supports it. In the eigen-decompostion example cited above, R is fine for testing and developing your pairs-trading/statarb ideas, but not suitable for realtime implementation. For actual trading in MQL you'd want to write your own routines in C and put them in a dll or shared library (so). The pertinent routines in R are not made for incremental, realtime updating, may return eigenvectors with arbitrary and inconsistent sign (inconsistent with the last set one tick ago), and some routines may return them in row-major order vs the more standard col major order. After prototyping, coding your R/Matlab/Python models in a real-time language is almost de rigueur.