Question: Why is the value of 471 returning from the iCustom as zero? Is it indexing one past the limit to end the loop and causing it to become zero?
Pay attention to "int shift" field below.
double iCustom( string symbol, int timeframe, string name, ..., int mode, int shift)
The shift will substitute "i" in your indicator Therefore, if you put "shift=0" in your expert and call indicator it will set "i=0". Since you have written into Array[i]=i your call via iCustom will return "0". If you want to return 471 than you must set "shift=471" in your iCustom call to get value 471 previously written to that location.
You ask for 0 element
===
double TL00 = iCustom(NULL, 0, "custom_test_indicator",A,B,0,0);
Print(" Result: ", TL00);
===
Your 0 element has value 0
===
for(i=0; i <= limit; i++)
{
Array[i] = i;
}
===
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Question: Why is the value of 471 returning from the iCustom as zero? Is it indexing one past the limit to end the loop and causing it to become zero?
Pay attention to "int shift" field below.
double iCustom( string symbol, int timeframe, string name, ..., int mode, int shift)
The shift will substitute "i" in your indicator
Therefore, if you put "shift=0" in your expert and call indicator it will set "i=0".
Since you have written into Array[i]=i your call via iCustom will return "0".
If you want to return 471 than you must set "shift=471" in your iCustom call to get value 471 previously written to that location.
double Array[1000];
But Slawa,
He is referring to the Array as a indicator Buffer 0.
You do not have to specify indicator Buffer size, do you?
There is too hard to read unformatted text. I see. My mistake
===
double TL00 = iCustom(NULL, 0, "custom_test_indicator",A,B,0,0);
Print(" Result: ", TL00);
===
Your 0 element has value 0
===
for(i=0; i <= limit; i++)
{
Array[i] = i;
}
===