Open by MA Cross and Close by ATR

MQL5 Experts

Job finished

Execution time 3 hours

Specification

Need an EA for MT5 (including source code) : 

MT5 EA with Adaptive ATR


  1. The EA is based on 2 MA cross & close positions by ATR indicator
  2. Sample
  3. Fast MA cross slow MA to above and atr adaptive MA is green then open buy
  4. Close Buy order after the ATR indicator turns red
  5. sell fast MA cross slow MA to below and adaptive MA is red then open sell
  6. Close Sell order after the ATR indicator turns green
  7. Order execution on the best possible rates
  8. The Adaptive ATR indicator code already provided with the order
  9. All indicator input parameters should be user modifiable like MA period, MA type, ATR period etc
  10. It should work with any _Symbol & current chart time period & all times 24*5 no restrictions
  11. Expect default SL TP applicable as 0 and should be user modifiable
  12.           Needed the source code for the EA


//------------------------------------------------------------------
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_plots   1
#property indicator_label1  "EMA"
#property indicator_type1   DRAW_COLOR_LINE
#property indicator_color1  clrDarkGray,clrDeepPink,clrLimeGreen
#property indicator_width1  2
//--- input parameters
input int                inpEmaPeriod = 25;          // EMA period
input ENUM_APPLIED_PRICE inpPrice     = PRICE_CLOSE; // Price
//--- indicator buffers
double val[],valc[],atr[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,val,INDICATOR_DATA);
   SetIndexBuffer(1,valc,INDICATOR_COLOR_INDEX);
   SetIndexBuffer(2,atr,INDICATOR_CALCULATIONS);
//--- indicator short name assignment
   IndicatorSetString(INDICATOR_SHORTNAME,"ATR adaptive EMA ("+(string)inpEmaPeriod+")");
//---
   return (INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator de-initialization function                      |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,const int prev_calculated,const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
   if(Bars(_Symbol,_Period)<rates_total) return(prev_calculated);
   for(int i=(int)MathMax(prev_calculated-1,0); i<rates_total && !IsStopped(); i++)
     {
      atr[i] = 0;
         for (int k=0; k<inpEmaPeriod && (i-k-1)>=0; k++)
            atr[i] += MathMax(high[i-k],close[i-k-1])-MathMin(low[i-k],close[i-k-1]);
            atr[i] /= inpEmaPeriod;
      int _start = MathMax(i-inpEmaPeriod+1,0);
      double _max = atr[ArrayMaximum(atr,_start,inpEmaPeriod)];            
      double _min = atr[ArrayMinimum(atr,_start,inpEmaPeriod)];            
      double _coeff = (_min!=_max) ? 1-(atr[i]-_min)/(_max-_min) : 0.5;
      double _alpha = 2.0 / (1+inpEmaPeriod*(_coeff+1.0)/2.0);
      double _price = getPrice(inpPrice,open,close,high,low,i,rates_total);
      val[i]  = (i>0) ? val[i-1]+_alpha*(_price-val[i-1]) : _price;
      valc[i] = (i>0) ?(val[i]>val[i-1]) ? 2 :(val[i]<val[i-1]) ? 1 : valc[i-1]: 0;
     }
   return(rates_total);
  }
//+------------------------------------------------------------------+
//| Custom functions                                                 |
//+------------------------------------------------------------------+
double getPrice(ENUM_APPLIED_PRICE tprice,const double &open[],const double &close[],const double &high[],const double &low[],int i,int _bars)
  {
   if(i>=0)
      switch(tprice)
        {
         case PRICE_CLOSE:     return(close[i]);
         case PRICE_OPEN:      return(open[i]);
         case PRICE_HIGH:      return(high[i]);
         case PRICE_LOW:       return(low[i]);
         case PRICE_MEDIAN:    return((high[i]+low[i])/2.0);
         case PRICE_TYPICAL:   return((high[i]+low[i]+close[i])/3.0);
         case PRICE_WEIGHTED:  return((high[i]+low[i]+close[i]+close[i])/4.0);
        }
   return(0);
  }
