Discussing the article: "Algorithmic Trading With MetaTrader 5 And R For Beginners"

 

Check out the new article: Algorithmic Trading With MetaTrader 5 And R For Beginners.

Embark on a compelling exploration where financial analysis meets algorithmic trading as we unravel the art of seamlessly uniting R and MetaTrader 5. This article is your guide to bridging the realms of analytical finesse in R with the formidable trading capabilities of MetaTrader 5.

MetaTrader stands as a globally acclaimed pinnacle in the realm of trading platforms. Renowned for its industry-grade quality, this software is provided at no cost, rendering it accessible to a broad spectrum of users. Consequently, the MetaTrader community has witnessed a steady growth year by year. The community, now more diverse than ever in its history, comprises individuals from varied cultural backgrounds and possessing distinct proficiencies in programming languages. Noteworthy is the fact that, alongside MetaQuotes Language 5 (the official language of the platform), Python stands as the sole programming language with full support within the MetaTrader platform.

For community members transitioning from R, irrespective of their background in Academia or Scientific Computation, the MetaQuotes community welcomes you with open arms. Despite the advancements in Python, and the exclusive integration of Python as the only other fully supported language within the MetaTrader terminal, individuals proficient in R need not perceive their programming skills as obsolete. This article challenges any notion suggesting obsolescence by illustrating that, with the application of creativity and a little ingenuity, it remains entirely feasible to construct a comprehensive algorithmic trading advisor using R and MetaTrader 5.


It is imperative to note, based on the author's experience, that the packages discussed in this article exhibit imperfect interactions when employed individually within the MetaTrader 5 Terminal. Each package presents its distinctive limitations. However, when employed in unison, these packages effectively compensate for one another's shortcomings, collectively forming a robust framework conducive to the development of trading algorithms using R and MetaTrader.

Author: Gamuchirai Zororo Ndawana

 

Wow , thanks for posting this , Looking forward to getting this going, thanks for the clear instructions and the video is very helpful too. Ran out of time for today .

When installing R devtools is a dependency of RStudio so if you comment that out (#install.packages("devtools")) and after restarting r it prompts to install that dependency then after it installs the code is working fine and loading mt5 for me and I can get the account info etc . now moving over to the MT5 but I am out of time . could you please add the include for socket-library-mt4-mt5.mqh  to the downloads  Looking forward to it Thanks again 

 
linfo2 #:

Wow , thanks for posting this , Looking forward to getting this going, thanks for the clear instructions and the video is very helpful too. Ran out of time for today .

When installing R devtools is a dependency of RStudio so if you comment that out (#install.packages("devtools")) and after restarting r it prompts to install that dependency then after it installs the code is working fine and loading mt5 for me and I can get the account info etc . now moving over to the MT5 but I am out of time . could you please add the include for socket-library-mt4-mt5.mqh  to the downloads  Looking forward to it Thanks again 

found socket-library-mt4-mt5.mqh  it here  Socket library for MT4 and MT5 - Other - 6 September 2017 - Traders' Blogs (mql5.com)

Socket library for MT4 and MT5
Socket library for MT4 and MT5
  • 2017.09.06
  • www.mql5.com
[Published as a blog entry because submission to the Codebase stalled on the fact that this socket library works with both MT4 and MT5, whereas the Codebase is divided into separate sections for MT4
 
linfo2 #:

Wow , thanks for posting this , Looking forward to getting this going, thanks for the clear instructions and the video is very helpful too. Ran out of time for today .

When installing R devtools is a dependency of RStudio so if you comment that out (#install.packages("devtools")) and after restarting r it prompts to install that dependency then after it installs the code is working fine and loading mt5 for me and I can get the account info etc . now moving over to the MT5 but I am out of time . could you please add the include for socket-library-mt4-mt5.mqh  to the downloads  Looking forward to it Thanks again 

This is why I deeply love open-source solutions, it is a catalyst for growth. Thank you, Linfo, for graciously sharing your insightful observations; your contributions have already enhanced this project for everyone. I encourage you to continue sharing any further improvements or perspectives you may have—it would be invaluable to receive your ongoing input. Thank you for pointing that out.
 
Gamuchirai Zororo Ndawana #:

Thanks for the introductory article!

But I really didn’t understand why it was necessary to complicate the code with Python and reticulate if all trading and position monitoring can be easily implemented with Kinzel/mt5R, everything is implemented there in ready-made functions.

 
mytarmailS #:

Thanks for the introductory article!

But I really didn’t understand why it was necessary to complicate the code with Python and reticulate if all trading and position monitoring can be easily implemented with Kinzel/mt5R, everything is implemented there in ready-made functions.

Reticulate and Python allows us to launch the MetaTrader 5 Terminal programmatically from our R script. 

If you can figure out a way to get that utility from the Kinzel/mt5R library that would be awesome, please share your observations.

 
Gamuchirai Zororo Ndawana #:

Reticulate and Python allows us to launch the MetaTrader 5 Terminal programmatically from our R script. 

If you can figure out a way to get that utility from the Kinzel/mt5R library that would be awesome, please share your observations.

you don't need Kinzel/mt5R library for this.

try to run this R code for run MT5 on windows

# run mt5
system("cmd.exe", input='"C:\\Program Files\\RoboForex - MetaTrader 5\\terminal64.exe"')


# shut down mt5
system("Taskkill /IM terminal64.exe /F")
 
mytarmailS #:

you don't need Kinzel/mt5R library for this.

try to run this R code for run MT5 on windows

Ahhh👏👏 you're calling the terminal and passing it command line instructions 🔥Nice thinking👌

From there we can do a lot, like schedule optimizations 
 
Gamuchirai Zororo Ndawana #:
Ahhh👏👏 you're calling the terminal and passing it command line instructions 🔥Nice thinking👌

From there we can do a lot, like schedule optimizations 

Use it!

As you can see, R is completely self-sufficient for trading in MT5 and does not need python for this

 
mytarmailS #:

Use it!

As you can see, R is completely self-sufficient for trading in MT5 and does not need python for this

I definitely will use that for all future articles with R, thank you for sharing.

If you have more constructive criticism or you spot something in the code that could be done more efficiently, don't hesitate to bring it up. You're already improving the algorithm a lot.
 
Gamuchirai Zororo Ndawana #:
I definitely will use that for all future articles with R, thank you for sharing.

If you have more constructive criticism or you spot something in the code that could be done more efficiently, don't hesitate to bring it up. You're already improving the algorithm a lot.
Ок )