M5-GTi-M30_001





//+------------------------------------------------------------------+
//|                              ARROW_HERC_RSI_MTF_NR.mq4                                                             
//+------------------------------------------------------------------+
#property copyright "AHGduP"
#property link      "ARROW_HERC_RSI_MTF_NR"

#property indicator_chart_window
#include <WinUser32.mqh>
#property indicator_buffers 2
#property indicator_color1 Red//Yellow
#property indicator_width1 3//2
#property indicator_color2 Red//Yellow
#property indicator_width2 3//2

//====================================================================================
//extern string     RSI_1                   = "== TF 5Min RSI  ===";

//extern int        Tf5_Rsi8_Per            = 8 ;
//extern int        Tf5_Rsi4_Per            = 4 ;
//extern int        Tf5_Rsi2_Per            = 2 ;

//=======================================================================================

//extern string     RSI_2                   = "== TF 15Min RSI  ===";

//extern int        Tf15_Rsi8_Per            = 8 ;
//extern int        Tf15_Rsi4_Per            = 4 ;
//extern int        Tf15_Rsi2_Per            = 2 ;

//=======================================================================================
extern string     RSI_3                   = "== TF 30Min RSI  ===";

extern int        Tf30_Rsi8_Per            = 8 ;
extern int        Tf30_Rsi4_Per            = 4 ;
extern int        Tf30_Rsi2_Per            = 2 ;

//=======================================================================================
//extern string     RSI_4                   = "== TF 120Min RSI  ===";

//extern int        Tf120_Rsi8_Per          = 8 ;
//extern int        Tf120_Rsi4_Per          = 4 ;
//extern int        Tf120_Rsi2_Per          = 2 ;

//=======================================================================================

extern bool   Alarm_On       =  false ; 
extern int    LineSize       = 2 ;//4
extern int    Move_Arrow     = 2 ;//5
extern int    CountBars      = 2000 ;

//double RSI5_up1   , RSI5_dn1 ;
//double RSI5_up2   , RSI5_dn2 ;
//double RSI15_up1  , RSI15_dn1 ;
//double RSI15_up2  , RSI15_dn2 ;
double RSI30_up1  , RSI30_dn1 ;
double RSI30_up2  , RSI30_dn2 ;
//double RSI120_up1 , RSI120_dn1 ;
//double RSI120_up2 , RSI120_dn2 ;

//double RSI15_up3   , RSI15_dn3 ;// hoekom weer die RSI s????
//double RSI60_up3   , RSI60_dn3 ;// ditto
//double RSI240_up3   , RSI240_dn3 ;//ditto

double up1, down1 ;

double bBuffer1[];
double sBuffer1[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   IndicatorBuffers(2);
   SetIndexStyle(0,DRAW_ARROW,2, LineSize);//(0,DRAW_ARROW,0, LineSize);
   SetIndexBuffer(0,bBuffer1);
   SetIndexEmptyValue(0,0);
   SetIndexArrow(0,181);//116 = Diamond 
   
   SetIndexStyle(1,DRAW_ARROW,2, LineSize);
   SetIndexBuffer(1,sBuffer1);
   SetIndexEmptyValue(1,0);
   SetIndexArrow(1,181);//234
  
  up1   = 0 ;
  down1 = 0 ;
 

//=======================================================================================  
         }
          return(0);
