Objects passed through to an EA?

 

Hi,

I have been working on building an EA and custom indicator. In the custom indicator I set up some buffers to display lines across the chart and a few Objects to show information like the spread, distance between lines, etc. In the top right corner of the chart I have my objects displayed, so it displays something like "Spread: X.X Pips". In my EA I wanted to have the Object information available to me as well so that I can do math with it.

My EA is only a few lines long right now. I basically pull two values from buffers that were in the custom indicator using the iCustom function. I noticed something strange about this. If I open a brand new chart window and do not load anything but my very short EA into it, I get all of my objects showing in the upper right corner that I created from my custom indicator. I don't even have code in my EA to display them onto the screen. I just have the two iCustom functions that are setting a value to a variable.

Does this sound normal? Or am I doing something wrong with the MetaTrader software itself?

Thank you!

F

 
Fuzzy:

Hi,

I have been working on building an EA and custom indicator. In the custom indicator I set up some buffers to display lines across the chart and a few Objects to show information like the spread, distance between lines, etc. In the top right corner of the chart I have my objects displayed, so it displays something like "Spread: X.X Pips". In my EA I wanted to have the Object information available to me as well so that I can do math with it.

My EA is only a few lines long right now. I basically pull two values from buffers that were in the custom indicator using the iCustom function. I noticed something strange about this. If I open a brand new chart window and do not load anything but my very short EA into it, I get all of my objects showing in the upper right corner that I created from my custom indicator. I don't even have code in my EA to display them onto the screen. I just have the two iCustom functions that are setting a value to a variable.

Does this sound normal? Or am I doing something wrong with the MetaTrader software itself?

The iCustom() call calls the Indicator . . . the Indicator draws the Objects. Be careful about doing it this way, the Objects that is, you may have issues when it comes to the Strategy Tester.

Have a read of this: https://www.mql5.com/en/forum/146633
 
RaptorUK:
The iCustom() call calls the Indicator . . . the Indicator draws the Objects. Be careful about doing it this way, the Objects that is, you may have issues when it comes to the Strategy Tester.

Have a read of this: https://www.mql5.com/en/forum/146633

Do you think I would be better off having the custom indicator only do the buffers and doing the object work inside of the EA? Thank you for the link.
 
Fuzzy:

Do you think I would be better off having the custom indicator only do the buffers and doing the object work inside of the EA? Thank you for the link.
Yep, probably, or at least turn them off in the Indicator and on in the EA when you call the Indicator using iCustom(), they you should have no issues in the Strategy Tester and have more options.
Reason: