Code Conversion - MT5 to MT4

MQL4 Indicatori

Specifiche

//+------------------------------------------------------------------+
//|                                             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]);   
}

Con risposta

1
Sviluppatore 1
Valutazioni
(879)
Progetti
1394
67%
Arbitraggio
117
32% / 42%
In ritardo
215
15%
Gratuito
2
Sviluppatore 2
Valutazioni
(1135)
Progetti
1438
62%
Arbitraggio
21
57% / 10%
In ritardo
43
3%
Gratuito
3
Sviluppatore 3
Valutazioni
(379)
Progetti
404
31%
Arbitraggio
64
19% / 69%
In ritardo
51
13%
Caricato
4
Sviluppatore 4
Valutazioni
(513)
Progetti
776
63%
Arbitraggio
33
27% / 45%
In ritardo
23
3%
Gratuito
5
Sviluppatore 5
Valutazioni
(21)
Progetti
35
54%
Arbitraggio
8
63% / 38%
In ritardo
1
3%
Gratuito
6
Sviluppatore 6
Valutazioni
(28)
Progetti
47
23%
Arbitraggio
13
31% / 15%
In ritardo
12
26%
Gratuito
7
Sviluppatore 7
Valutazioni
(564)
Progetti
933
47%
Arbitraggio
303
59% / 25%
In ritardo
125
13%
Caricato
8
Sviluppatore 8
Valutazioni
(69)
Progetti
81
21%
Arbitraggio
6
33% / 17%
In ritardo
5
6%
Gratuito
9
Sviluppatore 9
Valutazioni
(257)
Progetti
341
58%
Arbitraggio
7
14% / 71%
In ritardo
9
3%
Gratuito
10
Sviluppatore 10
Valutazioni
(15)
Progetti
16
19%
Arbitraggio
2
0% / 50%
In ritardo
1
6%
Gratuito
11
Sviluppatore 11
Valutazioni
(365)
Progetti
434
35%
Arbitraggio
2
100% / 0%
In ritardo
0
Gratuito
12
Sviluppatore 12
Valutazioni
(1100)
Progetti
1782
61%
Arbitraggio
14
64% / 7%
In ritardo
84
5%
Gratuito
13
Sviluppatore 13
Valutazioni
(8)
Progetti
9
22%
Arbitraggio
0
In ritardo
0
Gratuito
14
Sviluppatore 14
Valutazioni
(7)
Progetti
17
41%
Arbitraggio
3
0% / 100%
In ritardo
3
18%
Gratuito
15
Sviluppatore 15
Valutazioni
(5)
Progetti
11
18%
Arbitraggio
0
In ritardo
3
27%
Gratuito
16
Sviluppatore 16
Valutazioni
(67)
Progetti
144
34%
Arbitraggio
10
10% / 60%
In ritardo
26
18%
Gratuito
17
Sviluppatore 17
Valutazioni
(96)
Progetti
143
76%
Arbitraggio
0
In ritardo
2
1%
Gratuito
18
Sviluppatore 18
Valutazioni
(7)
Progetti
8
63%
Arbitraggio
1
0% / 100%
In ritardo
1
13%
Gratuito
19
Sviluppatore 19
Valutazioni
(26)
Progetti
29
45%
Arbitraggio
0
In ritardo
1
3%
Gratuito
Ordini simili
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

Informazioni sul progetto

Budget
30 - 50 USD
Per lo sviluppatore
27 - 45 USD
Scadenze
a 10 giorno(i)