Code Conversion - MT5 to MT4

MQL4 Indicadores

Tarea técnica

//+------------------------------------------------------------------+
//|                                             Daily Highs-Lows.mq5 |
//|                                                 Copyright mladen |
//|                                               mladenfx@gmail.com |
//+------------------------------------------------------------------+
#property copyright "mladen"
#property link      "mladenfx@gmail.com"
#property version   "1.00"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_plots   2

//
//
//
//
//

#property indicator_label1  "High"
#property indicator_type1   DRAW_LINE
#property indicator_color1  Green
#property indicator_style1  STYLE_DOT
#property indicator_width1  1

#property indicator_label2  "Low"
#property indicator_type2   DRAW_LINE
#property indicator_color2  FireBrick
#property indicator_style2  STYLE_DOT
#property indicator_width2  1


//
//
//
//
//

input ENUM_TIMEFRAMES inpPeriod      = PERIOD_D1; // Time frame for highs/lows
input int             inpPeriodsBack = 0;         // Look back periods (enter 0 or less than zero for all)

//
//
//
//
//

double HiBuffer[];
double LoBuffer[];

int             iPeriodsBack;
ENUM_TIMEFRAMES iPeriod;

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
//
//
//
//
//

int OnInit()
{
   SetIndexBuffer(0,HiBuffer,INDICATOR_DATA); ArraySetAsSeries(HiBuffer,true);
   SetIndexBuffer(1,LoBuffer,INDICATOR_DATA); ArraySetAsSeries(LoBuffer,true);

   //
   //
   //
   //
   //
   
   iPeriodsBack = (inpPeriodsBack>0) ? inpPeriodsBack : 999999;      
   iPeriod      = (inpPeriod>=Period()) ? inpPeriod : Period();
      string timeFrameName = periodToString(iPeriod);
         IndicatorSetString(INDICATOR_SHORTNAME,timeFrameName+" highs/lows");
         PlotIndexSetString(0,PLOT_LABEL,timeFrameName+" high");
         PlotIndexSetString(1,PLOT_LABEL,timeFrameName+" low");
   return(0);
}

//
//
//
//
//

#define numRetries 5

//
//
//
//
//

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 (!ArrayGetAsSeries(time)) ArraySetAsSeries(time,true);
         MqlRates ratesArray[]; ArraySetAsSeries(ratesArray,true);
         
         int copiedRates;
         for (int i=0; i<numRetries;i++)
            if((copiedRates = CopyRates(Symbol(),iPeriod,time[rates_total-1],time[0],ratesArray))>0) break;
            if (copiedRates <= 0)
            {
               Print("not all rates copied. Will try on next tick");
               return(prev_calculated);
            }

      //
      //
      //
      //
      //

         int limit = rates_total-prev_calculated;
            if (prev_calculated > 0) limit++;
            if (prev_calculated ==0) limit--;

            int minutesPeriod = periodToMinutes(Period());
            int minutesChosen = periodToMinutes(iPeriod);

         limit = (limit>(minutesChosen/minutesPeriod)) ? limit : (minutesChosen/minutesPeriod);

      //
      //
      //
      //
      //
            
      for (int i=limit; i>=0; i--)
      {
         int d = dateArrayBsearch(ratesArray,time[i],copiedRates);
         if (d >= 0 && d < iPeriodsBack)
            {
               HiBuffer[i] = ratesArray[d].high;
               LoBuffer[i] = ratesArray[d].low;
            }
         else
            {
               HiBuffer[i] = EMPTY_VALUE;
               LoBuffer[i] = EMPTY_VALUE;
            }
      }
   
   //
   //
   //
   //
   //

   return(rates_total);
}



//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
//
//
//
//
//

int dateArrayBsearch(MqlRates& rates[], datetime toFind, int total)
{
   int mid   = 0;
   int first = 0;
   int last  = total-1;
   
   while (last >= first)
   {
      mid = (first + last) >> 1;
      if (toFind == rates[mid].time || (mid > 0 && (toFind > rates[mid].time) && (toFind < rates[mid-1].time))) break;
      if (toFind >  rates[mid].time)
            last  = mid - 1;
      else  first = mid + 1;
   }
   return (mid);
}


//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
//
//
//
//
//

int periodToMinutes(int period)
{
   int i;
   static int _per[]={1,2,3,4,5,6,10,12,15,20,30,0x4001,0x4002,0x4003,0x4004,0x4006,0x4008,0x400c,0x4018,0x8001,0xc001};
   static int _min[]={1,2,3,4,5,6,10,12,15,20,30,60,120,180,240,360,480,720,1440,10080,43200};

   if (period==PERIOD_CURRENT) 
       period = Period();   
            for(i=0;i<20;i++) if(period==_per[i]) break;
   return(_min[i]);   
}

//
//
//
//
//

string periodToString(int period)
{
   int i;
   static int    _per[]={1,2,3,4,5,6,10,12,15,20,30,0x4001,0x4002,0x4003,0x4004,0x4006,0x4008,0x400c,0x4018,0x8001,0xc001};
   static string _tfs[]={"1 minute","2 minutes","3 minutes","4 minutes","5 minutes","6 minutes","10 minutes","12 minutes",
                         "15 minutes","20 minutes","30 minutes","1 hour","2 hours","3 hours","4 hours","6 hours","8 hours",
                         "12 hours","daily","weekly","monthly"};
   
   if (period==PERIOD_CURRENT) 
       period = Period();   
            for(i=0;i<20;i++) if(period==_per[i]) break;
   return(_tfs[i]);   
}

Han respondido

