Play videoPlease edit your post.
For large amounts of code, attach it.
- Detailed explanation of iCustom - MQL4 forum
- It s never the good value.Is meaning less - no mind readers here. Post the values. Attach the indicator. What is GetLastError()
- Try Symbol(), Period.
iCustom(NULL,0,"001",0,0);
Hello
I would like to build my first ea based on one of my indicators. It have only one buffer.
The indicator work good. It shows 1 to open a Buy trade and -1 to open a sale trade. The rest of time it shows 0.
In my ea i want to convert 1/-1 in trade so I do that :
If your indicator doesn't repaint then there is no point checking for it's value for buffer 0 for a shift value of zero . .
If you Indicator only sets the buffer value for bar 1 then you should use a shift of 1 with your iCustom() call . . . you said "one of my indicators." so if it's your Indicator you should know how it works.
Thanks
Yes its one of my indicator, a simple indicator who show when signal cross the zero line on a new candle
if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; for(int i=0; i<limit; i++) { ExtMapBuffer1[i]=0; Un = iCustom(NULL,0,"Indicator",5,9,45,0,0,3,2,i+1); Deux = iCustom(NULL,0,"Indicator",5,9,45,0,0,3,2,i+2); if( Un>Deux && Deux < 0 && Un > 0) ExtMapBuffer1[i]=1; if( Un<Deux && Deux > 0 && Un < 0) ExtMapBuffer1[i]=-1; }
So i know i must use a shift of 0.
There s no error : 0 retourned
So if my indicator is based on a repainting indicator it may be the problem ? But when the market is off and the indicator on the chart, the indicator's value dont mouve so it doesen't repaint no ? The values are calculated and dont change no ?
Thanks
Yes its one of my indicator, a simple indicator who show when signal cross the zero line on a new candle
So i know i must use a shift of 0.
There s no error : 0 retourned
So if my indicator is based on a repainting indicator it may be the problem ? But when the market is off and the indicator on the chart, the indicator's value dont mouve so it doesen't repaint no ? The values are calculated and dont change no ?

- 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 would like to build my first ea based on one of my indicators. It have only one buffer.
The indicator work good. It shows 1 to open a Buy trade and -1 to open a sale trade. The rest of time it shows 0.
In my ea i want to convert 1/-1 in trade so I do that :
My problem it's that wrong. When i see 'Un' It s never the good value.
Where is my error. How to catch the good value ?
Thanks for your help