Vrak

Trader
Apr 23, 2024
3
0
7
24
Hello, I'm new here. I need to convert this indicator, can anyone do this for me or give me a tip on how to convert mq4 to mq5?
 

Attachments

  • Averagew1.mq4
    6.9 KB · Views: 8
Last edited by a moderator:

Enivid

Administrator
Staff member
Nov 30, 2008
19,240
1,507
144
Odesa
www.earnforex.com
Hello, I'm new here. I need to convert this indicator, can anyone do this for me or give me a tip on how to convert mq4 to mq5?
It's not that difficult to convert. It requires just a few changes since it's coded in a highly compatible manner. The only question is why would you need it? It's a simple MA/price cross indicator. There are hundreds indies like that, including for MT5.
 

sever-seven

Trader
Apr 25, 2024
2
0
6
53
Hello.
Is it possible to convert these indicators to MT5?
 

Attachments

  • i-Profit v2-2-2.mq4
    60.7 KB · Views: 11
  • TradeInfo.mq4
    65.7 KB · Views: 7

Rambo.Forex

Trader
May 1, 2024
1
0
6
32
Hi guys, I would like to know if anyone can convert this indicator for MT5.
This allows you to know the highest and lowest and take trades accordingly. This is a very useful indicator that has already helped a friend of mine make A LOT of money with it. Thanks in advance if anyone manages to convert it.
 

Attachments

  • MBFX-Snatcher.ex4
    10.5 KB · Views: 13

Enivid

Administrator
Staff member
Nov 30, 2008
19,240
1,507
144
Odesa
www.earnforex.com
Hi guys, I would like to know if anyone can convert this indicator for MT5.
This allows you to know the highest and lowest and take trades accordingly. This is a very useful indicator that has already helped a friend of mine make A LOT of money with it. Thanks in advance if anyone manages to convert it.
One would need a source code file (.mq4) to convert an indicator from MT4 to MT5.
 

Jajaofopobo

Trader
Sep 6, 2021
70
7
24
MQL4:
//+------------------------------------------------------------------+
//|                                                 REV.mq4                                              |
//|                        Copyright 2024, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com                                   |
//+------------------------------------------------------------------+
#property copyright "Copyright 2024, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
#property indicator_chart_window
 
double Mercy;
double Mercy1;
 
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
   Mercy = EMPTY_VALUE;
   Mercy1 = EMPTY_VALUE;
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
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[])
  {
   // No calculation needed for this custom indicator in OnCalculate
   return(rates_total);
  }
//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
   double Senkou_SpanA = iCustom(NULL, 0, "Ichimoku", 2, 1);
   double Senkou_SpanB = iCustom(NULL, 0, "Ichimoku", 3, 1);
 
   if (Senkou_SpanB != EMPTY_VALUE && Senkou_SpanA != EMPTY_VALUE)
     {
      if (Mercy != Senkou_SpanB || Mercy1 != Senkou_SpanA) // Check if values have changed
        {
         if (Senkou_SpanB > Senkou_SpanA)
           {
            Alert(Symbol() + " Blue cloud, Buy Cloud");
            SendNotification(Symbol() + " Blue cloud, Buy Cloud");
           }
         else if (Senkou_SpanB < Senkou_SpanA)
           {
            Alert(Symbol() + " Red cloud, Sell Cloud");
            SendNotification(Symbol() + " Red cloud, Sell Cloud");
           }
         Mercy = Senkou_SpanB;
         Mercy1 = Senkou_SpanA;
        }
     }
  }

This indicator reads the indicator values and sends alert, i have tried to convert this code to mt5 but it is not giving me the right values from the indicator
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,240
1,507
144
Odesa
www.earnforex.com
MQL4:
//+------------------------------------------------------------------+
//|                                                 REV.mq4                                              |
//|                        Copyright 2024, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com                                   |
//+------------------------------------------------------------------+
#property copyright "Copyright 2024, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
#property indicator_chart_window
 
double Mercy;
double Mercy1;
 
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
   Mercy = EMPTY_VALUE;
   Mercy1 = EMPTY_VALUE;
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
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[])
  {
   // No calculation needed for this custom indicator in OnCalculate
   return(rates_total);
  }
//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
   double Senkou_SpanA = iCustom(NULL, 0, "Ichimoku", 2, 1);
   double Senkou_SpanB = iCustom(NULL, 0, "Ichimoku", 3, 1);
 
   if (Senkou_SpanB != EMPTY_VALUE && Senkou_SpanA != EMPTY_VALUE)
     {
      if (Mercy != Senkou_SpanB || Mercy1 != Senkou_SpanA) // Check if values have changed
        {
         if (Senkou_SpanB > Senkou_SpanA)
           {
            Alert(Symbol() + " Blue cloud, Buy Cloud");
            SendNotification(Symbol() + " Blue cloud, Buy Cloud");
           }
         else if (Senkou_SpanB < Senkou_SpanA)
           {
            Alert(Symbol() + " Red cloud, Sell Cloud");
            SendNotification(Symbol() + " Red cloud, Sell Cloud");
           }
         Mercy = Senkou_SpanB;
         Mercy1 = Senkou_SpanA;
        }
     }
  }