//+--------------------------------------------------------------------------------------+
int start()
  {
     static int last_bar = 0;
   if(last_bar==Bars) return (0);
   last_bar = Bars;
   int limit,y=0,counted_bars=IndicatorCounted();
//=================================================   

     limit=Bars-counted_bars;

//==================================================
    
   if(counted_bars>0) limit++; else if (limit>100) limit=CountBars;  
     SetIndexDrawBegin(0,Bars-CountBars);
     SetIndexDrawBegin(1,Bars-CountBars);

   for(int i=CountBars;i>0;i--)
          {  

                   bBuffer1[i] = EMPTY_VALUE; 
                   sBuffer1[i] = EMPTY_VALUE;

//======================== RSI ==================================================================================================         
//======================== RSI 5 MIN ============================================================================================     
    
//    double RSI5_rsi8  =  iCustom(NULL, 0, "RSI-3TF_5M_NR", Tf5_Rsi8_Per, Tf5_Rsi4_Per, Tf5_Rsi2_Per, 0, i);//8
//    double RSI5_rsi4  =  iCustom(NULL, 0, "RSI-3TF_5M_NR", Tf5_Rsi8_Per, Tf5_Rsi4_Per, Tf5_Rsi2_Per, 1, i);//4
//    double RSI5_rsi2  =  iCustom(NULL, 0, "RSI-3TF_5M_NR", Tf5_Rsi8_Per, Tf5_Rsi4_Per, Tf5_Rsi2_Per, 2, i);//2
    
//         if ((RSI5_rsi2 > RSI5_rsi4)){ RSI5_up1 = 1; RSI5_dn1 = 0; }
//         if ((RSI5_rsi4 > RSI5_rsi8)){ RSI5_up2 = 1; RSI5_dn2 = 0; }
        
//         if ((RSI5_rsi2 < RSI5_rsi4)){ RSI5_up1 = 0; RSI5_dn1 = 1; }   
//         if ((RSI5_rsi4 < RSI5_rsi8)){ RSI5_up2 = 0; RSI5_dn2 = 1; } 

//======================== RSI 15 MIN ==========================================================================================     
    
//  double RSI15_rsi8  =  iCustom(NULL, 0, "RSI-M15", Tf15_Rsi8_Per, Tf15_Rsi4_Per, Tf15_Rsi2_Per, 0, i);//8  ***********
//  double RSI15_rsi4  =  iCustom(NULL, 0, "RSI-M15",Tf15_Rsi8_Per, Tf15_Rsi4_Per, Tf15_Rsi2_Per, 1, i);//4  ***********
//  double RSI15_rsi2  =  iCustom(NULL, 0, "RSI-M15", Tf15_Rsi8_Per, Tf15_Rsi4_Per, Tf15_Rsi2_Per, 2, i);//2  ************
    
//       if ((RSI15_rsi2 > RSI15_rsi4)){ RSI15_up1 = 1; RSI15_dn1 = 0; }
//       if ((RSI15_rsi2 < RSI15_rsi4)){ RSI15_up1 = 0; RSI15_dn1 = 1; }   
         
//       if ((RSI15_rsi4 > RSI15_rsi8)){ RSI15_up2 = 1; RSI15_dn2 = 0; }//**************
//       if ((RSI15_rsi4 < RSI15_rsi8)){ RSI15_up2 = 0; RSI15_dn2 = 1; }    
         
    //   if ((RSI15_rsi2 > RSI15_rsi8)){ RSI15_up3 = 1; RSI15_dn3 = 0; }      
    //   if ((RSI15_rsi2 < RSI15_rsi8)){ RSI15_up3 = 0; RSI15_dn3 = 1; }  
         
//========================RSI 30 MIN ==================================================================================       
                     
//  double RSI60_rsi8  =  iCustom(NULL, 0, "RSI-H1", Tf60_Rsi8_Per, Tf60_Rsi4_Per, Tf60_Rsi2_Per, 0, i);//**********
  double RSI30_rsi4  =  iCustom(NULL, 0, "RSI-M30", Tf30_Rsi8_Per, Tf30_Rsi4_Per, Tf30_Rsi2_Per, 1, i);
  double RSI30_rsi2  =  iCustom(NULL, 0, "RSI-M30", Tf30_Rsi8_Per, Tf30_Rsi4_Per, Tf30_Rsi2_Per, 2, i);
    
       if ((RSI30_rsi2 > RSI30_rsi4)){ RSI30_up1 = 1; RSI30_dn1 = 0; }
       if ((RSI30_rsi2 < RSI30_rsi4)){ RSI30_up1 = 0; RSI30_dn1 = 1; }  
         
//       if ((RSI60_rsi4 > RSI60_rsi8)){ RSI60_up2 = 1; RSI60_dn2 = 0; } 
//       if ((RSI60_rsi4 < RSI60_rsi8)){ RSI60_up2 = 0; RSI60_dn2 = 1; }    
         
     //  if ((RSI60_rsi2 > RSI60_rsi8)){ RSI60_up3 = 1; RSI60_dn3 = 0; }     
     //  if ((RSI60_rsi2 < RSI60_rsi8)){ RSI60_up3 = 0; RSI60_dn3 = 1; }  
         
//========================RSI 240 MIN =================================================================================       
     
 // double RSI240_rsi8  =  iCustom(NULL, 0, "RSI-H4", Tf240_Rsi8_Per, Tf240_Rsi4_Per, Tf240_Rsi2_Per, 0, i);//8 **************
//    double RSI120_rsi4  =  iCustom(NULL, 0, "RSI-H2", Tf120_Rsi8_Per, Tf120_Rsi4_Per, Tf120_Rsi2_Per, 1, i);//4
//    double RSI120_rsi2  =  iCustom(NULL, 0, "RSI-H2", Tf120_Rsi8_Per, Tf120_Rsi4_Per, Tf120_Rsi2_Per, 2, i);//2
    
//         if ((RSI120_rsi2 > RSI120_rsi4)){ RSI120_up1 = 1; RSI120_dn1 = 0; }
//         if ((RSI120_rsi2 < RSI120_rsi4)){ RSI120_up1 = 0; RSI120_dn1 = 1; }   
         
//       if ((RSI240_rsi4 > RSI240_rsi8)){ RSI240_up2 = 1; RSI240_dn2 = 0; }
//       if ((RSI240_rsi4 < RSI240_rsi8)){ RSI240_up2 = 0; RSI240_dn2 = 1; }  
         
  //     if ((RSI240_rsi2 > RSI240_rsi8)){ RSI240_up3 = 1; RSI240_dn3 = 0; }            
  //     if ((RSI240_rsi2 < RSI240_rsi8)){ RSI240_up3 = 0; RSI240_dn3 = 1; }  
         
//=====================================================================================================================      

//========================== ARROWS A  2 cross 4 and 4 cross 8 ==========================================   
 
          if      (      up1 == 0   
             
                  //  && ( RSI15_up1  + RSI15_up2   ) == 2  
                 //   && ( RSI60_up1  + RSI60_up2   ) == 2  
               //     && ( RSI240_up1 + RSI240_up2  ) == 2   
                    
                 //   && ( RSI5_up1    ) == 1  
                 
                 
//                && ( RSI15_up1   ) == 1//up2 VIR 4 KRUIS 8  
                && ( RSI30_up1   ) == 1  
//                  && ( RSI120_up1  ) == 1   
                 )
                   {   bBuffer1[i] = Low[i]- Move_Arrow*Point;
                       if   ( Alarm_On)
                            {  //   Alert(Symbol() + " M("+Period()+") - VM BUY");
                                   PlaySound("alert2.wav");
                            }
                      up1   = 1;  down1 = 0;
                  }    
//-------------------------------------------------------------------------------------------------         
         if     (       down1 ==0 
               
                 //  && ( RSI15_dn1  + RSI15_dn2  ) == 2
                //   && ( RSI60_dn1  + RSI60_dn2  ) == 2
              //     && ( RSI240_dn1 + RSI240_dn2 ) == 2
                   
                 //  && ( RSI5_dn1    ) == 1 
                 
//                && ( RSI15_dn1   ) == 1// dn2 VIR 4 KRUIS 8
                && ( RSI30_dn1   ) == 1
//                  && ( RSI120_dn1  ) == 1
                )
                  {   sBuffer1[i] = High[i]+ Move_Arrow*Point;
                      if   ( Alarm_On)
                           { //   Alert(Symbol() + " M("+Period()+") - VM SELL");
                                 PlaySound("alert2.wav");
                           }
                     down1 = 1;   up1   = 0;
                 }
//===========cancel signal  and re enter in same direction=========================================    
  
       if      (      up1 == 1
             
               //  &&  ( RSI15_up1  + RSI15_up2   )  != 2  
              //   &&  ( RSI60_up1  + RSI60_up2   )  != 2   
             //    &&  ( RSI240_up1 + RSI240_up2  )  != 2   
                 
             //    &&  ( RSI5_up1     )  != 1  
 //             &&  ( RSI15_up1    )  != 1      ************ weet nie wat om hier te doen nie ******
                &&  ( RSI30_up1    )  != 1   
//                &&  ( RSI120_up1   )  != 1   //dalk hier weer aansit????????????
               )
                 { up1 = 0;   down1 = 0;
                 }    
              
  //-----------------------------------------------------------------------------------------------          
         
      if  (        down1 == 1 
         
           //  &&  ( RSI15_dn1  + RSI15_dn2  )  != 2
          //   &&  ( RSI60_dn1  + RSI60_dn2  )  != 2
          //   &&  ( RSI240_dn1 + RSI240_dn2 )  != 2
             
         //    &&  ( RSI5_dn1    )  != 1
//         &&  ( RSI15_dn1   )  != 1           ******************** weet nie - vra Gerhard
           &&  ( RSI30_dn1   )  != 1
         //  &&  ( RSI120_dn1  )  != 1
          )
              {  up1 = 0;   down1 = 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:
RSI-M30

Order Management characteristics:

Other Features:

It plays sound alerts