Modification MT4 file accommodate EA LAB requirements

MQL4 Индикаторы SQL MySQL

Работа завершена

Время выполнения 53 минуты

Техническое задание

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;

  }

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

//---

//---

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

//|                                                                  |

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

//---




Откликнулись

1
Разработчик 1
Оценка
(171)
Проекты
194
11%
Арбитраж
37
38% / 35%
Просрочено
5
3%
Загружен
2
Разработчик 2
Оценка
(15)
Проекты
21
38%
Арбитраж
3
33% / 33%
Просрочено
4
19%
Свободен
3
Разработчик 3
Оценка
(236)
Проекты
440
26%
Арбитраж
125
21% / 57%
Просрочено
96
22%
Работает
Похожие заказы
Hi, I will use: 5 indicators to find main trend , 5indicators to find current trend, find pivot point, support/resistance, reversel candle then entry.......indicators are available on mt5. *Dashboard chart will show on the chart as all indicators result,,,,as MA,MACD, bullish or bearish ,,,,add all others features days of trading,,,,hrs,,,etc
I need to create an EA based on my own strategy that actually is a little bit different from most of the usual EA. This because it use an indicator but the power of the system is just because it can shows target price by designing trendline on the price chart in a unusual way. A friend of mine tried to create it on MT4 platform but, in the end, he realized that this platform has big limits when the program lines
Convert my tradingview pine script to mt4, Its a simple and straight code i need an expert programmer to convert my tradingview pine script to mt4, Thats All Thank you
I need help with creating a website traders chatroom, it must show traders online,offline,inactive. the chatroom top section must show four clocks with different times and time scale like this.. the chatroom must have a history data of up to 10days, then longer history must be deleted automatically. if you have better chatroom please say your recommendations
dreams good and have a great Cash out from your smart phone , tuyoywuiy glamorous flood see full idk idk slow so dolls stupid sis workouts who's spark koalas oral waits also doggo idk
NRTR - indicator for MetaTrader 5 NRTR (Nick Rypock Trailing Reverse) - indicator for MetaTrader 4 NRTR WATR - indicator for MetaTrader 4 NRTR GATOR - indicator for MetaTrader 5 X2MA NRTR - indicator for MetaTrader 5 NRTR - indicator for MetaTrader 5 NRTR GATOR - indicator for MetaTrader 4 NRTR - indicator for MetaTrader 4 Stalin_NRTR - indicator for MetaTrader 5 NRTR Color Line - indicator for MetaTrader 5 NRTR Rosh
Hello, I'm seeking a freelancer with access to a ready-made server solution for an educational forex project. Requirements: Ability to control or manipulate live or historical trading data. Platform to execute simulated trades with exaggerated outcomes. Tools for real-time trade simulation (white-label or virtual dealer solutions). If you have a suitable server or can help me find one, please reach out with details
QuantumTrader 30 - 200 USD
Request for development of machine learning robots for MetaTrader 5 (MT5) **Description**: Willing to develop experience in programming trading robots using MQL5 language and can learn machine learning on MetaTrader 5 (MT5) platform. The robot should be able to implement a multidisciplinary strategy on a set of technical indicators and multiple rules. I need to develop the robots so that they can work in an
The goal is to develop a system that mirrors trade actions (Buy/Sell) from a CTrader demo account on Cronos Markets to multiple prop firm accounts on TradeLocker, ensuring accurate replication of trades while adjusting risk proportionally. I was wondering if you could help me with copy trading an EA’s action on Cronos markets (uses CTrader) into a prop firm account that I bought with TooOne Trader (uses TradeLocker
Hi there, I am offering $30 usd for someone to convert four pictures I have to metatrader icons(arrows) that I can use in both MT4 & MT5. We all know that we can change arrows on the chart by using a different arrow code, but the arrows in metatrader are boring and I want to use custom ones. I want the four attached pictures as icons that i can use with indicators that give the option to choose your arrow type. I

Информация о проекте

Бюджет
30+ USD
Исполнителю
27 USD
Сроки выполнения
до 2 дн.