Is this Normal?

 

Never experienced such before. Say we have 2 mt4 indicators both custom indicators. Then you use iCustom in indicator 2 to fetch some values from indicator one for calculations in some function.

Issue is when I attach indicator 2 to the chart it seems to plot indicator 1 with all its buffers and objects to the chart as if you have attached both but in the indicators list only indicator 2 is listed.

Never experienced this before. Is this normal?

 
Please post in the correct section in future.
I will move this to the MQL4 and Metatrader 4 section.
 

Yes. You attached I2 which calls I1 which means I1 is attached invisibly. All created objects will be shown. I1 buffers should not be.

I just encountered this last week. I removed an indicator but the created object was still there; thought there was something wrong in deInit. When I manually deleted the object and changed TFs it came back; showing that it's actively running. Turns out the EA was calling it.

My solution was easy, the indicator had sub-window input, (where to put the object,) I passed EMPTY which told the indicator not create the object.

 
William Roeder:

Yes. You attached I2 which calls I1 which means I1 is attached invisibly. All created objects will be shown. I1 buffers should not be.

I just encountered this last week. I removed an indicator but the created object was still there; thought there was something wrong in deInit. When I manually deleted the object and changed TFs it came back; showing that it's actively running. Turns out the EA was calling it.

My solution was easy, the indicator had sub-window input, (where to put the object,) I passed EMPTY which told the indicator not create the object.

In my case its pulling comments, trendlines and text objects from Indicator 1. If I remove the Indicator 2, everything including the indicator 1 objects are removed except comments set via the Comment() function in indicator 1.

 
Tonny Obare:

In my case its pulling comments, trendlines and text objects from Indicator 1. If I remove the Indicator 2, everything including the indicator 1 objects are removed except comments set via the Comment() function in indicator 1.

When you call an indicator via iCustom() function, all objects that indicator draws using ObjectCreate(), MT4 will try to create on the chart.

You have to be very careful with this, because there can't exist two objects with the same name on one chart.

So, if you attach to the chart  an indicator that draws objects, and then on the same chart call that indicator via iCustom from EA or other indicator, first instance that is called will draw the objects. Second instance object drawing will fail, unless you have some mechanism that uses different object names (e.g. use some unique number declared in input parameters).

Same problem may occur when deleting objects - first indicator deleted from the chart will delete objects for all other instances, unless you have some unique object naming scheme. 

Simplest solution is William's - declare an input parameter that tells indicator whether it should draw objects.

 
Thanks all for the infos.
 
Anyone with a line of code or info on how I can stop the EA from plotting stuff from indicators linked to it via iCustom?
 
There is no line of code. Just do not do it.
 
William Roeder:
There is no line of code. Just do not do it.

he is asking the code in reference to your post:

"My solution was easy, the indicator had sub-window input, (where to put the object,) I passed EMPTY which told the indicator not create the object."

i'd like to know also

 
Tonny Obare:
Anyone with a line of code or info on how I can stop the EA from plotting stuff from indicators linked to it via iCustom?

As I wrote above - if the indicator uses ObjectCreate() to draw something on the chart, it will show if you call the indicator via iCustom().

As William pointed - you can't prevent that, unless the indicator has some parameter that tells him not to draw objects. 

 
Tonny Obare:
Anyone with a line of code or info on how I can stop the EA from plotting stuff from indicators linked to it via iCustom?

Post a concrete indicator if you want a concrete answer. There is no general rules, it all depends of what is coded in the indicator called.

Just one example, if the indicator draws objects with a pattern in the name like "iCustomIndi*", then your EA could delete them.

Reason: