getting the return value from non line indicator

Luandre Ezra  
Hi all, I have the candlestick pattern indicator that I want to use in my EA. This indicator will alert me if there's a candlestick pattern that occur on the chart. I tried to use function below to retrieve it and I understand that the function is not working because iCustom return value is a double (in this case is the price of the candle) and what I want to retrieve if it's bullish or bearish pattern.
int CandlestickPattern(int shift=0){
   int result = 0;
   bool patternUp = iCustom(Symbol(),PERIOD_CURRENT,"Pattern_Recognition_Master_v3",0,shift);
   bool patternDown = iCustom(Symbol(),PERIOD_CURRENT,"Pattern_Recognition_Master_v3",1,shift);
   if(patternUp == true)
      result = 1;
   else if(patternDown == true)
      result = 2;
Then I change the code to search for every candle using loop function. I looked to the indicator buffer and notice that buffer 0 is for bearish pattern and 1 for bullish pattern. Then I code the code below.
int CandlestickPattern2(int shift=0){
   int result = 0;
   for(int i=0; i<Bars; i++){
      double bearishPattern  = iCustom(Symbol(),PERIOD_CURRENT,"Pattern_Recognition_Master_v3",0,shift);
      double bullishPattern  = iCustom(Symbol(),PERIOD_CURRENT,"Pattern_Recognition_Master_v3",1,shift);
      if(bullishPattern>0) result=1;
      if(bearishPattern>0) result=2;
   return (result);

It looks promising but the result is not what I expected. For every pair the result would be the same which is the bearish pattern (doesn't care if bullish pattern that occur). Is there a way around so I could receive the  correct value from the buffer? or retrieve the alert message as a string data that can be use to check if it's a bullish or bearish pattern?