Trabajo finalizado
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Tarea técnica
Mean Reversion System
Main Idea:
The main idea is to trade on the cross between a symbol and its mirror image (invert correlation). The system uses mean reversion which at the time of crossing the price reverts to the mean.
· *Yellow line is the real price.
· *Green line is the mirror price.
For all timeframes, for all symbols.
Indicators Used:
· Main Signal: MT4Correlation – This is used to make a mirror image of the symbol on the same chart
· Secondary Signal: Moving Average
· Secondary Signal: Heiken Ashi
Methodology:
· IF Main Signal: MT4Correlation price crosses the mirror price the system will check for the below secondary signals if they are enabled (true) on the inputs. If the price crosses from below it’s a BUY signal if it crosses from above a SELL signal.
· Moving Average If the MA line is below the price it’s a BUY signal if the MA line is above the price its a SELL signal.
· Heiken Ashi If its enabled in inputs, it’s another secondary signal that shows a BUY signal or SELL Signal.
Example:
Above we have GBPUSD price indicated as Heiken Ashi candles with the mirror price (MT4Correlation) indicator.
· On the blue circle the price crossed. The price was coming from below going up and that means a BUY signal on the main signal.
· The third signal is the Moving Average which is in the correct positions – below the price – BUY sigbal
· The fourth signal is the Heiken Ashi candles which as you can see its already a BUY signal.
· All signals signify a BUY.
· The EA should either trade on market or enter a Limit order (Buy Limit) depending on the distance indicated in inputs.
Inputs:
· extern string Section1 = "============== Basic Settings ===============";
· extern double LotFixed = 0.1;
· extern bool AutoLot = false;
· extern double LotPercent = 2.0;
· extern int SL = 0;
· extern int TP = 0;
· extern int MaximumTrades = 1;
· extern int Expiration = 5; <--- Number of candlesticks (default: 5) that the order will expire – If the Orders = true below
· extern bool Orders = true;
· extern int OrderAwayFromPrice = 5; ß This option will put an order, instead of a market trade at specified points. As default its 5 which means 5 pips away from the price.
· extern bool Trade_With_Mirror_Signal = true;
· extern string Section2 = "=============== Trailing Stop ================";
· extern bool TrailingStop = false;
· extern int TrailDist = 5;
· extern int TrailStep = 5;
· extern bool TrailAfterProfit = false;
· extern bool Virtual_Trailing = false;
· extern string Section3 = "============== Moving Average Signal ===============";
· extern bool MA_Signal = true;
· extern int MA_Period = 13;
· extern int MA_Shift = 0;
· extern int MA_Method = MODE_EMA;
· extern string Section3 = "============== Heiken Ashi Signal ===============";
· extern bool HA_Signal = true;
· extern string Section4 = "============== Alerts ===============";
· extern bool Show_Alert = false;
· extern bool Play_Sound = false;