//+------------------------------------------------------------------+

Responded

1
Developer 1
Rating
(5)
Projects
9
11%
Arbitration
5
40% / 60%
Overdue
1
11%
Free
2
Developer 2
Rating
(236)
Projects
418
34%
Arbitration
53
36% / 40%
Overdue
153
37%
Busy
3
Developer 3
Rating
(1127)
Projects
1429
62%
Arbitration
21
57% / 10%
Overdue
43
3%
Free
4
Developer 4
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
5
Developer 5
Rating
(6)
Projects
8
25%
Arbitration
1
100% / 0%
Overdue
3
38%
Free
6
Developer 6
Rating
(87)
Projects
131
22%
Arbitration
7
57% / 0%
Overdue
33
25%
Free
7
Developer 7
Rating
(74)
Projects
121
43%
Arbitration
12
33% / 50%
Overdue
17
14%
Free
8
Developer 8
Rating
(5)
Projects
9
0%
Arbitration
1
100% / 0%
Overdue
3
33%
Free
9
Developer 9
Rating
(22)
Projects
25
4%
Arbitration
0
Overdue
5
20%
Free
10
Developer 10
Rating
(1)
Projects
1
0%
Arbitration
0
Overdue
0
Free
11
Developer 11
Rating
(363)
Projects
389
70%
Arbitration
3
100% / 0%
Overdue
2
1%
Loaded
12
Developer 12
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
13
Developer 13
Rating
(563)
Projects
932
47%
Arbitration
301
59% / 25%
Overdue
124
13%
Working
14
Developer 14
Rating
(87)
Projects
114
26%
Arbitration
7
29% / 57%
Overdue
5
4%
Free
Similar orders
I installed the E.A. into the Experts folder in MT4. When I double click on it nothing happens. When I right click and "attach to chart" nothing happens. The E.A. is not grayed out, it simply will not attach. Any help would be greatly Appreciated
I have an EA and want to add few new logic to fetch profit taking factors and other values from an external master data and use it in existing EA
Hello Every one, Good day, I want from someone professional to create an EA is working on Mt5, This EA is working by depend on some indicators, and all those indicators must be working on MACD window, not on the chart, for more details please read my attached pdf file carefully. Many Thanks
I'm looking for an expert MQL5 developer that can create an EA that's based on my price action trading strategy with no indicators. The EA must analyze trades based on my price action rules, enter trades based on my price action rules, manage trades based on my price action rules and exit trades based on my price action rules
hi hi there i have an strategy on tradingview and i want to automate it like metatrader EA so i want the strategy to open and close trade automaticlly on tradingview
We are looking for an experienced Expert Advisor Developer who can build a customized MT5 Expert Advisor for us. The Expert Advisor would use two built-in indicators as entry/exit signals and our own risk management strategy with customizable inputs. The goal is to create a reliable and efficient trading tool that can automate our trading process on the MT5 platform. Skills required: - Strong understanding of
I need stochastic div (hidden &regular ea) that should perform task in all tf's ..divergence is a repaint stly so i want to use it with candlestick flips .. so bet for it
Hello, I have an indicator from a friend and I'd like to replicate it on my own TradingView or MT5 platform. Could you assist me with that?. Here is the link
so basically I have an EA(mql5), AI script(python), flask server and socket server both on python. Now this is an experimental script as I am trying to learn. However the EA is not entering any trades. How much would it cost for you to troubleshoot this for me? Thank you in advance
NEW FUNCTION 50+ USD
La idea es la siguiente, sería un EA semi automático. Yo como trader opero en zonas. En adelante las vamos a denominar ``zonas calientes´´. El EA debe que necesito debe operar conforme a 4 zonas calientes que yo configure en el mismo. ¿Qué hará el EA en cada una de esas zonas calientes que yo he configurado? En cada una de estas zonas el EA debe realizar hedging (crear un rango en el cual el EA entrara en sell o en

Project information

Budget
30+ USD
For the developer
27 USD