You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Thanks Dabbler. I have attached the full EA and Indicator. I have read the statements on iCustom, and understand everything apart from the parameters part,
What goes into the parameters are the values that you want to use for the extern variables in the Indicator . . . in this case these . . .
Let's look at the help file again.
looking at the definition of the ... part.
You have 9 extern variables and therefore need 9 parameters in the correct order and with the correct type
Easy peasy.
Then you ask "Also, is there any way to physically see what values are being sent to the EA?"
Sure.
Yep, except Null is a typo.
Start with the indicator and generate the code.
#define SFX "SFX"
#define since it is constant. Define it once so there's no typos.Thank you for your response. so
ExtMapBuffer1[i+3] = lower_fractal_7b; could be used as calculated value when reversal fractal is called?
Yes. All the time. I'm talking about Extern Values. And I'm guessing you're talking about Buffers.
Yes UBZEN,
I also tried what you suggested and it did return the value as what is stated in my indicator....
it is simply, easy to add or used with out all of those long parameters.... especially the one with arrays.......
I could get lost in compiling the parameters not you guy's............ the PRO'S here
thanks very much.... I was looking this this answer for a few days
iCustom allows you to access your Indicators buffers . . . it's that simple.
For example, you are writing an EA that has a strategy based on 2 Indicators, you could build the Indicator code into the EA, that is possible but iss a little involved as Indicator buffers don't work on EAs, you would have to use arrays and handle them in an "as series" fashion . . . the alternative is to have the Indicators running and access their buffers from the EA . . . this is what iCustom facilitates. No changes are needed to the Indicators . . . . the EA simply accesses the buffers it needs at the shift values it needs. In the iCustom call it can also pass any extern variables that are needed to setup the Indicator as applicable
Dear RaptorUK (and others who might be able to help),
in the quoted post you describe two ways to use custom indicator values in an EA. The first is with iCustom which i'm already aware of. The second is one i would really like to learn more about because i've tried internalizing the code of custom indicators into the body of the main indicator before but without succes. You see, when i turned an indicator into a function and let it return its most current value (the value in element 0) i always get the EMPTY_VALUE for a double variable instead of the calculated value itself. I tried using the iCustom function, setting the shift to 0, the most recent value. When i do this the terminal starts by returning 0 coupled with the error STACK OVERFLOW in the experts tab. On the second tick it does return a value but after every couple of printed [0] values it gives another STACK OVERFLOW error, this keeps recurring over and over again. Because iCustom returns the value 0 and STACK OVERFLOW on first inititialization (and only after starts giving correct values) i can't use icustom in my EA because it calls the icustom for a different symbol every time Start() gets activated and it calls multiple custom indicators for that. This causes the EA to crash. I don't understand why i get a STACK OVERFLOW error whenever i want icustom to return the most recent value [0] but i would sure like to know. I prefer however to internalize the code of all the indicators that are being called by transforming them into functions inside the main indicator. You said something about using arrays and handle them in an "as series fashion". Could you please elaborate this?
I have added an mq4 file of the classic ADX.mq4 indicator. Inside the value of ADX gets printed twice. Once by Icustom, and secondly by the ADX code that has been turned into a function inside the ADX. Icustom(ADX) returns a value but ADX(symbol,timeframe) does not. It keeps returning the same EMPTY_VALUE of 247456457457 or something over and over again. Please explain why this is happening and how i can remedy this both in an EA template as in a mq4 custom indicator file.
Kind regards and thanks in advance
PS: attach file doesen't seem to be working. But you can download both the CallicustomvsFunction example indicator as the ADX custom indicator from http://www.forexfactory.com/showthre...37#post8569537 (my name there is Codix)
In the above posts (https://www.mql5.com/en/forum/138577/page3#627521 and https://www.mql5.com/en/forum/138577/page3#797401) I used dots and word separators.
That isn't allowed since February 3, 2014 (Build 600) Use an underscore or camel case.
Use an underscore or camel case.