FOREX MT4 INDICATORS DOWNLOAD
  • Donate to us
  • MT4 INDICATORS A
  • MT4 INDICATORS B
  • MT4 INDICATORS C
  • MT4 INDICATORS D
  • MT4 INDICATORS E
  • MT4 INDICATORS F
  • MT4 INDICATORS G
  • MT4 INDICATORS H
  • MT4 INDICATORS I
  • MT4 INDICATORS J
  • MT4 INDICATORS K
  • MT4 INDICATORS L
  • MT4 INDICATORS M
  • MT4 INDICATORS N
  • MT4 INDICATORS O
  • MT4 INDICATORS P
  • MT4 INDICATORS Q
  • MT4 INDICATORS R
  • MT4 INDICATORS S
  • MT4 INDICATORS T
  • MT4 INDICATORS U
  • MT4 INDICATORS V
  • MT4 INDICATORS W
  • MT4 INDICATORS X
  • MT4 INDICATORS Y
  • MT4 INDICATORS Z
  • MT4 INDICATORS NUM
  • MT4 INDICATORS SIGN

Gann High-Low activator histo st2050.mq4

Gann High-Low activator histo st2050.mq4 FOREX MetaTrader4 Indicators Download

Gann High-Low activator histo st2050.mq4 download link will appear after 20 seconds.


Icon

Gann High-Low activator histo st2050.mq4

1 file(s) 7.13 KB
Download


Gann High-Low activator histo st2050.mq4 Programming source code.

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1  MediumPurple
#property indicator_color2  C'152,102,99'
#property indicator_minimum 0
#property indicator_maximum 1
#property indicator_width1  2
#property indicator_width2  2
//
//
//
//
//

extern string TimeFrame       = "Current time frame";
extern int    Lb              = 7;
extern ENUM_MA_METHOD MaType  = MODE_LWMA;
extern int    MaxBars         = 2000;
extern bool   WaitForClose    = true;
extern bool   RecalcForClose  = true;
extern bool   alertsOn        = false;
extern bool   alertsOnCurrent = true;
extern bool   alertsMessage   = true;
extern bool   alertsSound     = false;
extern bool   alertsEmail     = false;

//
//
//
//
//

double gup[];
double gdn[];
double trend[];

//
//
//
//
//

int    timeFrame;
string indicatorFileName;
bool   returnBars;
bool   calculateValue;

//+------------------------------------------------------------------
//|                                                                  
//+------------------------------------------------------------------
//
//
//
//
//

int init()
{
   IndicatorBuffers(3);
   SetIndexBuffer(0,gup); SetIndexDrawBegin(0,Lb+1); SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexBuffer(1,gdn); SetIndexDrawBegin(1,Lb+1); SetIndexStyle(1,DRAW_HISTOGRAM);
   SetIndexBuffer(2,trend);
   
      //
      //
      //
      //
      //
      
         indicatorFileName = WindowExpertName();
         calculateValue    = (TimeFrame=="calculateValue"); if (calculateValue) return(0);
         returnBars        = (TimeFrame=="returnBars");     if (returnBars)     return(0);
         timeFrame         = stringToTimeFrame(TimeFrame);
      
      //
      //
      //
      //
      //
      
   IndicatorShortName(timeFrameToString(timeFrame)+" Gann high/low activator ("+Lb+")");
   return(0);
}

//+------------------------------------------------------------------
//|                                                                  
//+------------------------------------------------------------------
//
//
//
//
//

bool BarChanged()
{
  static datetime dt = 0;

    if (dt != Time[0])
    {
      dt = Time[0];
      return(true);
    }
    return(false);
}

