Modification MT4 file accommodate EA LAB requirements

MQL4 Indicators SQL MySQL

Job finished

Execution time 53 minutes

Specification

i have a simple and specific requirement to modify an indicator. This indicator has 10 buffers for colour as below:


Indicator Buffers currently

i would like to delete the duplicate buffers for use in EA lab which has a maximum of 8 allowed.


The code is below:


//+------------------------------------------------------------------+

//|                                                   iRimbab_1.mq4  |

//|                        Copyright 2019, MetaQuotes Software Corp. |

//|                                             https://www.mql5.com |

//+------------------------------------------------------------------+

#property copyright "Copyright 2019, MetaQuotes Software Corp."

#property link      "https://www.mql5.com"

#property version   "1.00"

#property strict

#property indicator_separate_window

#property indicator_buffers   10


#property indicator_label1 "Bull Strong"

#property indicator_color1 clrBlue

#property indicator_type1  DRAW_HISTOGRAM

#property indicator_width1 4


#property indicator_label4 "Bull Lite"

#property indicator_color4 clrBlue

#property indicator_type4  DRAW_HISTOGRAM

#property indicator_width4 4


#property indicator_label6 "Neutral"

#property indicator_color6 clrGray

#property indicator_type6  DRAW_HISTOGRAM

#property indicator_width6 4


#property indicator_label7 "Sell Lite"

#property indicator_color7 clrRed

#property indicator_type7  DRAW_HISTOGRAM

#property indicator_width7 4


#property indicator_label9 "Sell Strong"

#property indicator_color9 clrRed

#property indicator_type9  DRAW_HISTOGRAM

#property indicator_width9 4


//---

enum E_MODE

  {

   MOD_RSI  =0,   //RSI

   MOD_STO  =1,   //STOCHASTIC

   MOD_ADX  =2    //ADX

  };

//---

enum E_TYPE

  {

   TYP_ALMA    =0,   //ALMA

   TYP_EMA     =1,   //EMA

   TYP_WMA     =2,   //WMA

   TYP_SMA     =3,   //SMA

   TYP_SMMA    =4,   //SMMA

   TYP_HMA     =5    //HMA

  };

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

input    int                  Length      =6;            //Period of Evaluation

input    int                  Smooth      =1;            //Period of Smoothing

input    ENUM_APPLIED_PRICE   Source      =PRICE_CLOSE;  //Source

input    E_MODE               Mode        =MOD_RSI;      //Indicator Method

input    E_TYPE               Type        =TYP_WMA;      //MA

input    double               Offset      =0.85;         //* Arnaud Legoux (ALMA) Only - Offset Value

input    double               Sigma       =6.0;          //* Arnaud Legoux (ALMA) Only - Sigma Value

input    int                  MaxBar      =1000;         //Max Bars

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

#include <MovingAverages.mqh>

//---

double   BS[];

double   BSZ[];

double   BL[];

double   BLZ[];

double   Nt[];

double   NtZ[];

double   SL[];

double   SLZ[];

double   SS[];

double   SSZ[];


double   MA[];

double   Bull[];

double   Bear[];

double   Temp[];

double   Price[];

double   AvBull[];

double   AvBear[];

double   SmBull[];

double   SmBear[];


double   W[];

//+------------------------------------------------------------------+

//| Custom indicator initialization function                         |

//+------------------------------------------------------------------+

