Hello guys, can you tell me how I can pass the result of an indicator to an ea?
HPFZ_statistica is the indicator, I have to pass the value of the PronosticoFinale[MaxValue], in the expert advisor HPFZ_1.
Check out this link: https://book.mql4.com/samples/icustom for the basic stuff you need to include in your indicator, before it can pass values to an EA.
- book.mql4.com
Check out this link: https://book.mql4.com/samples/icustom for the basic stuff you need to include in your indicator, before it can pass values to an EA.
Thank you very much for your reply, I had read the help of the site, but my problem is to pass the value of the array, in EA. I made the change to create another array line 168. There are parameters to be passed but ICustom function, EA does not work.
Thank you very much for your reply, I had read the help of the site, but my problem is to pass the value of the array, in EA. I made the change to create another array line 168. There are parameters to be passed but ICustom function, EA does not work.
You'll have to somehow move the value you want to pass out to EA into an Indicator_Buffer - which the link I gave shows clearly how to declare and fill up. There is no alternative, unless you want to explore unconventional ways to pass values (e.g. passing via a data file)...
Alternative to that is to re-package your indicator into functions within your EA itself, or into a .mqh file, which you can then "include" into your EA and make direct calls to compute the values you want.
You'll have to somehow move the value you want to pass out to EA into an Indicator_Buffer - which the link I gave shows clearly how to declare and fill up. There is no alternative, unless you want to explore unconventional ways to pass values (e.g. passing via a data file)...
Alternative to that is to re-package your indicator into functions within your EA itself, or into a .mqh file, which you can then "include" into your EA and make direct calls to compute the values you want.
Thanks for your patience, I advice you to create 1 or 2 buffer?. The results of the indicator can be 2. O BUY or SELL
I created 1 buffer, for now
Thanks for your patience, I advice you to create 1 or 2 buffer?. The results of the indicator can be 2. O BUY or SELL
I created 1 buffer, for now
If your calculation results in 1 value per bar (different bars can have different values, no problem), then you'll just need one buffer.
If your calculation results in 1 value per bar (different bars can have different values, no problem), then you'll just need one buffer.
Thanks thanks a lot at line 210 is the value that the buffer returns, now I should write the iCustom function in Ea right? And I should give the result
Thanks thanks a lot at line 210 is the value that the buffer returns, now I should write the iCustom function in Ea right? And I should give the result
Check that your indicator runs without error first - look at terminal->experts to see if there's any error message. After that will be iCustom function - should be straightforward.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello guys, can you tell me how I can pass the result of an indicator to an ea?
HPFZ_statistica is the indicator, I have to pass the value of the PronosticoFinale[MaxValue], in the expert advisor HPFZ_1.
p.s. At line 161 HPFZ_Statistica indicator is the value to be passed in the EA.