Behavior change in property indicator_chart_window (bug?)

 

Hey all,

I have an indicator that uses

#property indicator_chart_window

This property used to ensure that the same indicator can only be applied once to a chart. Is that not true anymore?

I just checked in MT 5.00 build 3550: the same indicator with same settings is only applied once.
However, it can be applied multiple times if it has different settings. 

In MT 4.00 build 1370, the same indicator can be applied unlimited times, even with the same settings.

Was there any chance in behavior that I missed? Or is that a bug?

Also, is there any other way to ensure that the same indicator can be applied only once to a chart?

Thanks in advance.

 
Eric Emmrich: I have an indicator that uses. This property used to ensure that the same indicator can only be applied once to a chart. Is that not true anymore? I just checked in MT 5.00 build 3550: the same indicator with same settings is only applied once. However, it can be applied multiple times if it has different settings. In MT 4.00 build 1370, the same indicator can be applied unlimited times, even with the same settings.

Was there any chance in behavior that I missed? Or is that a bug? Also, is there any other way to ensure that the same indicator can be applied only once to a chart?

Comparing MT5 behaviour with MT4 behaviour is not a valid comparison. MT5 works differently to MT4, and MT4 is no longer being developed for several years now.

EDIT: Also, that property has never prevented an indicator from being used more than once on a chart (with different inputs in the case of MT5).

EDIT2: The only way you can prevent an indicator from being used more than once on a chart irrespective of the inputs, is for it check during the OnInit event handling, and return INIT_FAILED when it detects such a case.

 
Fernando Carreiro #:

Comparing MT5 behaviour with MT4 behaviour is not a valid comparison. MT5 works differently to MT4, and MT4 is no longer being developed for several years now.

That‘s not the point. And also not true. MT4 build 1370 was released just 2 weeks ago: https://www.metatrader4.com/en/releasenotes/554
 
Eric Emmrich #: That‘s not the point. And also not true. MT4 build 1370 was released just 2 weeks ago: https://www.metatrader4.com/en/releasenotes/554
I repeat, MT4 is not actively being developed. MT4 updates only address critical issues.
Reason: