Can an EA get a value from an indicator on the chart - page 2

John Pringle  
Simon Gniadkowski:
If you don't have access to the Indicator source code then no it isn't possible.

What if you do have the source code for the indicator?

William Roeder  
johnpringle: What if you do have the source code for the indicator?

Then you have modify it to output its inputs to terminal variables so the EA can read them and call iCustom with the correct parameters.

michaelaris  
William Roeder #:

Then you have modify it to output its inputs to terminal variables so the EA can read them and call iCustom with the correct parameters.

Hi, William.
Is it possible if the case is like this:
I've got an indicator file, for example MyIndi.mq4, and I want the value of it: string Signal="BUY" becoming the output, which I can use it as the input of my EA file "MyEA.mq4".
How this MyEA.mq4 can read this string Signal="BUY".
I do really appreciate for your help.
Thank you.
William Roeder  
michaelaris #: How this MyEA.mq4 can read this string Signal="BUY".

It can't. You have to code something that the EA can read. Create a buffer with 0, or ±1.

Fernando Carreiro  
michaelaris #: Is it possible if the case is like this: I've got an indicator file, for example MyIndi.mq4, and I want the value of it: string Signal="BUY" becoming the output, which I can use it as the input of my EA file "MyEA.mq4".
How this MyEA.mq4 can read this string Signal="BUY".
As long as the Custom Indicator uses buffers for plotting out the indicator, these buffer values can be read via the iCustom function in your EA.
iCustom - Technical Indicators - MQL4 Reference
iCustom - Technical Indicators - MQL4 Reference
  • docs.mql4.com
iCustom - Technical Indicators - MQL4 Reference
Ivan Titov  
Fernando Carreiro #:
As long as the Custom Indicator uses buffers for plotting out the indicator, these buffer values can be read via the iCustom function in your EA.

There is a way to read it from a chart. However, it cannot be a string. Just a number.

Keith Watford  
Ivan Titov #:

There is a way to read it from a chart. However, it cannot be a string. Just a number.

If there is a text object drawn by an indicator on the chart, then the EA can read it ( as long as the object name is known or can be worked out).

Not ideal, but sometimes it is the only way, especially if the source code for the indicator that draws the object is not available.

Keith Watford  
michaelaris #:
Hi, Ivan.
So, if I turn the string "BUY" into integer 0 or 1 as the buffer value, and let the iCustom read it, then it will become possible for EA to read it. Right?

You have already had this confirmed by both William and Fernando.

michaelaris  
Keith Watford #:

You have already had this confirmed by both William and Fernando.

I've learned new lesson today.
Thank you for your help, William, Fernando, Ivan, & Keith.