Hello Felix,
Your question is about mql4 programming so it is better placed at mql4.com
I think your question is not clear enough, to know what you mean..... so it will be hard to answer
About iCustom
double iCustom( | string symbol, int timeframe, string name, ..., int mode, int shift) |
Calculates the specified custom indicator and returns its value. The custom indicator must be compiled (*.EX4 file) and be in the terminal_directory\experts\indicators directory.
Parameters:
symbol | - | Symbol the data of which should be used to calculate indicator. NULL means current symbol. |
timeframe | - | Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe. |
name | - | Custom indicator compiled program name. |
... | - | Parameters set (if necessary). The passed parameters and their order must correspond with the desclaration order and the type of extern variables of the custom indicator. |
mode | - | Line index. Can be from 0 to 7 and must correspond with the index used by one of SetIndexBuffer functions. |
shift | - | Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago). |
Sample:
double val=iCustom(NULL, 0, "SampleInd",13,1,0); You can say that in the sample the indicator is called 'SampleInd' It has one parameter you can fill in '13' val gives the value of buffer[] no '1' for bar '0' on the chart where the EA is attached so the indicatorvalue is for chartSymbol chart timeframe If you wanna know the val of bar 10 then you have to take another double val_10 = iCustom.....
fjesq:
You could use an array instead and do this on one line of code . .
Is there a way to prevent this and make a shorter code? Or I have to declare each value indepentdenly as I do?
RaptorUK:
You could use an array instead and do this on one line of code . .
You could use an array instead and do this on one line of code . .
Thanks,
After looking to some codes, I thought that was the way.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
iCustom
function to get information from an external indicator. The problem arises when I've to get information of the las 30 bars or more. So, I write:
if the indicator has more than 1 line drawn, I've to repeat the operation above twice or even more times.
Is there a way to prevent this and make a shorter code? Or I have to declare each value indepentdenly as I do?