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
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
Thanks for that RaptorUK, however it is the actual coding that I am having difficulties with. I am very new to MQL4, and have only been doing it a couple of months, and am still learning - so I am needing a simple explanation of the coding and how to set it up in the indicator.
Thanks
Mike
RaptorUK:
In the iCustom call it can also pass any extern variables that are needed to setup the Indicator as applicable
Correction ...
In the iCustom call it
MUST
also pass any extern variables that are needed to set up the Indicator as applicable.
Thanks for that RaptorUK, however it is the actual coding that I am having difficulties with. I am very new to MQL4, and have only been doing it a couple of months, and am still learning - so I am needing a simple explanation of the coding and how to set it up in the indicator.
Thanks
Mike
What you are evidently missing here is that you do not use iCustom in the indicator. The indicator is a stand alone piece of code. Your EA can now sneak a peek at what is happening in the indicator by using the iCustom command.
Correction ...
In the iCustom call it
MUST
also pass any extern variables that are needed to set up the Indicator as applicable.Correction ...
In the iCustom call it
MUST
also pass any extern variables that are needed to set up the Indicator as applicable.I have read different statements regarding this . . . I have never used iCustom so I can't speak from personal experience . . . but does your statement hold true even when the default extern variables are what are needed ?
Yes. The problem is that the last two parameters of the iCustom are crucial so you cannot omit anything.
One can leave the extern values blank. The iCustom() indicator would then use it's default values.
.... I am very new to MQL4, and have only been doing it a couple of months, and am still learning - so I am needing a simple explanation of the coding and how to set it up in the indicator....
I recognize the indicator as BarrowBoy's Trend_Or_Range indicator. The key to understanding Indicators is understanding Arrays. I had a healthy fear of Arrays until I realized I've been using them since day-1 when using mql4. OrderSelect() and Ma_CrossOver Logics are some of the first things one have to understand in order to make any EA.
As Raptor and Dabber have pointed out. They're just a Series of Numbers counted Backwards or Forward. Indicators have the added value of utilizing allot more visual tools then Experts. Since this Custom Indicator employs allot of standard Indicators like Standard Deviation and Moving Averages, I recommend doing these calculations within the EA.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- 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.
I am new to coding, and am learning a lot, however I have struck something that I cannot get my head around at the moment. I am trying to call the result of a test in one of my indicators, to an ea, so it can add it to its own tests before placing a trade. The ea is a simple moving average cross. The indicator is a trending or ranging indicator. I have attached the indicator code.
I would like help, and if possible explained simply so I can get my head around how it should be setup inside the indicator, for the ea to recognise it. Once I have the indicator sorted, I will move onto the ea.
The indicator has two tests, in which I would like to add the iCustom function. At this stage, I am only wanting to add it in one test, it doesn't matter which, as I am trying to understand it. Anyone willing to help and explain it simply, would be greatly beneficial - I cannot seem to find anything on-line that explains it so I understand it. The result of the test could just simply be "true".
Thanks in advance for you time.
Mike