Turn Indi int EA

 
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 LimeGreen
//----
extern bool Show_Alert = true;
//---- buffers
double upArrow[];
double downArrow[];
string PatternText[5000];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init() 
  {
   SetIndexStyle(0, DRAW_ARROW, 0, 1);
   SetIndexArrow(0, 234);
   SetIndexBuffer(0, downArrow);      
//----
   SetIndexStyle(1, DRAW_ARROW, 0, 1);
   SetIndexArrow(1, 233);
   SetIndexBuffer(1, upArrow);
      
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit() 
  {
   ObjectsDeleteAll(0, OBJ_TEXT);
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   double Range, AvgRange;
   int counter, setalert;
   static datetime prevtime = 0;
   int shift;
   int shift1;
   int shift2;
   int shift3;
   int shift4;   
 
   double mid1, mid2, mid3, mid4, shift1percent, V1, V2;   
   
   string pattern, period;
   int setPattern = 0;
   int alert = 0;
   int arrowShift;
   int textShift;
   double O, O1, O2, C, C1, C2, L, L1, L2, H, H1, H2;     
//----
   if(prevtime == Time[0]) 
     {
       return(0);
     }
   prevtime = Time[0];   
//----
   switch(Period()) 
     {
       case 1:     period = "M1";  break;
       case 5:     period = "M5";  break;
       case 15:    period = "M15"; break;
       case 30:    period = "M30"; break;      
       case 60:    period = "H1";  break;
       case 240:   period = "H4";  break;
       case 1440:  period = "D1";  break;
       case 10080: period = "W1";  break;
       case 43200: period = "MN";  break;
     }
//----
   for(int j = 0; j < Bars; j++) 
     { 
       PatternText[j] = j;
     }
//----
   for(shift = 0; shift < Bars; shift++) 
     {
       setalert = 0;
       counter = shift;
       Range = 0;
       AvgRange = 0;
       for(counter = shift; counter <= shift + 9; counter++) 
         {
           AvgRange = AvgRange + MathAbs(High[counter] - Low[counter]);
         }
       Range = AvgRange / 10;
       shift1 = shift + 1;
       shift2 = shift + 2;
       shift3 = shift + 3;      
       shift4 = shift + 4;        
       mid1 = Low[shift1]+((High[shift1]-Low[shift1])/2);
       mid2 = Low[shift2]+((High[shift2]-Low[shift2])/2);
       mid3 = Low[shift3]+((High[shift3]-Low[shift3])/2);
       mid4 = Low[shift4]+((High[shift4]-Low[shift4])/2);                     
       shift1percent = (High[shift1]-Low[shift1])/100 ;
       O = Open[shift1];
       O1 = Open[shift2];
       O2 = Open[shift3];
       H = High[shift1];
       H1 = High[shift2];
       H2 = High[shift3];
       L = Low[shift1];
       L1 = Low[shift2];
       L2 = Low[shift3];
       C = Close[shift1];
       C1 = Close[shift2];
       C2 = Close[shift3];  
       
       V1 = Volume[shift1];
       V2 = Volume[shift2];     


       if((mid1 < mid2) && (mid1 < mid3) && (mid1 < mid4) && (C < (mid1-1*shift1percent)) && (V1 > V2) && (O > C) )
         {
           //    ObjectCreate(PatternText[shift], OBJ_TEXT, 0, Time[shift1], 
           //                 High[shift1] + Range*1.5);
           //    ObjectSetText(PatternText[shift], DoubleToStr(V2,5), 10, 
           //                  "Times New Roman", Red);
               downArrow[shift1] = High[shift1] + Range*0.5;
        
           if(setalert == 0 && Show_Alert == true) 
             {
               pattern = "Down Jump Bar";
               setalert = 1;
             }
         }

     

       if((mid1 > mid2) && (mid1 > mid3) && (mid1 > mid4) && (C > (mid1+1*shift1percent)) && (V1 > V2) && (O < C) )
         {
           //    ObjectCreate(PatternText[shift], OBJ_TEXT, 0, Time[shift1], 
           //                 High[shift1] + Range*1.5);
           //    ObjectSetText(PatternText[shift], DoubleToStr(V2,5), 10, 
           //                  "Times New Roman", Red);
               upArrow[shift1] = Low[shift1] - Range*0.5;
        
           if(setalert == 0 && Show_Alert == true) 
             {
               pattern = "Up Jump Bar";
               setalert = 1;
             }
         }
         
  
       if(setalert == 1 && shift == 0) 
         {
           Alert(Symbol(), " ", period, " ", pattern);
           setalert = 0;
         }
     } // End of for loop
   return(0);
  }
//+------------------------------------------------------------------+
Could anyone please turn this indi into an EA that enters a trade when the first opposing arrow is formed and the stop is placed above/below recent high/low. Please let me know if you need further explanation. Thanks, MW.
 
Sorry, we only help people who are learning how to code.
 
mattkw174:
Could anyone please turn this indi into an EA that enters a trade when the first opposing arrow is formed and the stop is placed above/below recent high/low. Please let me know if you need further explanation. Thanks, MW.

https://www.mql5.com/en/job Jobs
 
mattkw174:
Could anyone please turn this indi into an EA that enters a trade when the first opposing arrow is formed and the stop is placed above/below recent high/low. Please let me know if you need further explanation. Thanks, MW.
where do you get this? no copyright, no name, etc?
 
  1. mattkw174:
    Could anyone please turn this indi into an EA that...
    No Slaves here, learn to code or pay someone. We're not going to code it FOR you. We are willing to HELP you.
  2. You do NOT need to turn indicators into EAs. You write an EA that calls iCustom to get the indicator's values and trades from there.

    Indicator contains:

    extern bool Show_Alert = true;
       SetIndexBuffer(0, downArrow);      
       SetIndexBuffer(1, upArrow);
    So the EA code would be
    #define INDI_NAME "..." // Indicator filename without the .mq4
    bool Indi_Show_Alert = true;
    #define INDI_DOWN 0
    #define INDI_UP   1
    double value = iCustom(NULL, 0, INDI_NAME, Indi_Show_Alert, INDI_DOWN, shift);