int OnInit()

  {

   Comment("");

   


   IndicatorBuffers(19);

   int   cnt=0;

   SetIndexBuffer(cnt,BS,INDICATOR_DATA);

   SetIndexEmptyValue(cnt,NULL);

   cnt++;

   SetIndexBuffer(cnt,BSZ,INDICATOR_DATA);

   SetIndexEmptyValue(cnt,NULL);

   cnt++;

   SetIndexBuffer(cnt,BL,INDICATOR_DATA);

   SetIndexEmptyValue(cnt,NULL);

   cnt++;

   SetIndexBuffer(cnt,BLZ,INDICATOR_DATA);

   SetIndexEmptyValue(cnt,NULL);

   cnt++;

   SetIndexBuffer(cnt,Nt,INDICATOR_DATA);

   SetIndexEmptyValue(cnt,NULL);

   cnt++;

   SetIndexBuffer(cnt,NtZ,INDICATOR_DATA);

   SetIndexEmptyValue(cnt,NULL);

   cnt++;

   SetIndexBuffer(cnt,SL,INDICATOR_DATA);

   SetIndexEmptyValue(cnt,NULL);

   cnt++;

   SetIndexBuffer(cnt,SLZ,INDICATOR_DATA);

   SetIndexEmptyValue(cnt,NULL);

   cnt++;

   SetIndexBuffer(cnt,SS,INDICATOR_DATA);

   SetIndexEmptyValue(cnt,NULL);

   cnt++;

   SetIndexBuffer(cnt,SSZ,INDICATOR_DATA);

   SetIndexEmptyValue(cnt,NULL);

   cnt++;

   SetIndexBuffer(cnt,MA,INDICATOR_CALCULATIONS);

   SetIndexEmptyValue(cnt,NULL);

   cnt++;

   SetIndexBuffer(cnt,Bull,INDICATOR_CALCULATIONS);

   SetIndexEmptyValue(cnt,NULL);

   cnt++;

   SetIndexBuffer(cnt,Bear,INDICATOR_CALCULATIONS);

   SetIndexEmptyValue(cnt,NULL);

   cnt++;

   SetIndexBuffer(cnt,Temp,INDICATOR_CALCULATIONS);

   SetIndexEmptyValue(cnt,NULL);

   cnt++;

   SetIndexBuffer(cnt,Price,INDICATOR_CALCULATIONS);

   SetIndexEmptyValue(cnt,NULL);

   cnt++;

   SetIndexBuffer(cnt,AvBull,INDICATOR_CALCULATIONS);

   SetIndexEmptyValue(cnt,NULL);

   cnt++;

   SetIndexBuffer(cnt,AvBear,INDICATOR_CALCULATIONS);

   SetIndexEmptyValue(cnt,NULL);

   cnt++;

   SetIndexBuffer(cnt,SmBull,INDICATOR_CALCULATIONS);

   SetIndexEmptyValue(cnt,NULL);

   cnt++;

   SetIndexBuffer(cnt,SmBear,INDICATOR_CALCULATIONS);


   IndicatorSetInteger(INDICATOR_DIGITS,_Digits+1);

   IndicatorSetString(INDICATOR_SHORTNAME,

                      MQLInfoString(MQL_PROGRAM_NAME)+" ("+

                      IntegerToString(Length)+", "+

                      IntegerToString(Smooth)+", "+

                      StringSubstr(EnumToString(Source),StringLen("PRICE_"))+", "+

                      StringSubstr(EnumToString(Mode),StringLen("MOD_"))+", "+

                      StringSubstr(EnumToString(Type),StringLen("TYP_"))+", "+

                      DoubleToString(Offset,2)+", "+

                      DoubleToString(Sigma,2)+")");


   return(INIT_SUCCEEDED);

  }

//+------------------------------------------------------------------+

