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
등급
(1134)
프로젝트
1436
62%
중재
21
57% / 10%
기한 초과
43
3%
무료
3
개발자 3
등급
(378)
프로젝트
401
31%
중재
63
19% / 70%
기한 초과
51
13%
로드됨
4
개발자 4
등급
(513)
프로젝트
775
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
등급
(564)
프로젝트
933
47%
중재
302
59% / 25%
기한 초과
125
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
등급
(355)
프로젝트
417
34%
중재
2
100% / 0%
기한 초과
0
무료
12
개발자 12
등급
(1098)
프로젝트
1779
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%
무료
비슷한 주문
Hello, is it possible to be made accommodation of provided signal for Forex for mt4? I bought a signal for multiple pairs. it is executing all pair.I want to use it on couple of pairs.Is it possible to be made some modifications?I do not have codes for the signal
I have an MT4 indicator, I want to receive an alert on WhatsApp when the indicator gives a buy or sell signal, I already have an API that will send the message, just send the json with the content, I will pass the API link when I have the proposal: { "symbol": "xauusd", "cellphonenumber": "00000000", "message": "test" }
KILL MODE 30 - 60 USD
i Need an expert advisor that trade by signal moving average indictors.it must check and correct the process of possible errors in trading operations. The main criteria of opening and closing positions direction of average moving,price of last bar and set the number of lots to trade as an input parameter
Creating a chart composed of different assets, weighted by their trading lot size & quantity. Using this chart to trade the assets in those lot sizes &quantity (by hand or with an EA ) In other words: composing a private index or pair, plotting that as a chart and have the ability to trade it directly with an EA and/or one order click. Inspired by Basket Chart Creator
Hello, I am highly in need of a professional and expert developer who is capable to convert my tradingview indicator to MT5, if you can perfectly do this project kindly meet me at the comment section to proceed
You must have knowledge of forex tester. Don't bother unless you do The indicator to convert from trading view to FOREX TESTER 5 -- wave trend 3d by JDEHORTY Please note this is a multi time frame indicator. Im not interested in any other wave trend indicator. It has to be a conversion of this indicator. Forex tester conversion https://www.youtube.com/watch?v=S64LjZVr9jE code python
Craet and indicator which has 15 price source and set a T/F tick for each price source then make Bollinger bands and Rsi with BollingerBands just for true sorces and plot buy and sell signals on main chart based on some conditions and strategy.... i explained every thing clear in the zip file ... theres no need to display those indicators i just need to see their value for testing how indicator works inside chart
I have one expert advisor. I optimized it and generated 3 optimized set files. As each EA can run only single set file, I need my EA to run with the parametrization from 3 set files at the same time because trade conditions those are defined by the set files are not same
THE IDEA OF THE INDICATOR Create A Standard ZigZag Auto Fibo Indicator Combined With A ZigZag Fibonacci Time Zone Indicator Which Has The Specified Levels Written In The Indicator Strategy TEXT FILE/DOCUMENT HOW DOES THE INDICATOR KNOW AN UPTREND MOVEMENT? If Price Hasn't Touched The 123.6% Level Of The Recent Static Uptrend Zig Zag Fibo Retracement Tool Then The Indicator Knows That The Market Is In An Uptrend And
Hi, To help with algorithm development, I need an experienced PineScript and TRADELOCKER coder to convert an indicator from TradingView to Tradelocker, then create an expert advisor (EA) with the same logic as the indicator and the features I want in the expert advisor (Rules & Conditions). Please only apply if you have experience converting scripts from TradingView to Tradelocker. I also need to make sure that the

프로젝트 정보

예산
30 - 50 USD
개발자에게
27 - 45 USD
기한
 10 일