Help me port a simple indicator to MT5 please?

 

Hello, i would like to start transitioning to MT5 but i use a few indicators that have not been ported to MT5 yet, so is there any chance one of you could help me out please?

 It's a Daily HiLo indicator.

 

Files:
 
jakubdonovan36:

Hello, i would like to start transitioning to MT5 but i use a few indicators that have not been ported to MT5 yet, so is there any chance one of you could help me out please?

 It's a Daily HiLo indicator.

 

Not with an ex4 file. Please provide the mq4 source code file to get some legal coding help.

 
Daniel Stein:

Not with an ex4 file. Please provide the mq4 source code file to get some legal coding help.

I am not the creator of this indicator. I don't have the EX4 file. Do i have any other options?
 
jakubdonovan36:
I am not the creator of this indicator. I don't have the EX4 file. Do i have any other options?

Without the source code you'll have to find a MT5 indicator that provides the same information.

One possible source is the codebase for MT5 indicators

 
jakubdonovan36:

Hello, i would like to start transitioning to MT5 but i use a few indicators that have not been ported to MT5 yet, so is there any chance one of you could help me out please?

 It's a Daily HiLo indicator.

 

Check here : https://www.mql5.com/en/code/16713
Highs-Lows
Highs-Lows
  • votes: 5
  • 2016.10.28
  • Mladen Rakic
  • www.mql5.com
A simple indicator that shows the high and the low of desired time frame on a current chart.
 
Mladen Rakic:
Check here : https://www.mql5.com/en/code/16713
This indicator is different. The one i attached shows Yesterday's High and Yesterday's low.
 
jakubdonovan36:
This indicator is different. The one i attached shows Yesterday's High and Yesterday's low.

Use this then :

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_plots   2
#property indicator_label1  "Daily high line"
#property indicator_type1   DRAW_LINE
#property indicator_style1  STYLE_DOT
#property indicator_color1  clrDodgerBlue
#property indicator_label2  "Daily low line"
#property indicator_type2   DRAW_LINE
#property indicator_style2  STYLE_DOT
#property indicator_color2  clrSandyBrown

double highLine[],lowLine[];

int OnInit()
{
   SetIndexBuffer(0,highLine,INDICATOR_DATA);
   SetIndexBuffer(1,lowLine ,INDICATOR_DATA);
   return(INIT_SUCCEEDED);
}
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 (Bars(_Symbol,_Period)<rates_total) return(0);
   int i=0;
      for (i=(int)MathMax(prev_calculated-1,0); i<rates_total && !_StopFlag; i++)
      {
         MqlRates rates[]; if (CopyRates(_Symbol,PERIOD_D1,time[i],2,rates)==-1) break;
            highLine[i] = rates[0].high;
            lowLine[i]  = rates[0].low;
      }
      return(i);
}
Files:
 
Mladen Rakic:

Use this then :

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_plots   2
#property indicator_label1  "Daily high line"
#property indicator_type1   DRAW_LINE
#property indicator_style1  STYLE_DOT
#property indicator_color1  clrDodgerBlue
#property indicator_label2  "Daily low line"
#property indicator_type2   DRAW_LINE
#property indicator_style2  STYLE_DOT
#property indicator_color2  clrSandyBrown

double highLine[],lowLine[];

int OnInit()
{
   SetIndexBuffer(0,highLine,INDICATOR_DATA);
   SetIndexBuffer(1,lowLine ,INDICATOR_DATA);
   return(INIT_SUCCEEDED);
}
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 (Bars(_Symbol,_Period)<rates_total) return(0);
   int i=0;
      for (i=(int)MathMax(prev_calculated-1,0); i<rates_total && !_StopFlag; i++)
      {
         MqlRates rates[]; if (CopyRates(_Symbol,PERIOD_D1,time[i],2,rates)==-1) break;
            highLine[i] = rates[0].high;
            lowLine[i]  = rates[0].low;
      }
      return(i);
}
Thanks a lot. Is there any way you could make it so that the colour is changeable? Also, is it possible to have it say "YH" and "YL" on the current period like so:  http://prntscr.com/dctrsp
Screenshot
Screenshot
  • prnt.sc
Captured with Lightshot
 
jakubdonovan36:
Thanks a lot. Is there any way you could make it so that the colour is changeable? Also, is it possible to have it say "YH" and "YL" on the current period like so:  http://prntscr.com/dctrsp

Colors are changeable (you can do that in the color properties of the indicator)

 
Mladen Rakic:

Colors are changeable (you can do that in the color properties of the indicator)

Believe me, they're not. I click it but it never allows me to change the colours. It just clicks.  Also, is it possible to have it say "YH" and "YL" on the current period like so:  http://prntscr.com/dctrsp
Screenshot
Screenshot
  • prnt.sc
Captured with Lightshot
 
jakubdonovan36:
Believe me, they're not. I click it but it never allows me to change the colours. It just clicks.  Also, is it possible to have it say "YH" and "YL" on the current period like so:  http://prntscr.com/dctrsp

Believe me - they are (not just the colors, but the style and the line thickness too) :


No idea whatsoever what are you doing, but that is the simplest indicator of them all - there is no limit that would prevent it from changing colors

Use the indicator from my post - do not try to change the code - and then you shall have no problems at all

Reason: