1) Please edit your post and put your coed in the source-box (use the SRC-button)!
2) Put your cursor above iCustom and press F1 and amend the example from there: double val=iCustom(NULL,0,"SampleInd",13,1,0); // NULL ^= _Symbol ans 0 ^= _Period!!
3) Instead of using PERIOD_M30, 50, MODE_SMA as arguments for the indi.call use the variable you defined: MA_TF and and and place them where they have to be acc. to the sequence of the extern/input avriables.
4) Missing arguments are 'replaced' by the default values of the indi.
5) The last two arguments are mode and shift - between the name and these two are the arguments for iCustom - read the help!
2) Put your cursor above iCustom and press F1 and amend the example from there: double val=iCustom(NULL,0,"SampleInd",13,1,0); // NULL ^= _Symbol ans 0 ^= _Period!!
3) Instead of using PERIOD_M30, 50, MODE_SMA as arguments for the indi.call use the variable you defined: MA_TF and and and place them where they have to be acc. to the sequence of the extern/input avriables.
4) Missing arguments are 'replaced' by the default values of the indi.
5) The last two arguments are mode and shift - between the name and these two are the arguments for iCustom - read the help!
BurkhardWille: I am already trying to read the values of an indicator with iCustom, but always I get only 0 with this kind of indicator:
test[i] = iCustom(Symbol(), NULL, "test", 0, 0);
- Use SRC
- Does the indicator create values in buffer zero for bar zero?
- You should write a self documenting function instead of calling iCustom directly, see Detailed explanation of iCustom - MQL4 forum
test[i] = iCustom(NULL, 0, "test", MA_MTF, 0, i);
The first test works with the above code, thank you.
![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
Hi,
I am already trying to read the values of an indicator with iCustom, but always I get only 0 with this kind of indicator:
test.mq4
extern ENUM_TIMEFRAMES MA_TF = PERIOD_M30;
extern int MA_Period = 50;
extern ENUM_MA_METHOD MA_method = MODE_SMA;
test[i] = iCustom(Symbol(), NULL, "test", PERIOD_M30, 50, MODE_SMA, 0, 0);
If I delete the "extern" from the indicator I can read the value from the indicator with the iCustom-function correctly.
test[i] = iCustom(Symbol(), NULL, "test", 0, 0);
Maybe there is a trick?