Topic about mql5 doesn't have to be posted in mql4 section.
Is there an error number ?
How do call it and where is this code executed ? OnInit() ?
The error code was 4113 and appeared during debugging on historical data. When I run the indicator on real data - it worked correctly (no error).
Thank you, Alain Verleyen for your help.
Thank you, Alain Verleyen for your help.
Elo:
The error code was 4113 and appeared during debugging on historical data. When I run the indicator on real data - it worked correctly (no error).
Thank you, Alain Verleyen for your help.
The error code was 4113 and appeared during debugging on historical data. When I run the indicator on real data - it worked correctly (no error).
Thank you, Alain Verleyen for your help.
Use
window=ChartWindowFind(ChartID(),name);
Alain Verleyen:
Use
window=ChartWindowFind(ChartID(),name);
When use debug on history data, the code (in indicator):
int window=-1; if((ENUM_PROGRAM_TYPE)MQLInfoInteger(MQL_PROGRAM_TYPE)==PROGRAM_INDICATOR) { window=ChartWindowFind(); if(window<0) Print("Error executing ChartWindowFind :",GetLastError()); int window2=ChartWindowFind(0,name); if(window2<0) Print("Error executing ChartWindowFind :",GetLastError()); }returns window = -1 and window2 = -1 . When use in script on real data code :
window=ChartWindowFind(ChartID(),name);
returns correct sub window number.
I can confirm that you will encounter this error when backtesting a MQL5 indicator with it on a separate window, whether or not you are using
ChartWindowFind(ChartID(),name);
Or
ChartWindowFind();
This code will only work in MQL4.
Seems like this is a problem that can be raised to service support.
Need a moderator to confirm this. Thanks.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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)" .
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 ?