Modification MT4 file accommodate EA LAB requirements

MQL4 Indicatori SQL MySQL

Lavoro terminato

Tempo di esecuzione 53 minuti

Specifiche

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;

  }

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

//---

//---

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

//|                                                                  |

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

//---




Con risposta

1
Sviluppatore 1
Valutazioni
(171)
Progetti
194
11%
Arbitraggio
37
38% / 35%
In ritardo
5
3%
Caricato
2
Sviluppatore 2
Valutazioni
(15)
Progetti
21
38%
Arbitraggio
3
33% / 33%
In ritardo
4
19%
Gratuito
3
Sviluppatore 3
Valutazioni
(236)
Progetti
440
26%
Arbitraggio
125
21% / 57%
In ritardo
96
22%
In elaborazione
Ordini simili
Location: Remote Employment Type:[Full-time/Part-time] About Us At Riskeys, we are transforming the trading experience with our state-of-the-art Smart Trading Keypad for MetaTrader 4/5. Our mission is to empower traders with innovative risk management tools, providing them with the speed, precision, and efficiency they need to succeed in today’s fast-paced financial markets. As we continue to push the boundaries of
Hello, I have a physically trading keyboard and i want to connect it with tradelocker, mt4,mt5 and ctrader. People need to be able to open and close a position with the keyboard really fast. i need it on macos, windows and linux. (desktop) My competition is: www.magickeys.trade My goal is to be the number 1 to sell the keyboards + software. When people order a tradingkeyboard they will get a mail after the purchase
Job Title: Expert Advisor (EA) Developer for Forex Trading Job Description: I am seeking an experienced Expert Advisor (EA) developer to create a customized trading bot for the MetaTrader 4/5 platform. The bot will be designed to execute a sophisticated trading strategy that incorporates daily range calculations, cost averaging, and hedging with precise pip management. The successful candidate should have strong
I need an expert advisor based on MACD and MA signals. It must have check and handling of trade operations errors. The main criteria for opening and closing positions: ◇Both Main and Signal direction must be shown by Arrows which is going to be for buy and sell positions
I need an expert to help me with adding more features to my existing mt4 EA I think the addition I want added to this EA is fairly simple--but I don't really understand how programming works, Contact me for a long term work, This is not the only project, I will explain the features in the inbox, Let me know if you can do it
Hft live account 30 - 200 USD
i need a high frequency trading (hft) expert advisor, that can be used to trade on demo and live accounts icmarket and 8cap. The EA has to be highly profitable, giving daily profit. If a test version is available, please send, to foster a faster transaction. like the ones that pass prop firm and demo but adjustment where it work on live with low latency
CPI ROBOKING 30+ USD
*Strategy: CPI-Based Trading* *Instruments:* XAUUSD (Gold), UsTech100 (Nasdaq 100), USDJPY *CPI Release:* 1. *Higher-than-expected CPI:* - XAUUSD: SELL (Gold prices may drop due to potential rate hike) - UsTech100: SELL (Tech stocks may drop due to potential rate hike) - USDJPY: BUY (USD may strengthen due to potential rate hike) 2. *Meets or lower-than-expected CPI:* - XAUUSD: BUY (Gold prices may rise due
I WRITE a code i want to conect this for automatic trading through vps .and als advanced features for this code .i attached afile please watch .and give me perfect ea
I want to create an EA that can take bids according to information of a logic I have developed to give indication of a BUY or SELL opportunity. The EA will then be able to activate the BUY at the lowest possible position once the indicator clears it for a BUY and take bid upwards or identify the highest point and clears it for a SELL and take bids downwards. As you can see from example of JULY 2024 data to see how
Hello Im looking for professional trading developer who htf ready made trading with best and working strategy with low risk level with average of 30 to 60 percent profit margin, broker is not problem, any broker is welcomed and any trading pairs are welcomed as well

Informazioni sul progetto

Budget
30+ USD
Per lo sviluppatore
27 USD
Scadenze
a 2 giorno(i)