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
(229)
Projects
404
33%
Arbitration
52
37% / 40%
Overdue
146
36%
Loaded
3
Developer 3
Rating
(1118)
Projects
1420
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
(355)
Projects
380
70%
Arbitration
3
100% / 0%
Overdue
2
1%
Working
12
Developer 12
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
13
Developer 13
Rating
(555)
Projects
922
48%
Arbitration
300
59% / 25%
Overdue
123
13%
Loaded
14
Developer 14
Rating
(86)
Projects
114
26%
Arbitration
7
29% / 57%
Overdue
5
4%
Free
Similar orders
I have an unfinished section of code which uses, "While" and ,(ilowest_Symbol,PERIOD_M1,MODE_LOW) to find a continuously updated sequence of 8 different lows(and its previous low), and their price values. Only the 1st of 8 lows and it's price value, is currently found by the code, as the code needs more work. A more detailed description is provided to potential coders
Hello, I need someone to create a script with these parameters in Tradestation (EasyLanguage). Here's what I'm trying to achieve: STRATEGY: I will manually select and sell an OTM naked call. My goal is to let it expire OTM. However if price goes past the strike, this strategy will buy and sell 100 shares of the underlying to minimize risk that I have to buy/sell shares at a higher price. What I want EasyLanguage to
Simple Hedge Zone EA 30 - 50 USD
inputs : 1 - order factor type : initial contract size / net contract size initial order size : it mean the multiply on the initial position it mean if i open 1 lot and the factor is 2.0 the second order will be 2 and the third one it will be 4 net contract size : it mean the multiply on net contract opened like exposure , it mean if i open 1 lot and the factor is 2.0 the second order will be 3 because in the stage
Guten Tag, benötigt wird eine Software die Trades auf einem MT4 oder MT5 kopiert und auf die xStation übergibt: http://developers.xstore.pro/documentation/ Auf dem MT4/5 Chart muss ein Hinweis stehen und wie die aktuelle Verbindung ist. Einstellbar wie zum Beispiel: https://drive.google.com/file/d/1ltg83qnbj-FgWRrq4q-1r1NS-vL5b-jE/view?usp=drive_link Es reicht wenn man es in MT4/5 Settings einstellen kann. Es muss
hi i want to create an ea based on price action,moving avereges and fair value gaps. i want the robot to operate on london session and newyork session. i want the bot to identify gaps, fill them and open position after fill the gap on opposite direction. Also i want the robot to open a position after a bearish or bullish engulfing candle cross the 200 moving averages
Hello, I am looking for a skilled MQL4, MQL5 PROGRAMMER WHO IS CAPABLE OF CODING A WELL AUTOMATED EA FOR MT4 AND MT5, I NEED AN EA THAT RUN WELL AS BELOW streamlined version of MY strategy Price-Based Entry : The EA opens trades based on price movements, either buying or selling. Profitable Exit : Trades are closed when they reach a predefined profit target. If a trade starts moving into negative territory, the EA
I want to build a well performance mt4 indicator or trading view indicator for my strategy, please you must make sure you are a professional in building mt4 indicator or trading view indicator with serveral years of experience, so if you are kindly react to this and let talk more on how you will get my indicator working
EA development 30+ USD
HELLO there, am looking for some one that have serveral years of experience in developing a well performance EA, that can use both mt4, mt5 platform for development, please you most be an expert in the coding of EA , THANK YOU
In search of a dev who can code an EA for Step Index.Should place pending orders and execute them as well as take profits as specified. I have an existing EA for B&C that should just be modified
All rights published by the owner. Its about experience and expert advisors may not be 100% accurate but they will assist you placing or execute trades when you are busy for you not to miss entries. Its a component of mixed confluence of strategies as it fit in my trading style

Project information

Budget
30+ USD
For the developer
27 USD