//+------------------------------------------------------------------+
//|                                        Copyright 2016, PipFinite |
//+------------------------------------------------------------------+
#property copyright     "Pipfinite"
#property link          "http://www.pipfinite.com"
#property version       "3.00"  
#property strict
int shift = 0; //The shift used by this indicator 
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
                                
   //Sell Exit Buffer = 0
   //Buy Exit Buffer = 1
   //Sell Exit - Strong Probability Buffer = 2
   //Buy Exit - Strong Probability Buffer = 3
   
   
   /***Replace "Comment/Print" with your trade function***/  
   
   //Sell Exit - Normal
   if( GetIndicatorValue(0) != 0  && GetIndicatorValue(2) == 0 ) Comment("iCustom: Exit Scope >> Exit Short Trades"); 
   
   //Buy Exit - Normal    
   if( GetIndicatorValue(1) != 0 && GetIndicatorValue(3) == 0 )  Comment("iCustom: Exit Scope >> Exit Long Trades");  
   
   //Sell Exit - Strong
   if( GetIndicatorValue(2) != 0 && GetIndicatorValue(0) != 0 ) Comment("iCustom: Exit Scope >> Exit Short Trades - Strong Probability");  
   
   //Buy Exit - Strong    
   if( GetIndicatorValue(3) != 0 && GetIndicatorValue(1) != 0 ) Comment("iCustom: Exit Scope >> Exit Long Trades - Strong Probability");   
            
         
  }
//+------------------------------------------------------------------+


//+------------------------------------------------------------------+
//| Get Indicator Buffer Value                                       |
//+------------------------------------------------------------------+
double GetIndicatorValue(int buffer)
{

    return ( iCustom (
     
                              NULL,                                                                
                              0,                                     
                              "\\Market\\PipFinite_Exit_Scope", //File Path of indicator 
                                                         
                              //NEXT LINES WILL BE INDCATOR INPUTS                                  
                              " ",
                              1.0,
                              1000, 
                              //END FOR INPUTS
                                                              
                              buffer,//Index Buffer                               
                              shift                                    
                              
                       ));

}  