1
Desarrollador 1
Evaluación
(879)
Proyectos
1394
67%
Arbitraje
117
32% / 42%
Caducado
215
15%
Libre
2
Desarrollador 2
Evaluación
(1135)
Proyectos
1438
62%
Arbitraje
21
57% / 10%
Caducado
43
3%
Libre
3
Desarrollador 3
Evaluación
(379)
Proyectos
404
31%
Arbitraje
64
19% / 69%
Caducado
51
13%
Trabajando
4
Desarrollador 4
Evaluación
(513)
Proyectos
776
63%
Arbitraje
33
27% / 45%
Caducado
23
3%
Libre
5
Desarrollador 5
Evaluación
(21)
Proyectos
35
54%
Arbitraje
8
63% / 38%
Caducado
1
3%
Libre
6
Desarrollador 6
Evaluación
(28)
Proyectos
47
23%
Arbitraje
13
31% / 15%
Caducado
12
26%
Libre
7
Desarrollador 7
Evaluación
(564)
Proyectos
933
47%
Arbitraje
303
59% / 25%
Caducado
125
13%
Trabajando
8
Desarrollador 8
Evaluación
(69)
Proyectos
81
21%
Arbitraje
6
33% / 17%
Caducado
5
6%
Libre
9
Desarrollador 9
Evaluación
(257)
Proyectos
341
58%
Arbitraje
7
14% / 71%
Caducado
9
3%
Libre
10
Desarrollador 10
Evaluación
(15)
Proyectos
16
19%
Arbitraje
2
0% / 50%
Caducado
1
6%
Libre
11
Desarrollador 11
Evaluación
(365)
Proyectos
434
35%
Arbitraje
2
100% / 0%
Caducado
0
Libre
12
Desarrollador 12
Evaluación
(1100)
Proyectos
1782
61%
Arbitraje
14
64% / 7%
Caducado
84
5%
Libre
13
Desarrollador 13
Evaluación
(8)
Proyectos
9
22%
Arbitraje
0
Caducado
0
Libre
14
Desarrollador 14
Evaluación
(7)
Proyectos
17
41%
Arbitraje
3
0% / 100%
Caducado
3
18%
Libre
15
Desarrollador 15
Evaluación
(5)
Proyectos
11
18%
Arbitraje
0
Caducado
3
27%
Libre
16
Desarrollador 16
Evaluación
(67)
Proyectos
144
34%
Arbitraje
10
10% / 60%
Caducado
26
18%
Libre
17
Desarrollador 17
Evaluación
(96)
Proyectos
143
76%
Arbitraje
0
Caducado
2
1%
Libre
18
Desarrollador 18
Evaluación
(7)
Proyectos
8
63%
Arbitraje
1
0% / 100%
Caducado
1
13%
Libre
19
Desarrollador 19
Evaluación
(26)
Proyectos
29
45%
Arbitraje
0
Caducado
1
3%
Libre
Solicitudes similares
Hello, am in need of a developer that can help in developing a trading bot that can effectively navigate the foreign exchange (Forex) market or other financial markets to generate passive income. My objective is to create a sophisticated algorithmic trading system that can consistently produce profitable trades with minimal manual intervention. I am seeking a reliable and efficient solution that can be tailored to my
am looking for who help me convert tradingview indicator to mt5 car trading strategy and make sure you are an expert before u apply to this and also my budget for this is 30$ so the name of the indicator is Breaker Blocks with Signals (LuxAlgo) ### 1. ** Entry Condition **: - ** For Long**: The trade is entered **after BB + ** is confirmed. - ** For Short *: The trade is entered **after BB -* is confirmed. ### 2nd
I have a custom MT4 indicator that I need converted to MT5. I'll share the source code with the applicants. Please only apply if you have vast experience in converting complex indicators successfully to MT5, and making sure that the MT5 version functions exactly the same as the MT4 version
I need an expert to help me convert chopzone traingview pinescript to mt4, I need an expert to get it done for me on between 1 to 2 days i hope this will be done by then, i will attach the file and my budget is $30 as of minimum here
Looking for someone to edit/optimize and existing NN (neural network) in my EA so it is more compatible/profitable with the multiple strategies. The expert advisor is a portfolio expert advisor consisting of 33 separate advisors/strategies compiled into one. A NN has been added to the EA but it does not compliment or help the EA's performance. I've attached the original EA (without NN) as well as the EA with the NN
Need to modify the ea to take trades based on an indicator. indicator and ea source code available. Variable inputs of indicator to be added. Buy Amount for Profit (+ve $value ) Buy Amount for Loss (-ve $value ) Sell Amount for Profit (+ve $value ) Sell Amount for Loss (-ve $value )
Procuro programador que consiga modificar essas estratégias, com a mesma capacidade de alteração das suas funcionalidades. Reitero, não consegui contato com o programador da fonte, nem mesmo mandando diversas mensagens no telegram! br.tradingview.com/script/PfpFNXyI-Braid-Filter/ br.tradingview.com/script/kv8N05R7-AlphaTrend-Screener/ Ambos os indicadores precisam agir em conjunto, tanto para as funcionalidades em
--- ### Basic Rules for You 1. **Time Management**: - All tasks should be completed within the agreed-upon timeframe. Clear deadlines will be set, and it's essential to adhere to them to ensure smooth progress. 2. **Fixed Budget**: - The budget for this project is fixed. Please ensure that all work done remains within this budget. Any additional costs must be discussed and agreed upon before proceeding. 3
CORREÇÃO NOTIFICAÇÕES Ø O indicador muda a cor dos candles e da MA200 quando ocorre as entradas e é somente nesse momento que ele deve enviar notificação de entrada porem está enviando em outros momentos que não atende as condições conforme imagem abaixo. Ø Sempre que abro o MT5, mudo o time frame ou a plataforma perde conexão o indicador me envia notificações de entradas passadas, o indicador deve enviar
Hi I have an indicator that i have tried to create an EA with, this is a simple EA that should have bought on green indicator value if previous candle indicator value was yellow. Then it should have sold when indicator value was red with previous value being yellow. Now, i would not say that i am a coder, by any stretch of the imagination, but something this simple should have been easy, instead, the EA would open

Información sobre el proyecto

Presupuesto
30 - 50 USD
Para el ejecutor
27 - 45 USD
Plazo límite de ejecución
a 10 día(s)