This indicator reads the indicator values and sends alert, i have tried to convert this code to mt5 but it is not giving me the right values from the indicator
It would help to see the MQL5 code you've got so far to check where the errors could be.
 

marek1952

Trader
Jul 10, 2024
1
0
6
72
Hello admin my file mq4 to ex5 help me admin. This is a simple volume indicator. But a reworked version of MTF. I know that Speed Dir will not be displayed and I have to accept that.
 

Attachments

  • TicksSeparateVolumeDif MTF.mq4
    8.1 KB · Views: 4
  • TicksSeparateVolumeDif MTF.ex4
    27.4 KB · Views: 4

Zeyna39

Newbie
Aug 11, 2024
2
0
1
23
Hello, I modified this MQL4 code with the help of ChatGPT and adjusted it to my liking, but I couldn't convert it to MQL5. I tried a few methods I found online, but they didn't work. Is there anyone who can help?
 

Attachments

  • Emir Fractals.mq4
    22.9 KB · Views: 4

Bob124

Newbie
Aug 15, 2024
4
0
2
Hi, there. I'm new in the forum. Could someone help convert this attached MT4 to MT5?
It helps me immediately notice the change price. Thank you in advance for your kind help.
 

Attachments

  • horizontal_grid_lines.mq4
    5.8 KB · Views: 4

Enivid

Administrator
Staff member
Nov 30, 2008
19,240
1,507
144
Odesa
www.earnforex.com
  • 👍
Reactions: Bob124

Bob124

Newbie
Aug 15, 2024
4
0
2
This is great, I need that. Thank you so much, Enivid, for your kind help.
One thing of the Round-Levels indicator that I'd like you to help edit is disable the value (or price label) of the line on the vertical price. The price label of the indicator overlaps with the vertical price.
Dear Enivid,
I'd just like to get you informed that I can disable the price label of the Round-Levels indicator by just change True/False on LinesAsBackground.
Regards,
 
  • 🚀
Reactions: Enivid

Vrak

Trader
Apr 23, 2024
3
0
7
24
#property copyright "Copyright © 2021 KIKOS."

#property version "2.00"
#property description ""

#include <stdlib.mqh>
#include <stderror.mqh>

//--- indicator settings
#property indicator_chart_window
#property indicator_buffers 4

#property indicator_type1 DRAW_ARROW
#property indicator_width1 3
#property indicator_color1 Green


#property indicator_type2 DRAW_ARROW
#property indicator_width2 2
#property indicator_color2 Snow


#property indicator_type3 DRAW_ARROW
#property indicator_width3 3
#property indicator_color3 Red


#property indicator_type4 DRAW_ARROW
#property indicator_width4 2
#property indicator_color4 Snow
string Text_to_Write = "Kikos 99/1!";
color Text_Color = Yellow;
int Font_Size = 20;
string Font_Name = "Arial Black";
int WindowCorner = 1;
int YPos = 5;
int XPos = 5;
string UniqueID = "text1";
int liveAccountNumber = 1;
extern bool UseAlert = true;

//--- indicator buffers
double Buffer1[];
double Buffer2[];
double Buffer3[];
double Buffer4[];

double myPoint; //initialized in OnInit

void myAlert(string type, string message)
{
if(type == "print")
Print(message);
else if(type == "error")
{
Print(type+" | Portafolio @ "+Symbol()+","+IntegerToString(Period())+" | "+message);
}
else if(type == "order")
{
}
else if(type == "modify")
{
}
}

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{

if(TimeCurrent()>D'08.02.2030'){
Alert("contacte a portafolio");
Comment("vencio");
Print("vencio");
ExpertRemove();

return(INIT_SUCCEEDED);
}
IndicatorBuffers(4);
SetIndexBuffer(0, Buffer1);
SetIndexEmptyValue(0, EMPTY_VALUE);
SetIndexArrow(0, 221);
SetIndexBuffer(1, Buffer2);
SetIndexEmptyValue(1, EMPTY_VALUE);
SetIndexArrow(1, 108);
SetIndexBuffer(2, Buffer3);
SetIndexEmptyValue(2, EMPTY_VALUE);
SetIndexArrow(2, 222);
SetIndexBuffer(3, Buffer4);
SetIndexEmptyValue(3, EMPTY_VALUE);
SetIndexArrow(3, 108);
//initialize myPoint
myPoint = Point();
if(Digits() == 5 || Digits() == 3)
{
myPoint *= 10;
}
return(INIT_SUCCEEDED);
}

