AbsoluteStrength_exit





//+------------------------------------------------------------------+
//|                                        AbsoluteStrength_exit.mq4 |
//|                                        Newdigital                |
//|                                        Modified from Fisher_exit |
//|                                        created by Kalenzo        |
//|                                                  simone@konto.pl |
//+------------------------------------------------------------------+
#property copyright "Kalenzo"
#property link      "simone@konto.pl"
#property indicator_buffers 2
#property indicator_color1 Aqua
#property indicator_color2 Magenta
extern int       Mode   =  0; // 0-RSI method; 1-Stoch method
extern int       Length = 10; // Period
extern int       Smooth =  5; // Period of smoothing
extern int       Signal =  5; // Period of Signal Line
extern int       Price  =  0; // Price mode : 0-Close,1-Open,2-High,3-Low,4-Median,5-Typical,6-Weighted
extern int       ModeMA =  3; // Mode of Moving Average
double exitL[],exitS[];

#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_ARROW,EMPTY,1);
   SetIndexStyle(1,DRAW_ARROW,EMPTY,1);
   
   SetIndexBuffer(0,exitL);
   SetIndexBuffer(1,exitS);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int limit;
   int counted_bars=IndicatorCounted();
   if(counted_bars<0) counted_bars=0;
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
//----
   for(int i = 0 ;i < limit ;i++)
   {
      double f1u = iCustom(Symbol(),0,"AbsoluteStrength_v1",Mode,Length,Smooth,Signal,Price,ModeMA,0,i);//up
      double f2u = iCustom(Symbol(),0,"AbsoluteStrength_v1",Mode,Length,Smooth,Signal,Price,ModeMA,0,i+1);//up
      double f3u = iCustom(Symbol(),0,"AbsoluteStrength_v1",Mode,Length,Smooth,Signal,Price,ModeMA,0,i+2);//up
      
      double f1us = iCustom(Symbol(),0,"AbsoluteStrength_v1",Mode,Length,Smooth,Signal,Price,ModeMA,2,i);//up_sig
      double f2us = iCustom(Symbol(),0,"AbsoluteStrength_v1",Mode,Length,Smooth,Signal,Price,ModeMA,2,i+1);//up_sig
      double f3us = iCustom(Symbol(),0,"AbsoluteStrength_v1",Mode,Length,Smooth,Signal,Price,ModeMA,2,i+2);//up_sig
      
      double f1ds = iCustom(Symbol(),0,"AbsoluteStrength_v1",Mode,Length,Smooth,Signal,Price,ModeMA,3,i);//up_sig
      double f2ds = iCustom(Symbol(),0,"AbsoluteStrength_v1",Mode,Length,Smooth,Signal,Price,ModeMA,3,i+1);//up_sig
      double f3ds = iCustom(Symbol(),0,"AbsoluteStrength_v1",Mode,Length,Smooth,Signal,Price,ModeMA,3,i+2);//up_sig
      
      
      double f1d = iCustom(Symbol(),0,"AbsoluteStrength_v1",Mode,Length,Smooth,Signal,Price,ModeMA,1,i);//dn
      double f2d = iCustom(Symbol(),0,"AbsoluteStrength_v1",Mode,Length,Smooth,Signal,Price,ModeMA,1,i+1);//dn
      double f3d = iCustom(Symbol(),0,"AbsoluteStrength_v1",Mode,Length,Smooth,Signal,Price,ModeMA,1,i+2);//dn
      
      if(f1u > f1d && f2u > f2d && f2u > f2us && f1u < f1us)
      {
         exitL[i] = Low[i];
         exitS[i] = 0.0; 
      }
      else if(f1d > f1u && f2d > f2u && f2d > f2ds && f1d < f1ds)
      {
        exitS[i] = High[i];
        exitL[i] = 0.0; 
      }
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+



Sample





Analysis



Market Information Used:

Series array that contains the lowest prices of each bar
Series array that contains the highest prices of each bar


Indicator Curves created:

Implements a curve of type DRAW_ARROW


Indicators Used:




Custom Indicators Used:
AbsoluteStrength_v1

Order Management characteristics:

Other Features: