Guarda come scaricare robot di trading gratuitamente
Ci trovi su Telegram!
Unisciti alla nostra fan page
Script interessante?
Pubblica il link!
lasciare che altri lo valutino
Ti è piaciuto lo script? Provalo nel Terminale MetaTrader 5
Sistemi Esperti

Diff_TF_MA_EA - sistema esperto per MetaTrader 5

Visualizzazioni:
3641
Valutazioni:
(15)
Pubblicato:
2018.03.01 11:53
Freelance MQL5 Hai bisogno di un robot o indicatore basato su questo codice? Ordinalo su Freelance Vai a Freelance

Expert Advisor signals are based on the common intersection of two MA lines. These are signals of the Diff_TF_MA indicator:

  • If the MA of the current timeframe crosses the MA line of the higher timeframe upwards, it is a signal to open a long position;
  • If the MA of the current timeframe crosses the MA line of the higher timeframe downwards, it is a signal to open a short position.

An appropriate position is opened on one signal. The opposite position is closed.

The Expert Advisor is designed for working on hedging accounts. If you launch the EA on a netting account, a warning message will pop up and the EA will be unloaded.

The indicator is not required for the EA operation, because calculations of required moving averages are implemented directly in the EA code.

The Expert Advisor can reverse indicator signals to open Sell instead of Buy and vice versa. You can also set stop loss and take profit in points. If invalid Stop Loss and Take Profit values are specified, the EA will adjust the values to the minimum StopLevel allowed for the symbol.

The Expert Advisor will also adjust the lot in case an incorrect value is specified. If the lot is too large, the EA will adjust it in order to be able to open a position. If there is no money for opening even the minimum lot, the signal will be skipped.

Please note that the Expert Advisor is designed for training purposes.

The EA has nine input parameters:

  • Experts magic number - a unique identifier for the EA's positions;
  • Period of MA - calculation period for the moving average of a higher timeframe (the calculation period of the current timeframe MA is selected automatically);
  • Timeframe of MA - the timeframe for the Moving Average of a higher TF;
  • Reverse trade - choosing the reverse mode (Yes, No): if Yes, a short position will open upon a long signal and vice versa;
  • Lots - the volume of positions to open;
  • Stop loss in points - the Stop Loss of a position in points;
  • Take profit in points - the Take Profit of a position in points;
  • Slippage of price - maximum allowable slippage when opening a position;
  • Multiplier spread for stops - spread multiplier for calculating a correct distance for stop orders.
For Stop Loss and Take Profit orders (as well as pending orders), there is a minimum allowed distance for placing such orders - StopLevel. I.e. Stop Loss and Take Profit (as well as pending orders) cannot be placed closer than this distance to the price. If StopLevel is zero, it does not mean its absence, it only means that StopLevel is floating. In this case, the minimum distance is usually equal to spread*, but sometimes even the double spread is not enough. So, this parameter allows specifying a custom multiplier for the spread used to calculate the minimum distance for placing stop orders.

To check the strategy, testing with default settings was performed using data in the interval from 2017.01.02 to 2018.01.19. Unfortunately, the EA did not show good results with default settings. Therefore, it was tested in the reverse mode. The results were better. Additionally, the Period of MA was optimized in the range from 1 to 20 with step 1. The best value when optimizing for the maximum balance was the period 8.

Fig.1 Testing result 2017.01.02 - 2018.01.19, period 8, reverse of trades is enabled

Fig.2 Testing chart on 2017.01.02 - 2018.01.19, period 8, reverse of trades is enabled

Tradotto dal russo da MetaQuotes Ltd.
Codice originale https://www.mql5.com/ru/code/19906

ZeroLagMACD ZeroLagMACD

ZeroLagMACD is an MACD version, which has a much smaller lag compared to the classic MACD.

ZeroLag ZeroLag

Zero Lag is a modified EMA.

Percentage_Crossover_Channel_EA Percentage_Crossover_Channel_EA

An Expert Advisor, which trades in a channel based on the Percentage_Crossover_Channel indicator.

NTK 07 NTK 07

Implementation of multiple trailing types. Pending Buy Stop and Sell Stop orders. Limitation of the maximum total lot and the total number of positions. Several types of position volume calculation.