//| 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[])

  {

   int   limit=rates_total-prev_calculated;

   if(limit>1)

     {

      limit=fmin(MaxBar,rates_total)-Length-2;


      for(int i=0; i<rates_total; i++)

         PlotZ(i);


      if(Type==TYP_ALMA)

        {

         ArrayResize(W,Length);

         double   m=floor(Offset*(Length-1));

         double   s=Length/Sigma;

         double   wSum=0;

         double   t=(2*s*s);

         for(int i=0; i<Length; i++)

           {

            W[i]=exp(-((i-m)*(i-m))/((t==NULL) ?1.0 :t));

            wSum+= W[i];

           }

         for(int i=0; i<Length; i++)

            W[i]=W[i]/wSum;

        }

     }

   else

      limit++;


   for(int i=limit; i>=0; i--)

     {

      PlotZ(i);

      Price[i]=Price(Source,i,open[i],high[i],low[i],close[i]);

      switch(Type)

        {

         case TYP_HMA:

            Temp[i]=iMA(_Symbol,PERIOD_CURRENT,(int)floor(Length/2),0,MODE_LWMA,Source,i)*2-iMA(_Symbol,PERIOD_CURRENT,Length,0,MODE_LWMA,Source,i);

            break;

        }

     }

   for(int i=limit; i>=0; i--)

     {

      MA[i]=iMA(_Symbol,PERIOD_CURRENT,1,0,MODE_SMA,Source,i);

      switch(Mode)

        {

         case MOD_STO:

            Bull[i]=MA[i]-MA[ArrayMinimum(MA,Length,i)];

            Bear[i]=MA[ArrayMaximum(MA,Length,i)]-MA[i];

            break;

         case MOD_RSI:

            Bull[i]=0.5*(fabs(MA[i]-MA[i+1])+(MA[i]-MA[i+1]));

            Bear[i]=0.5*(fabs(MA[i]-MA[i+1])-(MA[i]-MA[i+1]));

            break;

         case MOD_ADX:

            Bull[i]=0.5*(fabs(high[i]-high[i+1])+(high[i]-high[i+1]));

            Bear[i]=0.5*(fabs(low[i+1]-low[i])+(low[i+1]-low[i]));

            break;

        }

      AvBull[i]=MA(Bull,Length,i);

      AvBear[i]=MA(Bear,Length,i);

     }


   for(int i=limit; i>=0; i--)

     {

      SmBull[i]=MA(AvBull,Smooth,i);

      SmBear[i]=MA(AvBear,Smooth,i);

      double   dif=fabs(SmBull[i]-SmBear[i]);

      if(dif>SmBull[i])

        {

         if(SmBear[i]<SmBear[i+1])

            SS[i]=dif;

         else

            SL[i]=dif;

         continue;

        }

      if(dif>SmBear[i])

        {

         if(SmBull[i]<SmBull[i+1])

            BS[i]=dif;

         else

            BL[i]=dif;

         continue;

        }

      Nt[i]=dif;

     }


   return(rates_total);

  }

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

double MA(double &vBuf[],const int vLen,const int vxPos)

  {

   double   sum=0.0;

   switch(Type)

     {

      case TYP_SMA:

         return(iMAOnArray(vBuf,0,vLen,0,MODE_SMA,vxPos));

      case TYP_EMA:

         return(iMAOnArray(vBuf,0,vLen,0,MODE_EMA,vxPos));

      case TYP_SMMA:

         return(iMAOnArray(vBuf,0,vLen,0,MODE_SMMA,vxPos));

      case TYP_WMA:

         return(iMAOnArray(vBuf,0,vLen,0,MODE_LWMA,vxPos));

      case TYP_HMA:

         return(iMAOnArray(vBuf,0,(int)floor(sqrt(vLen)),0,MODE_LWMA,vxPos));

      case TYP_ALMA:

         for(int i=0; i<vLen; i++)

            sum+=vBuf[vxPos+(vLen-1-i)]*W[i];

         return(sum);

     }

   return(NULL);

  }

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

double Price(const ENUM_APPLIED_PRICE vApp,const int vxPos,const double vOp,const double vHi,const double vLo,const double vCl)

  {

   switch(vApp)

     {

      case PRICE_CLOSE:

         return(vCl);

      case PRICE_HIGH:

         return(vHi);

      case PRICE_LOW:

         return(vLo);

      case PRICE_OPEN:

         return(vOp);

      case PRICE_MEDIAN:

         return((vHi+vLo)/2.0);

      case PRICE_TYPICAL:

         return((vHi+vLo+vCl)/3.0);

      case PRICE_WEIGHTED:

         return((vHi+vLo+vCl+vCl)/4.0);

     }

   return(NULL);

  }

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void  PlotZ(int vxPos)

  {

   BS[vxPos]=NULL;

   BSZ[vxPos]=NULL;

   BL[vxPos]=NULL;

   BLZ[vxPos]=NULL;

   Nt[vxPos]=NULL;

   NtZ[vxPos]=NULL;

   SL[vxPos]=NULL;

   SLZ[vxPos]=NULL;

   SS[vxPos]=NULL;

   SSZ[vxPos]=NULL;

   MA[vxPos]=NULL;

   Bull[vxPos]=NULL;

   Bear[vxPos]=NULL;

   Temp[vxPos]=NULL;

   Price[vxPos]=NULL;

   AvBull[vxPos]=NULL;

   AvBear[vxPos]=NULL;

   SmBull[vxPos]=NULL;

   SmBear[vxPos]=NULL;

  }

