Hi Guys,
I tried to migrate code from mql4 to mql5 using info in https://www.mql5.com/en/articles/81. I replaced
“int WindowFind(string name)” with “int WindowFindMQL4(string name)” .
int WindowFindMQL4(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);
}
Execution of line “window=ChartWindowFind();” return -1 for indicator. In the documentation: “It returns the number of the subwindow where the indicator is working.” but I get value -1. https://docs.mql4.com/chart_operations/chartwindowfind
How I can fix it or is it bug in mql5 ?