Adds an indicator with the specified handle into a specified chart window. Indicator and chart should be generated on the same symbol and time frame.
[in] Chart ID. 0 means the current chart.
[in] The number of the chart sub-window. 0 means the main chart window. To add an indicator in a new window, the parameter must be one greater than the index of the last existing window, i.e. equal to CHART_WINDOWS_TOTAL. If the value of the parameter is greater than CHART_WINDOWS_TOTAL, a new window will not be created, and the indicator will not be added.
[in] The handle of the indicator.
The function returns true in case of success, otherwise it returns false. In order to obtain information about the error, call the GetLastError() function. Error 4114 means that a chart and an added indicator differ by their symbol or time frame.
If an indicator that should be drawn in a separate subwindow (for example, built-in iMACD or a custom indicator with specified #property indicator_separate_window property) is applied to the main chart window, it may not be visible though it will still be present in the list of indicators. This means that the scale of the indicator is different from the scale of the price chart, and applied indicator's values do not fit in the displayed range of the price chart. In this case, GetLastError() returns zero code indicating the absence of an error. The values of such "invisible" indicator can be seen in Data Window and received from other MQL5 applications.