int start()
{

   bool _BarChanged = BarChanged();
   if (WaitForClose && !_BarChanged) return(0);

   int counted_bars=IndicatorCounted();
   if (RecalcForClose && _BarChanged) counted_bars=0;
   int i,limit;

   if(counted_bars<0) return(-1);
   if(counted_bars>0) counted_bars--;
           limit=MathMin(Bars-counted_bars,Bars-1);
           if (returnBars) { gup[0] = limit+1; return(0); }
           
   if (limit>MaxBars) limit=MaxBars;

   //
   //
   //
   //
   //

   if (calculateValue || timeFrame == Period())
   {
      for(i=limit;i>=0;i--)
      {
         gup[i]   = EMPTY_VALUE;
         gdn[i]   = EMPTY_VALUE;
         trend[i] = trend[i+1];
            if(Close[i]>iMA(Symbol(),0,Lb,0,MaType,PRICE_HIGH,i+1)) trend[i] =  1;
            if(Close[i]MaxBars) limit=MaxBars;

   for(i=limit; i>=0; i--)
   {
      int y = iBarShift(NULL,timeFrame,Time[i]);
         gup[i]   = EMPTY_VALUE;
         gdn[i]   = EMPTY_VALUE;
         trend[i] = iCustom(NULL,timeFrame,indicatorFileName,"calculateValue",Lb,MaType,MaxBars,WaitForClose,RecalcForClose,2,y);
            
            if(trend[i] == -1)
                  gdn[i] = 1;
            else  gup[i] = 1;
   }               

   //
   //
   //
   //
   //
   
   if (WaitForClose)
   {
   gup[0]=EMPTY_VALUE;
   gdn[0]=EMPTY_VALUE;
   }
   
   manageAlerts();
   return(0);
}

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
//
//
//
//
//

void manageAlerts()
{
   if (!calculateValue && alertsOn)
   {
      if (alertsOnCurrent)
           int whichBar = 0;
      else     whichBar = 1; whichBar = iBarShift(NULL,0,iTime(NULL,timeFrame,whichBar));
      if (trend[whichBar] != trend[whichBar+1])
      {
         if (trend[whichBar] == 1) doAlert(whichBar,"up");
         if (trend[whichBar] ==-1) doAlert(whichBar,"down");
      }         
   }
}   

//
//
//
//
//

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

          //
          //
          //
          //
          //

          message =  StringConcatenate(Symbol()," at ",TimeToStr(TimeLocal(),TIME_SECONDS)," Gann HL activator trend changed to ",doWhat);
             if (alertsMessage) Alert(message);
             if (alertsEmail)   SendMail(StringConcatenate(Symbol(),"Gann HL "),message);
             if (alertsSound)   PlaySound("alert2.wav");
      }
}

//+-------------------------------------------------------------------
//|                                                                  
//+-------------------------------------------------------------------
//
//
//
//
//

string sTfTable[] = {"M1","M5","M15","M30","H1","H4","D1","W1","MN"};
int    iTfTable[] = {1,5,15,30,60,240,1440,10080,43200};

//
//
//
//
//

int stringToTimeFrame(string tfs)
{
   tfs = stringUpperCase(tfs);
   for (int i=ArraySize(iTfTable)-1; i>=0; i--)
         if (tfs==sTfTable[i] || tfs==""+iTfTable[i]) return(MathMax(iTfTable[i],Period()));
                                                      return(Period());
}
string timeFrameToString(int tf)
{
   for (int i=ArraySize(iTfTable)-1; i>=0; i--) 
         if (tf==iTfTable[i]) return(sTfTable[i]);
                              return("");
}

//
//
//
//
//

string stringUpperCase(string str)
{
   string   s = str;

   for (int length=StringLen(str)-1; length>=0; length--)
   {
      int tchar = StringGetChar(s, length);
         if((tchar > 96 && tchar < 123) || (tchar > 223 && tchar < 256))
                     s = StringSetChar(s, length, tchar - 32);
         else if(tchar > -33 && tchar < 0)
                     s = StringSetChar(s, length, tchar + 224);
   }
   return(s);
}
Gann Hi-lo Activator SSL.mq4 Ganns Signal Shanel 1_V4~.mq4

Related Posts

METATRADER4G

Gitalovsa.mq4

METATRADER4G

gfk forex2.mq4

METATRADER4G

gesigmoid.mq4

METATRADER4G

Ganns Signal Shanel 2_V4~.mq4

METATRADER4G

Ganns Signal Shanel 1_V4~.mq4

METATRADER4G

Gann Hi-lo Activator SSL.mq4

METATRADER4G

gadi_obv_v2.2.mq4

How to use this site.
  1. Subscribe YouTube
  2. Subscribe Facebook
  3. Subscribe Instagram
  4. Download MT4
  5. Watch Youtube Video
  6. Downliad Indicator and Try Trading
  7. Donate to us for update

Recent News

  • i-g-cci2.mq4
  • haosvisual_27jk8.mq4
  • HamaSystem separate window.ex4
  • HalfTrend 2.mq4
  • Gitalovsa.mq4

Donate