Download MetaTrader 5

Watch how to download trading robots for free

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal

2017.01.26 09:07
Experts

Expert MACD EURUSD 1 Hour - expert for MetaTrader 5

| English Русский 中文 Español Deutsch 日本語 Português

Published by:
Vladimir Karputov
Views:
932
Rating:
votes: 9

Author of the idea — Gabrielauthor of the MQL5 code — barabashkakvn.

Works based on the iMACD (MACD) indicators.

Conditions to check the signals for opening a position:

void OpenBuyOrSell()
  {
   double mac1,mac2,mac3,mac4,mac5,mac6,mac7,mac8;
   mac1 = iMACDGet(MAIN_LINE,0);
   mac2 = iMACDGet(MAIN_LINE,1);
   mac3 = iMACDGet(MAIN_LINE,2);
   mac4 = iMACDGet(MAIN_LINE,3);
   mac5 = iMACDGet(SIGNAL_LINE,0);
   mac6 = iMACDGet(SIGNAL_LINE,1);
   mac7 = iMACDGet(SIGNAL_LINE,2);
   mac8 = iMACDGet(SIGNAL_LINE,3);

//--- check for long position (BUY) possibility
   if(mac8>mac7 && mac7>mac6 && mac6<mac5 && mac4>mac3 && mac3<mac2 && mac2<mac1 && mac2<-0.00020 && mac4<0 && mac1>0.00020)
     {
      if(!RefreshRates())
         return;
      double volume=LotsOptimized();
      if(volume==0)
         return;
      m_trade.Buy(volume,Symbol(),m_symbol.Bid(),0,0,"Expert MACD");
      return;
     }
//--- check for short position (SELL) possibility
   if(mac8<mac7 && mac7<mac6 && mac6>mac5 && mac4<mac3 && mac3>mac2 && mac2>mac1 && mac2>0.00020 && mac4>0 && mac1<-0.00035)
     {
      if(!RefreshRates())
         return;
      double volume=LotsOptimized();
      if(volume==0)
         return;
      m_trade.Sell(volume,Symbol(),m_symbol.Ask(),0,0,"Expert MACD");
      return;
     }
  }

Opening Buy on the chart:

Expert MACD EURUSD 1 Hour buy

 


Translated from Russian by MetaQuotes Software Corp.
Original code: https://www.mql5.com/ru/code/16967

Fractal_Bands_HTF Fractal_Bands_HTF

The Fractal_Bands indicator with the timeframe selection option available in the input parameters.

Fractal_CCI Fractal_CCI

Fractal Commodity Channel Index.

GO GO

Signals based on four iMA (MA) indicators, by PRICE_OPEN, PRICE_HIGH, PRICE_LOW, PRICE_CLOSE prices. Trades only on hedge accounts.

Fractal_Keltner_HTF Fractal_Keltner_HTF

The Fractal_Keltner indicator with the timeframe selection option available in the input parameters.