- Get Color of Gator Indicator
- Machine learning in trading: theory, models, practice and algo-trading
- Mt4 platform is "Not Responding"
You picture shows a colored (BLUE/RED) indicator. Therefor one buffer is set and the other is EMPTY_VALUE. Figure out which buffer corresponds to which color.
Hi, the issue is not in the buffers corresponding to the both colors. I have the code:
//*** value1 = iCustom(NULL,PERIOD_M15,"G8_USD",1,10,60,0,limit+1); value2 = iCustom(NULL,PERIOD_M15,"G8_USD",1,10,60,6,limit+1); //*** if(value1>value2) { aUP_Buffer[limit] = 1; aDOWN_Buffer[limit] = 0; } if(value1<=value2) { aUP_Buffer[limit] = 0; aDOWN_Buffer[limit] = 1; } if ((value1==EMPTY_VALUE)||(value2==EMPTY_VALUE)){ aUP_Buffer[limit] = aUP_Buffer[limit+1]; aDOWN_Buffer[limit] = aDOWN_Buffer[limit+1]; Alert("Default value for (value1==EMPTY_VALUE)||(value2==EMPTY_VALUE)"); } //***
I have used "limit+1" (for iCustom function) because when I use only "limit" in case limit==0 and the new bar is just formed, I get EMPTY_VALUEs for value1 and value2.
Note: I do not get EMPTY_VALUE when I attach or re-compile the indicator.
For example: using the code below:
double Ed = iCustom(NULL,PERIOD_M15,"G8_USD",1,10,60,0,limit); double Ud = iCustom(NULL,PERIOD_M15,"G8_USD",1,10,60,6,limit); // This Alert is to check the velues Alert("limit=",limit," EUR 0 = ",Ed," USD 0 =",Ud);
I got the result when the new Bar has just formed:
Is it possible to get real value in case limit==0 and after the new bar has formed ?
Note: I do not get EMPTY_VALUE when I attach or re-compile the indicator.
Is it possible to get real value in case limit==0 and after the new bar has formed ?- Then your indicator is broken. Post the code.
- Define 'real value'. On a new tick value(0) is the indicator with OHLC all the same, the first tick. Does that have any real meaning?
value1 = iCustom(NULL,PERIOD_M15,"G8_USD",1,10,60,0,limit+1); value2 = iCustom(NULL,PERIOD_M15,"G8_USD",1,10,60,6,limit+1);
I doubt one color is buffer 0 and the other is 6, since you don't display any other lines for [1-5]. Post the code or see Detailed explanation of iCustom - MQL4 forum
- Then your indicator is broken. Post the code.
- Define 'real value'. On a new tick value(0) is the indicator with OHLC all the same, the first tick. Does that have any real meaning?
-
I doubt one color is buffer 0 and the other is 6, since you don't display any other lines for [1-5]. Post the code or see Detailed explanation of iCustom - MQL4 forum
My replies:
1) I have attached the code for both indicators in my first post in zip file.
2) I can not understand your idea. I tried to set waiting time just to see if after a while the value(0) will be real number, but with no success.
3) One color Blue is when value1>value2, the other Red when value1<=value2. And the lines for [1-5] are for other fx pairs /you can see from the code/.
My replies:
1) I have attached the code for both indicators in my first post in zip file.
2) I can not understand your idea. I tried to set waiting time just to see if after a while the value(0) will be real number, but with no success.
3) One color Blue is when value1>value2, the other Red when value1<=value2. And the lines for [1-5] are for other fx pairs /you can see from the code/.
as "real value" I meant in case limit==0 then value1=-0.8447 at 11:00 EEST, when the new bar was appear.
I expect "value1=-0.8447" on the first tick /which number will be different for each call of the function until the tick has fully formed./
as "real value" I meant in case limit==0 then value1=-0.8447 at 11:00 EEST, when the new bar was appear.
I expect "value1=-0.8447" on the first tick /which number will be different for each call of the function until the tick has fully formed./
Thank you, WHRoeder, after your advise I managed to locate and fix the issue.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use