Code Conversion - MT5 to MT4

MQL4 インディケータ

指定

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

応答済み

1
開発者 1
評価
(879)
プロジェクト
1392
67%
仲裁
117
32% / 42%
期限切れ
215
15%
2
開発者 2
評価
(1130)
プロジェクト
1432
62%
仲裁
21
57% / 10%
期限切れ
43
3%
3
開発者 3
評価
(376)
プロジェクト
398
31%
仲裁
62
19% / 69%
期限切れ
50
13%
取り込み中
4
開発者 4
評価
(512)
プロジェクト
773
63%
仲裁
33
27% / 45%
期限切れ
23
3%
5
開発者 5
評価
(21)
プロジェクト
35
54%
仲裁
8
63% / 38%
期限切れ
1
3%
6
開発者 6
評価
(28)
プロジェクト
47
23%
仲裁
13
31% / 15%
期限切れ
12
26%
7
開発者 7
評価
(563)
プロジェクト
932
47%
仲裁
302
59% / 25%
期限切れ
124
13%
取り込み中
8
開発者 8
評価
(69)
プロジェクト
81
21%
仲裁
6
33% / 17%
期限切れ
5
6%
9
開発者 9
評価
(257)
プロジェクト
341
58%
仲裁
7
14% / 71%
期限切れ
9
3%
10
開発者 10
評価
(15)
プロジェクト
16
19%
仲裁
2
0% / 50%
期限切れ
1
6%
11
開発者 11
評価
(338)
プロジェクト
398
34%
仲裁
2
100% / 0%
期限切れ
0
12
開発者 12
評価
(1096)
プロジェクト
1777
61%
仲裁
14
64% / 7%
期限切れ
84
5%
13
開発者 13
評価
(8)
プロジェクト
9
22%
仲裁
0
期限切れ
0
14
開発者 14
評価
(7)
プロジェクト
17
41%
仲裁
3
0% / 100%
期限切れ
3
18%
15
開発者 15
評価
(5)
プロジェクト
11
18%
仲裁
0
期限切れ
3
27%
16
開発者 16
評価
(66)
プロジェクト
143
34%
仲裁
10
10% / 60%
期限切れ
26
18%
17
開発者 17
評価
(96)
プロジェクト
143
76%
仲裁
0
期限切れ
2
1%
18
開発者 18
評価
(7)
プロジェクト
8
63%
仲裁
1
0% / 100%
期限切れ
1
13%
19
開発者 19
評価
(26)
プロジェクト
29
45%
仲裁
0
期限切れ
1
3%
類似した注文
I would like to develop my own indicator on metatrader 4 and tradingview. We would start with a basic version that we would improve later. It is an indicator based on several analyses and which would provide several indications. I am looking for someone who can develop on MT4 and Mt5, initially I would like to do it on mt4 and then on mt5. If you have expertise in pinescript it is a plus because I would like to
I urgently require swift assistance to convert a complex indicator into a fully functional scanner, capable of automatically sending real-time data, alerts, and notifications via email, ensuring seamless integration and prompt delivery of critical information to facilitate informed decision-making and timely action
I need to improve the code of an indicator that is too heavy and slow when running and when used with iCustom in an EA. No other changes to the indicator are requested: the original features of the indicator should remain as theay are. I'll provide the indicator after job acceptance. I request final source code mq5 file. Thank you Regards
I have a mt5 indicator that is working perfectly but I will like to make it an expert advisor to have an automated trade. I will be glad if I can get a well experienced developer to execute this project. Thanks
O TRABALHO CONSISTE NA MUDANÇA DO HISTOGRAMA DO INDICADOR TREDN DIRECTION AND FORCE DSEMA SMOOTHED PARA O HISTOGRAMA DA FOTO ANEXA, OBEDECENDO AS TRES CORES VERDE (UP, VERMELHOR(DOWN) E CINZA(TREND). O MESMO TEM QUE ODECER O MESMO CALCULO E COLORIR DA MESMA FORMA POREM COM HISTOGRAMA DDE FORMATO DIFERENTE
If you are knowledgeable in hedging strategy we can chat. I created my simple EA using Fxdreema , so you only need to modify it for me. There are two parts of the EA , 1. Is the execution strategy 2. Is the money management strategy (hedging). I already created number 1 which is the execution of trades , I only need someone who can implement hedging in every orders the EA create. Additional Parameters needed. Trade
We are interested in a TradingView indicator that reads candlestick pattern shapes and shows the location of entry and exit points on a candlestick chart. What services do you provide related to this
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
the sl doesnt work i want the tp logic to remain i need the trend direction fucntion tow ork i the trend is up then only buys if down only sells i need the fibo nacci fucntion to work as well and the flat zone function to work as well and i need the code to trade 1% of the balance //+------------------------------------------------------------------+ //| US500_EA.mq4 | //|
Connect from Mt4 via binary derive account api. I have a bot. You need to convert the bot to an indicator. After converting I need to connect with my binary deriv through api. I want to trade my derivative binary account through mt4. If anyone can setup via API then contact me

プロジェクト情報

予算
30 - 50 USD
開発者用
27 - 45 USD
締め切り
最高 10 日