I'm trying to convert an indicator from mql4 to mql5.
I wrote the function
int WindowFind(string name)
{
int window=-1;
if((ENUM_PROGRAM_TYPE)MQLInfoInteger(MQL5_PROGRAM_TYPE)==PROGRAM_INDICATOR)
{
window=ChartWindowFind();
}
else
{
window=ChartWindowFind(0,name);
if(window==-1) Print(__FUNCTION__+"(): Error = ",GetLastError());
}
return(window);
}
and I receive the error MQL5_PROGRAM_TYPE cannot convert ENUM
Can somebody help me please?
Thanks
I wrote the function
int WindowFind(string name)
{
int window=-1;
if((ENUM_PROGRAM_TYPE)MQLInfoInteger(MQL5_PROGRAM_TYPE)==PROGRAM_INDICATOR)
{
window=ChartWindowFind();
}
else
{
window=ChartWindowFind(0,name);
if(window==-1) Print(__FUNCTION__+"(): Error = ",GetLastError());
}
return(window);
}
and I receive the error MQL5_PROGRAM_TYPE cannot convert ENUM
Can somebody help me please?
Thanks