//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
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[])
{
int limit = rates_total - prev_calculated;
//--- counting from 0 to rates_total
ArraySetAsSeries(Buffer1, true);
ArraySetAsSeries(Buffer2, true);
ArraySetAsSeries(Buffer3, true);
ArraySetAsSeries(Buffer4, true);
//--- initial zero
if(prev_calculated < 1)
{
ArrayInitialize(Buffer1, EMPTY_VALUE);
ArrayInitialize(Buffer2, EMPTY_VALUE);
ArrayInitialize(Buffer3, EMPTY_VALUE);
ArrayInitialize(Buffer4, EMPTY_VALUE);
}
else
limit++;

static datetime timeLastAlert = NULL;





{
ObjectCreate(UniqueID, OBJ_LABEL, 0, 0, 0);
ObjectSet(UniqueID, OBJPROP_CORNER, WindowCorner);
ObjectSet(UniqueID, OBJPROP_XDISTANCE, XPos);
ObjectSet(UniqueID, OBJPROP_YDISTANCE, YPos);
ObjectSet(UniqueID, OBJPROP_BACK, FALSE);
ObjectSetText(UniqueID, Text_to_Write, Font_Size, Font_Name, Text_Color);

}
//--- main loop
for(int i = limit-1; i >= 0; i--)
{
if (i >= MathMin(5000-1, rates_total-1-50)) continue; //omit some old rates to prevent "Array out of range" or slow calculation

//Indicator Buffer 1
if(iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 3+i) > 1 //Relative Strength Index > fixed value
&& iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 2+i) > 1 //Relative Strength Index > fixed value
&& iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 1+i) < 1 //Relative Strength Index < fixed value
)
{
Buffer1 = Low; //Set indicator value at Candlestick Low
}
else
{
Buffer1 = EMPTY_VALUE;
}
//Indicator Buffer 2
if(iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 2+i) > 1 //Relative Strength Index > fixed value
&& iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 1+i) > 1 //Relative Strength Index > fixed value
&& iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, i) < 1 //Relative Strength Index < fixed value
)
{
Buffer2 = Low; //Set indicator value at Candlestick Low
if( UseAlert && i == 0 && Time[0] != timeLastAlert )
{
Alert(Symbol()," M",Period()," Se ligue ABESTADO");
timeLastAlert = Time[0];
}
}
else
{
Buffer2 = EMPTY_VALUE;
}
//Indicator Buffer 3
if(iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 3+i) < 99 //Relative Strength Index < fixed value
&& iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 2+i) < 99 //Relative Strength Index < fixed value
&& iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 1+i) > 99 //Relative Strength Index > fixed value
)
{
Buffer3 = High; //Set indicator value at Candlestick Low
}
else
{
Buffer3 = EMPTY_VALUE;
}
//Indicator Buffer 4
if(iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 2+i) < 99 //Relative Strength Index < fixed value
&& iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 1+i) < 99 //Relative Strength Index < fixed value
&& iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, i) > 99 //Relative Strength Index > fixed value
)
{
Buffer4 = High; //Set indicator value at Candlestick Low
if( UseAlert && i == 0 && Time[0] != timeLastAlert )
{
Alert(Symbol()," M",Period(),"Se ligue ABESTADO");
timeLastAlert = Time[0];
}
}
else
{
Buffer4 = EMPTY_VALUE;
}
}
return(rates_total);
}
//+------------------------------------------------------------------+
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,240
1,507
144
Odesa
www.earnforex.com
#property copyright "Copyright © 2021 KIKOS."

#property version "2.00"
#property description ""

#include <stdlib.mqh>
#include <stderror.mqh>

//--- indicator settings
#property indicator_chart_window
#property indicator_buffers 4

#property indicator_type1 DRAW_ARROW
#property indicator_width1 3
#property indicator_color1 Green


#property indicator_type2 DRAW_ARROW
#property indicator_width2 2
#property indicator_color2 Snow


#property indicator_type3 DRAW_ARROW
#property indicator_width3 3
#property indicator_color3 Red


#property indicator_type4 DRAW_ARROW
#property indicator_width4 2
#property indicator_color4 Snow
string Text_to_Write = "Kikos 99/1!";
color Text_Color = Yellow;
int Font_Size = 20;
string Font_Name = "Arial Black";
int WindowCorner = 1;
int YPos = 5;
int XPos = 5;
string UniqueID = "text1";
int liveAccountNumber = 1;
extern bool UseAlert = true;

//--- indicator buffers
double Buffer1[];
double Buffer2[];
double Buffer3[];
double Buffer4[];

double myPoint; //initialized in OnInit

void myAlert(string type, string message)
{
if(type == "print")
Print(message);
else if(type == "error")
{
Print(type+" | Portafolio @ "+Symbol()+","+IntegerToString(Period())+" | "+message);
}
else if(type == "order")
{
}
else if(type == "modify")
{
}
}

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{

if(TimeCurrent()>D'08.02.2030'){
Alert("contacte a portafolio");
Comment("vencio");
Print("vencio");
ExpertRemove();

return(INIT_SUCCEEDED);
}
IndicatorBuffers(4);
SetIndexBuffer(0, Buffer1);
SetIndexEmptyValue(0, EMPTY_VALUE);
SetIndexArrow(0, 221);
SetIndexBuffer(1, Buffer2);
SetIndexEmptyValue(1, EMPTY_VALUE);
SetIndexArrow(1, 108);
SetIndexBuffer(2, Buffer3);
SetIndexEmptyValue(2, EMPTY_VALUE);
SetIndexArrow(2, 222);
SetIndexBuffer(3, Buffer4);
SetIndexEmptyValue(3, EMPTY_VALUE);
SetIndexArrow(3, 108);
//initialize myPoint
myPoint = Point();
if(Digits() == 5 || Digits() == 3)
{
myPoint *= 10;
}
return(INIT_SUCCEEDED);
}

//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
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[])
{
int limit = rates_total - prev_calculated;
//--- counting from 0 to rates_total
ArraySetAsSeries(Buffer1, true);
ArraySetAsSeries(Buffer2, true);
ArraySetAsSeries(Buffer3, true);
ArraySetAsSeries(Buffer4, true);
//--- initial zero
if(prev_calculated < 1)
{
ArrayInitialize(Buffer1, EMPTY_VALUE);
ArrayInitialize(Buffer2, EMPTY_VALUE);
ArrayInitialize(Buffer3, EMPTY_VALUE);
ArrayInitialize(Buffer4, EMPTY_VALUE);
}
else
limit++;

static datetime timeLastAlert = NULL;





{
ObjectCreate(UniqueID, OBJ_LABEL, 0, 0, 0);
ObjectSet(UniqueID, OBJPROP_CORNER, WindowCorner);
ObjectSet(UniqueID, OBJPROP_XDISTANCE, XPos);
ObjectSet(UniqueID, OBJPROP_YDISTANCE, YPos);
ObjectSet(UniqueID, OBJPROP_BACK, FALSE);
ObjectSetText(UniqueID, Text_to_Write, Font_Size, Font_Name, Text_Color);

}
//--- main loop
for(int i = limit-1; i >= 0; i--)
{
if (i >= MathMin(5000-1, rates_total-1-50)) continue; //omit some old rates to prevent "Array out of range" or slow calculation

//Indicator Buffer 1
if(iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 3+i) > 1 //Relative Strength Index > fixed value
&& iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 2+i) > 1 //Relative Strength Index > fixed value
&& iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 1+i) < 1 //Relative Strength Index < fixed value
)
{
Buffer1 = Low; //Set indicator value at Candlestick Low
}
else
{
Buffer1 = EMPTY_VALUE;
}
//Indicator Buffer 2
if(iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 2+i) > 1 //Relative Strength Index > fixed value
&& iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 1+i) > 1 //Relative Strength Index > fixed value
&& iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, i) < 1 //Relative Strength Index < fixed value
)
{
Buffer2 = Low; //Set indicator value at Candlestick Low
if( UseAlert && i == 0 && Time[0] != timeLastAlert )
{
Alert(Symbol()," M",Period()," Se ligue ABESTADO");
timeLastAlert = Time[0];
}
}
else
{
Buffer2 = EMPTY_VALUE;
}
//Indicator Buffer 3
if(iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 3+i) < 99 //Relative Strength Index < fixed value
&& iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 2+i) < 99 //Relative Strength Index < fixed value
&& iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 1+i) > 99 //Relative Strength Index > fixed value
)
{
Buffer3 = High; //Set indicator value at Candlestick Low
}
else
{
Buffer3 = EMPTY_VALUE;
}
//Indicator Buffer 4
if(iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 2+i) < 99 //Relative Strength Index < fixed value
&& iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 1+i) < 99 //Relative Strength Index < fixed value
&& iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, i) > 99 //Relative Strength Index > fixed value
)
{
Buffer4 = High; //Set indicator value at Candlestick Low
if( UseAlert && i == 0 && Time[0] != timeLastAlert )
{
Alert(Symbol()," M",Period(),"Se ligue ABESTADO");
timeLastAlert = Time[0];
}
}
else
{
Buffer4 = EMPTY_VALUE;
}
}
return(rates_total);
}
//+------------------------------------------------------------------+
Use proper code formatting when inserting code. Otherwise it's getting messed up.