Download This R Autoregression MT4 Indicator FREE - Forex Robot 2.0 (2024)

In the last post we showed you how you can connect the powerful R software with MT4. If you haven’t read the post on how to connect R with MT4, you should read it now before you continue reading this post. In this post how to connect R with MT4 I have explained how difficult it was to connect R with MT4 and how it was done. As said in that post R is a powerful data analysis and machine learning software that is available FREE. We will be using R more and more in the coming posts to develop powerful machine learning MT4 indicators. You should first download this software and install it on your computer.

What Is Autoregression?

Time series have this general property that past values are auto correlated This can be judged by drawing the Correlogram of a time series. A correlogram is a plot of the auto correlation of the different past values with one another. What this means in simple terms is that past values have important information about the future values. One way of extracting that information is by regressing the present value of a time series with it’s past values. This is known as Autoregression. Autoregression also known as Autoregressive Modelling (AR).

AR modelling is a forecasting tool for predicting the short term future values of a time series. We can fit a moving average model to a time series. ARIMA is a model that fits an autogressive and a moving average model. ARIMA means Autoregressive Integrated Moving Average. If you are feeling confused you can watch the video below that explains these terms! But you don’t need to know how to do time series analysis in too much depth. R Indicator is going to do everything for you. You should however have some rudimentary understanding so that you know what you can achieve and what you cannot achieve when you use the time series analysis.

As said above autoregression is based on the idea that the past values of a time series can be used to predict the future values. This is precisely the premise on which Technical Analysis is based. When we look at the chart we are looking for patterns that can predict the future price action. If the above autoregression indicator confirms your technical analysis, it will help you reduce your losing trades. You can use this R indicator as a filter to reduce your losing trades.

MQL4 language has severe limitations. It does not have libraries that can implement different statistical algorithms. However by connecting R with MT4, we can overcome that limitation. When we connect R we can use its powerful data analysis and machine learning algorithms in analyzing the currency pair time series and then use the predictions in real time in our trading. This is precisely what we want.

How To Install Autoregression R MT4 Indicator?

In this post we give you the code for a R indicator that fits an autogressive model to the closing price of the currency pair time series. First you need to download R software from the R-Project site. Install it on your computer. Then you need to download these files:

MT4R.DLL

MT4R.MQH

COMMON_FUNCTIONS.MQH

The following infographic explains step by step how to install this Autoregression R MT4 indicator.

Download This R Autoregression MT4 Indicator FREE - Forex Robot 2.0 (1)

Now as shown in the above infographic, first you will copy the following code in a notepad text file and save it as R-Indicator.mq4 file. I want to make it clear that without installing R software, this indicator is not going to work. R is a powerful data analysis and machine learning software that you can download free. In the above infographic you can copy the link from where you can download this R software. After downloading it, you should install it on your computer.

In the code you can see a bold line. In the comment above I have explained that you need to change the path of the R software as has been made bold. The path can be C drive just like that in the code or it can be E, D or whatever drive you install the R software on your computer. You will also change the R version if it is different than that shown in the code. You can do that in the text file and then save it as an mq4 file. You can open it in MetaEditor and then make the change and compile the code. It is upto you. It is not difficult. Once you have the R-Indicator.mq4 in the Indicator folder you are all set now. Just open MT4 and double click on R-Indicator name and you will see the indicator on chart.

//+——————————————————————+
//| R-Indicator.mq4 |
//| Copyright 2010, Bernd Kreuss |
//| https://www.doubledoji.com |
//+——————————————————————+
#property copyright “Copyright 2010, Bernd Kreuss”
#property link “https://www.doubledoji.com”
#property version “1.00”
#property strict
#property indicator_chart_window

#property indicator_buffers 1
#property indicator_color1 Red
#property indicator_width1 2

#include <mt4R.mqh>

extern int order = 200;
extern int back = 500;
extern int ahead = 20;

int R;
double buf_prediction[];

int init(){
SetIndexBuffer(0, buf_prediction);
SetIndexStyle(0, DRAW_LINE);
SetIndexShift(0, ahead);

//–You should change the following bold path in your MQL4 file according to your hard drive and R version

R = RInit(“C:/Program Files/R/R-3.2.5/bin/x64/Rterm.exe –no-save”, 2);
Comment(“history: ” + (string)back + ” bars, method: OLS, order: ” + (string)order);
return(0);
}

int deinit(){
RDeinit(R);

return(0);
}

int start(){
double hist[];
double pred[];
int i;

if (RIsBusy(R))
{
// last RExecuteAsync() is still not finished, do nothing.

return(0);
}

if(RGetInteger(R, “as.integer(exists(‘model’))”) == 1)
{
// there exists a model (the variable is set).
// This means a previously started RExecuteAsync() has finished.
// we can now predict from this model and plot it.
RAssignInteger(R, “ahead”, ahead);
RExecute(R, “pred <- predict(model, n.ahead=ahead)$pred”);
ArrayResize(pred, ahead);
RGetVector(R, “rev(pred)”, pred, ahead);
for (i=0; i<ahead; i++){
buf_prediction[i] = pred[i];
}
}

// make a (new) prediction
// move some history over to R
ArrayResize(hist, back);
for (i=0; i<back; i++){
hist[i] = Close[i];
}
RAssignVector(R, “hist”, hist, ArraySize(hist));
RExecute(R, “hist <- rev(hist)”);

// crunch the numbers in the background and return from the start() function
// RIsBusy() in the next ticks will tell us when it is finished.
RAssignInteger(R, “ord”, order);
RExecuteAsync(R, “model <- ar(hist, aic=FALSE, order=ord, method=’ols’)”);
return(0);
}

Now you can use this Autoregression R MT4 indicator. You can see in the screenshot below that this indicator predicts price action in the future. This is a great help when you trade. In the screenshot you can see price action has been predicted to go up and then drop. When you see that price is going up, a long trade will be appropriate.

Download This R Autoregression MT4 Indicator FREE - Forex Robot 2.0 (2)

Download This R Autoregression MT4 Indicator FREE - Forex Robot 2.0 (2024)

FAQs

How do I download MT4 indicators? ›

Guide on Installing Indicators on MT4 or MT5
  1. Click on File > Open Data Folder.
  2. Open MQL4 > Indicators.
  3. Copy the Indicator file into the Indicators folder. You may drag and drop the file or manually do CTRL+C, CTRL+V.
  4. Close the folder and then restart MT4 (close and then reopen MT4).

What is the best free robot for forex auto trading? ›

Best Forex Trading Bots for 2024
  • ✨ Forex Fury – Best Trading Robot for MT4.
  • ✨ 1000pip Climber System – Best Forex Robot for Beginners.
  • ✨ EA Builder – Best Expert Advisor for MT5.
  • ✨ AutomatedForextools .com - All Forex Robots are 60% off.
  • ✨ GPS Forex Robot – One of the Best AI Forex Trading Bots.
Feb 21, 2024

How to install EA robot on MT4? ›

Launch your MT4 platform. Look for the Expert Advisors section under the Navigator panel at the left side of the platform. Click on the Plus sign and the available EAs should be listed there. Click on the EA you want to install and drag it onto one of the charts on your platform.

What is best EA robot for MT4? ›

Forex Diamond EA
EAFeaturesRequired Initial Deposit
Calypso EAreal-time quotes and analysis of the market – Uses Calypso strategy$1,000
Learn2Trade EAHighest-rated EA on TrustPilot$1,000
Forex Fury EAUser-friendly – 100% money-back guarantee$2,000
FXCipherBuilt-in risk management features$295
14 more rows
Feb 19, 2024

Where is MT4 indicator file? ›

Navigate to “File” in the upper left hand corner and then select "Open Data Folder" From there navigate to the folder called "MQL4" From there navigate to the folder called "Indicators"

Which forex robot is the most profitable? ›

FAP Turbo. FAP Turbo is one of the oldest and most well-known forex robots in the market. It uses a scalping strategy and claims to have a success rate of over 95%. It also has built-in risk management features such as stop-loss and take-profit orders.

Are forex robots worth it? ›

The short answer is: it depends. There is no guarantee that any forex trading robot will work, and there are many factors that can affect the performance of a robot. However, there are some robots that have been shown to be profitable over the long term.

Do free forex robots work? ›

A lot are advertised with false claims by people who have made serious money applying these systems. The truth, however, is that a great number of investors and traders have lost a lot of money using so-called 'free' Forex bots that work. There have even been circ*mstances in which whole accounts have been wiped out.

Are there any forex robots that work on the MT4 app? ›

GPS Forex Robot

Technical indicators and price action analysis. Low-risk trading strategy. Compatible with both MT4 and MT5 platforms. User-friendly interface for easy setup and customization.

How do I install forex robot on my phone? ›

How to Install a Trading Robot on MT5 Android
  1. Download and install the MT5 app from the Google Play Store.
  2. Launch the MT5 app and log in to your trading account.
  3. Tap on the Market tab at the bottom of the screen.
  4. Browse the available forex robots and indicators.
Nov 6, 2023

Which broker is best for robot trading? ›

AvaTrade incorporates the MT4 and MT5 platforms that have long been considered the go-to for automated trading. Both are available to use Expert Advisors and run automated strategies. The broker also offers algo trading plugins for copy trading via DupliTrade and the AvaSocial app.

What is the best strategy for forex robots? ›

Common Forex Robot Strategies:
  • Parabolic SAR Strategy: - This strategy relies on the points of the Parabolic SAR to detect changes in market direction and determine entry and exit points.
  • Moving Average Strategy: ...
  • Breakout Strategy:
Dec 20, 2023

How do I add custom indicators to MT4 IOS? ›

You can't add custom indicators on the mobile version of MT4.

Top Articles
Latest Posts
Article information

Author: Pres. Lawanda Wiegand

Last Updated:

Views: 6456

Rating: 4 / 5 (51 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Pres. Lawanda Wiegand

Birthday: 1993-01-10

Address: Suite 391 6963 Ullrich Shore, Bellefort, WI 01350-7893

Phone: +6806610432415

Job: Dynamic Manufacturing Assistant

Hobby: amateur radio, Taekwondo, Wood carving, Parkour, Skateboarding, Running, Rafting

Introduction: My name is Pres. Lawanda Wiegand, I am a inquisitive, helpful, glamorous, cheerful, open, clever, innocent person who loves writing and wants to share my knowledge and understanding with you.