//+------------------------------------------------------------------+
//|                                          3EMAS Signals v0.1 .mq4 |
//|                                  Copyright © 2006, Forex-TSD.com |
//|                                                Written by nnjeim |   
//|                                                                  |                                      
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Forex-TSD.com "
#property link      "http://www.forex-tsd.com/"


#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 1 
#property indicator_buffers 3
#property indicator_color1 MediumSeaGreen
#property indicator_color2 DarkSlateGray
#property indicator_color3 DarkSlateGray
//---- input parameters

extern int RSIHi=14;
extern int RSIHiPrice=2;
extern int RSITypical=14;
extern int RSITypicalPrice=5;
extern int RSILow=14;
extern int RSILowPrice=2;



//---- buffers
double Yes[];
double No[];
double StillNo[];


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,2,MediumSeaGreen);
  // SetIndexArrow(0,241);
   SetIndexBuffer(0,Yes);
  // SetIndexEmptyValue(0,0.0);
   
   SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,2,DarkSlateGray);
  // SetIndexArrow(1,242);
   SetIndexBuffer(1,StillNo);
  // SetIndexEmptyValue(1,0.0);
   
   SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,2,DarkSlateGray);
//----
   SetIndexBuffer(2,StillNo);
   return(0);
   IndicatorShortName("3RSI");
  }

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   for(int i=0; i < 300; i++)
 //  Yes[i]=0;
  // No[i]=0;
  // StillNo[i]=0;
   //double RSIHi=0.0,RSITypical=0.0,RSILow=0.0;

      {
      RSIHi=iRSI(NULL,0,RSIHi,PRICE_HIGH,i);
      RSITypical=iRSI(NULL,0,RSITypical,PRICE_TYPICAL,i);
      RSILow=iRSI(NULL,0,RSILow,PRICE_LOW,i);
      

      
      
      Yes[i]=0;
      No[i]=0;
      StillNo[i]=0;
      if ((RSIHi>RSITypical) && (RSITypical>RSILow)) Yes[i]=1;
      if ((RSIHi>RSILow)  &&  (RSILow>RSITypical)) No[i]=1;
      if (Yes[i]==0  &&  No[i]==0)  {StillNo[i]=1;}
     
      }
   return(0);
  }
      
//+------------------------------------------------------------------+