Elite indicators - metatrader 5 version :) - page 19

 

Newest version of alma - metatrader 5 version : alma_1_1.mq5

 

Some minor changes in the rsi experiment extended (made in order to make the trend reading easier) : rsi_experiment_extended_fl_1_2.mq5

 
 

Upgraded composite RSI : composite_rsi_1_1.mq5

Files:
 
 

Hi mladen, mrtools,

can you please add arrows to the attached indicator?

 
camisa:

Hi mladen, mrtools,

can you please add arrows to the attached indicator?

Here is the code :

//+------------------------------------------------------------------+
//|                                                           mladen |
//+------------------------------------------------------------------+
#property copyright "mladen"
#property link      "www.forex-tsd.com"
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1  LimeGreen
#property indicator_color2  DarkOrange
#property indicator_width1  2
#property indicator_width2  2
#property indicator_minimum 0
#property indicator_maximum 1

//
//
//
//
//

extern int    Length          = 50;
extern ENUM_APPLIED_PRICE Price  = PRICE_CLOSE;
extern int    MaLength        = 10;
extern ENUM_MA_METHOD MaMethod = MODE_EMA;
extern bool   alertsOn        = false;
extern bool   alertsOnCurrent = true;
extern bool   alertsMessage   = true;
extern bool   alertsSound     = false;
extern bool   alertsNotify    = false;
extern bool   alertsEmail     = false;
extern string soundFile       = "alert2.wav";
extern bool   arrowsVisible     = true;
extern string arrowsIdentifier  = "cmom arrows1";
extern double arrowsUpperGap    = 0.5;
extern double arrowsLowerGap    = 0.5;
extern color  arrowsUpColor     = clrLimeGreen;
extern color  arrowsDnColor     = clrRed;
extern int    arrowsUpCode      = 241;
extern int    arrowsDnCode      = 242;

double mom[];
double hu[];
double hd[];
double trend[];

//------------------------------------------------------------------
//
//------------------------------------------------------------------
//
//
//
//
//

int init()
{
   IndicatorBuffers(4);
   SetIndexBuffer(0,hu); SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexBuffer(1,hd); SetIndexStyle(1,DRAW_HISTOGRAM);
   SetIndexBuffer(2,mom);
   SetIndexBuffer(3,trend);
   IndicatorShortName("Cumulative momentum ("+Length+","+MaLength+")");
   return(0);
}
int deinit()
{
   string lookFor       = arrowsIdentifier+":";
   int    lookForLength = StringLen(lookFor);
   for (int i=ObjectsTotal()-1; i>=0; i--)
   {
      string objectName = ObjectName(i);
         if (StringSubstr(objectName,0,lookForLength) == lookFor) ObjectDelete(objectName);
   }
   return(0);
}

//------------------------------------------------------------------
//
//------------------------------------------------------------------
//
//
//
//
//

int start() 
{
   int counted_bars=IndicatorCounted();
      if(counted_bars<0) return(-1);
      if(counted_bars>0) counted_bars--;
         int limit = MathMin(Bars-counted_bars,Bars-1);
             
   //
   //
   //
   //
   //
   
   for(int i=limit; i>=0; i--)
   {
      double price = iMA(NULL,0,MaLength,0,MaMethod,Price,i);
      mom[i] = 0;
         for (int k=0; k<Length; k++) mom[i] += price-iMA(NULL,0,MaLength,0,MaMethod,Price,i+k+1);
      trend[i] = trend[i+1];
      hu[i]    = EMPTY_VALUE;
      hd[i]    = EMPTY_VALUE;
         if (mom[i]>0) trend[i] =  1;
         if (mom[i]<0) trend[i] = -1;
         if (trend[i] == 1) hu[i] = 1;
         if (trend[i] ==-1) hd[i] = 1;
         if (arrowsVisible)
         {
            ObjectDelete(arrowsIdentifier+":1:"+Time[i]);
            string lookFor = arrowsIdentifier+":"+Time[i]; ObjectDelete(lookFor);
            if (trend[i] != trend[i+1])
            {
                if (trend[i] == 1) drawArrow("1",1,i,arrowsUpColor,arrowsUpCode,false);
                if (trend[i] ==-1) drawArrow("1",1,i,arrowsDnColor,arrowsDnCode,true);
            }
         }
   }
   
   //
   //
   //
   //
   //
   
   if (alertsOn)
   {
      if (alertsOnCurrent)
            int whichBar = 0;
      else      whichBar = 1;
      if (trend[whichBar] != trend[whichBar+1])
      if (trend[whichBar] == 1)
            doAlert("crossed zero up");
      else  doAlert("crossed zero down");       
   }  
return(0);
}

//------------------------------------------------------------------
//
//------------------------------------------------------------------
//
//
//
//
//

void drawArrow(string nameAdd, double gapMul, int i,color theColor,int theCode,bool up)
{
   string name = arrowsIdentifier+":"+nameAdd+":"+Time[i];
   double gap  = iATR(NULL,0,20,i)*gapMul;   
   
      //
      //
      //
      //
      //
      
      ObjectCreate(name,OBJ_ARROW,0,Time[i],0);
         ObjectSet(name,OBJPROP_ARROWCODE,theCode);
         ObjectSet(name,OBJPROP_COLOR,theColor);
         if (up)
               ObjectSet(name,OBJPROP_PRICE1,High[i] + arrowsUpperGap * gap);
         else  ObjectSet(name,OBJPROP_PRICE1,Low[i]  - arrowsLowerGap * gap);
}

//
//
//
//
//

void doAlert(string doWhat)
{
   static string   previousAlert="nothing";
   static datetime previousTime;
   string message;
   
      if (previousAlert != doWhat || previousTime != Time[0]) {
          previousAlert  = doWhat;
          previousTime   = Time[0];

          //
          //
          //
          //
          //

          message =  StringConcatenate(Symbol()," at ",TimeToStr(TimeLocal(),TIME_SECONDS)," Cumulative momentum ",doWhat);
             if (alertsMessage) Alert(message);
             if (alertsNotify)  SendNotification(message);
             if (alertsEmail)   SendMail(StringConcatenate(Symbol()," Cumulative momentum "),message);
             if (alertsSound)   PlaySound(soundFile);
      }
}
 

Metatrader 5 version of averages (all the ma types + double smoothing + adaptive) :


Files:
averages_7.8.zip  118 kb
 
mladen:

Metatrader 5 version of averages (all the ma types + double smoothing + adaptive) :


Is there MT5 version of the latest Averages channel candle and step ma pdf ?
 
PanKayun:
Is there MT5 version of the latest Averages channel candle and step ma pdf ?
Not yet. Will be made