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.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?
One would need a source code file (.mq4) to convert an indicator from MT4 to MT5.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.
I will look into it sometimes in the future, but I have a rather long queue of projects to work on. Perhaps, I someone do it before that time.Hello admin my file mq4 to ex5 help me admin
OK admin thank you very much for your timeI will look into it sometimes in the future, but I have a rather long queue of projects to work on. Perhaps, I someone do it before that time.
//+------------------------------------------------------------------+ //| 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; } } }
It would help to see the MQL5 code you've got so far to check where the errors could be.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
Perhaps, this indicator can do the same for you?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.
This is great, I need that. Thank you so much, Enivid, for your kind help.Perhaps, this indicator can do the same for you?
https://www.earnforex.com/metatrader-indicators/Round-Levels/
Dear Enivid,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.
Use proper code formatting when inserting code. Otherwise it's getting messed up.#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);
}
//+------------------------------------------------------------------+