Problem with custom indicator

 

I am a real new programmer here and i have a custom indicator called Welch Bollinger Band (attached) i am trying to add it to a basic EA but am having no luck.

On a website it was said i could use this code for the EA but just cant seem to get it to work. I have attached a very basic EA i am trying to employ the logic below to.

Thanks

*
* int areWeRanging(int period=0)
*
* Returns 1 for GREEN (ranging)
* Returns -1 for YELLOW ( start/end of range)
* Returns 0 otherwise (no range)
*/

int areWeRanging(int period=0) 
{
 double WelchBBWidth_Green = iCustom(NULL, 0, "WelchBBWidth", 20, 0, 2.0, 20, "x", 100, "x", false, 0, period);
 double WelchBBWidth_Yellow = iCustom(NULL, 0, "WelchBBWidth", 20, 0, 2.0, 20, "x", 100, "x", false, 1, period);

 if ( WelchBBWidth_Green > 0 ) 
 {
   return (1);
 } 
 else if ( WelchBBWidth_Yellow > 0) 
 {
   return (-1);
 }

 return (0);
}

// Check to see if we are coming out of a range. 
// This tells us that the LAST candle was still in a range,
// but the current candle is now breaking free of the range.
if ( areWeRanging(1)==1 && (areWeRanging(0)==-1 || areWeRanging(0)==0) ) 
 { 
Print("We were ranging, but have now broken out of the range! Make a trade if other indicators confirm the breakout!"); 

Here is the indicator

Files:
 
Here is the EA i was trying to add the logic to, thanks everyone
Files:
 
FTM:

I am a real new programmer here and i have a custom indicator called Welch Bollinger Band (attached) i am trying to add it to a basic EA but am having no luck.

What problems are you having ?
 
Hi Raptor I'm trying to incorporate the logic above for the custom Indicator into the attached basic shell EA.
 
FTM:
Hi Raptor I'm trying to incorporate the logic above for the custom Indicator into the attached basic shell EA.
Yeah I know that . . . what have you tried ? what doesn't work ?
 
Hi I have tried to add the code above which I believe assigns a value to the indicator then add in a statement like if ( areWeRanging(1)==1 &&(areWeRanging(0)==-1 || areWeRanging(0)==0) ) Order = SIGNAL_BUY; I get function errors though maybe I am adding it to the wrong area. I have not used a custom I indicator or function before.
 
FTM:
I get function errors
No mind readers here - what is a function error? EXACTLY.