//+------------------------------------------------------------------+

//---

//---

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

//---




Responded

1
Developer 1
Rating
(173)
Projects
197
12%
Arbitration
39
36% / 33%
Overdue
5
3%
Loaded
Published: 2 codes
2
Developer 2
Rating
(15)
Projects
21
38%
Arbitration
3
33% / 33%
Overdue
4
19%
Free
3
Developer 3
Rating
(246)
Projects
455
26%
Arbitration
134
21% / 58%
Overdue
99
22%
Free
Similar orders
Hello, I am looking for an experienced QuantConnect/Lean developer for a trading strategy project on futures (Micro Nasdaq – MNQ) with Interactive Brokers integration (paper + live). The strategy includes several key features: • Multi-timeframe analysis (signal validation across multiple horizons) • Integration of economic news/events into the trading logic • Advanced risk management (daily stop, position sizing
update 06/09/2025 Detailed request is written in the word document project is detayed for execution till 05/10/2025, we need the time to review the analysis document Generating analysis based on ICT Concepts and Smort Money Concepts following detailed views i am requesting to any developer 3 EA's as proof that you understand ICT Concepts and SMC These should give a good view on what you can. Examples attached of
Bainanans 500+ USD
Bainanan good f المؤشر. ينبغي إضافة نقطة صفراء عند أعلى نقطة في الشموع في منطقة ذروة الشراء - وهي نقطة H. ينبغي إضافة نقطة خضراء عند النقطة المنخفضة للشموع في منطقة ذروة البيع - وهي نقطة L. إذا وُجدت نقطة L واحدة على الأقل بين نقطتي H، فابحث عن نقطة LL في الفترة الفاصلة بينهما. ستكون الشمعة ذات أدنى سعر قاع هي نقطة LL. بشكل عام، لا تُعتبر نقطة LL بالضرورة نقطة L. ابحث عن الشموع ذات أدنى سعر قاع. إذا كانت هناك نقطة H
Døsh forex 30 - 200 USD
I want a robot that will help me and trade the the robot will be very good I don’t want to loose money I repeat I don’t want to loose money
We are looking for an experienced MT5/MQL5 developer to build a data bridge that connects an external market data feed (tick-by-tick from a third-party provider) into the MT5 platform. Requirements: Capture real-time tick-by-tick market data (bid/ask/last price, volume) from an external API (source: WebSocket/REST or DLL). Push this data into MT5 in a format compatible with native charts and order execution
Customizable Forex Trading Bot for MetaTrader 4 & 5 Project Overview I am a professional zone‑to‑zone trader seeking an experienced developer to build a fully customizable forex trading bot (Expert Advisor) that operates on both MetaTrader 4 and MetaTrader 5. The bot must execute trades according to detailed instructions that I will provide once an ambitious and suitable applicant is selected. It should allow easy
I am looking for an experienced MQL5 developer to build a trading robot based on my personal strategy. The EA should be coded professionally, with efficiency, accuracy, and risk management in mind. Strategy Overview: The strategy is structure-based with Fibonacci retracement (0.618–0.79) as the primary Point of Interest (POI). Secondary confluences include order blocks, support/resistance, psychological levels, and
Ai spike Indicator 30 - 35 USD
Create an Ai based indicator that is able to identify sudden market movements known as spikes on boom and crash indices on the deriv market. The Ai should incorporate these strategies for better precision on getting signals, these strategies include support and resistance on 4 hour time frame SMC, CRT, ICT, Strategies volume trend, volatility pure price action tick velocity, momentum and key points on fibbonacci tool
I would like you to create an expert advisor or robot based on a closed source Trading View indicator ‘Stop Hunt by _Nephew_Sam’. You have to first check this indicator out and be sure you can replicate the source code’s logic before you apply for this gig. If you read to this point, include closed source in your reply to this post
Here are the requirements for a potential developer: 1. *Task*: Create a detailed specification for image editing tasks. 2. *Key Features*: - Describe the type of image (e.g., photo, graphic). - Specify edits (add, remove, change elements). - Define desired output format and resolution. 3. *Deliverables*: - A clear, concise document outlining the task. - Estimated complexity and cost assessment. -

Project information

Budget
30+ USD
For the developer
27 USD
Deadline
to 2 day(s)