Download MetaTrader 5

Indicators: GG-TrendBar

To add comments, please log in or register
MetaQuotes Software Corp.
Moderator
182374
MetaQuotes Software Corp. 2009.05.08 06:07 

GG-TrendBar:

This indicator shows you the trend on every timeframe simultaneously

Author: Gordon Gekko

Avery Horton
253
Avery Horton 2009.05.08 16:31  

Nice implementation.


Thanks for sharing

MQL4 Comments
16319
MQL4 Comments 2009.05.08 22:06  

Very nice. Simpler is better!

I wonder if there is any predictive value in sequences of shorter chains such as M5->1H. Or more likely in changes in sequences. using perhaps +1, 0,-1. Should not be too difficult to test...

MQL4 Comments
16319
MQL4 Comments 2009.05.08 23:55  

hi

Great indicator,What are the indications of the colors?Which color is buy and which is sell?

Gordon Gekko
623
Gordon Gekko 2009.05.09 10:35  
sojiyuki:

hi

Great indicator,What are the indications of the colors?Which color is buy and which is sell?

Lime: UpTrend, Red: DownTrend, Yellow: No significant trend

BTW, you can change the colors as you wish.

MQL4 Comments
16319
MQL4 Comments 2009.05.09 15:47  

This is a great indicator. Thank you very much!

MQL4 Comments
16319
MQL4 Comments 2009.05.09 19:27  

Very nicely done and very useful. I'm sure that this will be a standard for everyone before long.

Thank you very much for sharing.

Keith

Avery Horton
253
Avery Horton 2009.05.10 02:04  



I made a few modifications to the code.


Hope you enjoy.



//+------------------------------------------------------------------+
//|                                                  GG-TrendBar.mq4 |
//|                                                           GGekko |
//|                                                                  |
//+------------------------------------------------------------------+
//| GG-TrendBar_TRO_MODIFIED_VERSION                                 |
//| MODIFIED BY AVERY T. HORTON, JR. AKA THERUMPLEDONE@GMAIL.COM     |
//| I am NOT the ORIGINAL author 
//  and I am not claiming authorship of this indicator. 
//  All I did was modify it. I hope you find my modifications useful.|
//|                                                                  |
//+------------------------------------------------------------------+
 
#property copyright "GGekko"
#property link      ""
#property indicator_chart_window
  
extern int  yAxis = 0 ;
extern string ___IndicatorSetup___=">>> Indicator Setup:<<<";
extern int ADX_Period=14;
extern int ADX_Price=PRICE_CLOSE;
extern double Step_Psar=0.02;
extern double Max_Psar=0.2;
extern string ___DisplaySetup___=">>> Display Setup:<<<";
extern color UpColor   =Lime;
extern color DownColor =Red;
extern color FlatColor =Yellow;
extern color TextColor =DodgerBlue;
extern int   Corner = 1;
int tframe[]={1,5,15,30,60,240,1440,10080,43200};
string tf[]={"M1","M5","M15","M30","H1","H4","D1","W1","MN"};
int tfnumber=9;  
double Psar;
double PADX,NADX;
string TimeFrameStr;
double IndVal[9];
int xpos[9], ypos[9];
int w , j , xposTAG;
string TAG = "gg-TB";
string ArrowHeadRt =  "Ø" ; // 216 up arrow head
string ArrowHeadUp =  "Ù" ; // 217 up arrow head
string ArrowHeadDn =  "Ú" ; // 218 up arrow head 
string theArrow[9];
color  theColor[9];
//+------------------------------------------------------------------+
int init()
  {
if(Corner == 1 || Corner == 3)
{ 
   for( w = 0 ; w < tfnumber ; w++) { xpos[w] = 15 + ((9 - w)*23)  ; } 
   xposTAG = 240 ;
} 
else
{
   for( w=0;w<tfnumber;w++) { xpos[w] = w*23 + 50 ; }
   xposTAG = 10 ;
}
         ObjectCreate(TAG+"HD",OBJ_LABEL,0,0,0,0,0);
         ObjectSet(TAG+"HD",OBJPROP_CORNER,Corner);
         ObjectSet(TAG+"HD",OBJPROP_XDISTANCE,xposTAG);
         ObjectSet(TAG+"HD",OBJPROP_YDISTANCE,yAxis+30);
         ObjectSetText(TAG+"HD",TAG,8,"Tahoma",TextColor);
   for( w=0;w<tfnumber;w++)
      {
         ObjectCreate(TAG+tf[w],OBJ_LABEL,0,0,0,0,0);
         ObjectSet(TAG+tf[w],OBJPROP_CORNER,Corner);
         ObjectSet(TAG+tf[w],OBJPROP_XDISTANCE,xpos[w]);
         ObjectSet(TAG+tf[w],OBJPROP_YDISTANCE,yAxis+20);
         ObjectSetText(TAG+tf[w],tf[w],8,"Tahoma",TextColor);
      }
//----
   return(0);
  } 
  
//+------------------------------------------------------------------+
int deinit()
  {
//----
   ObjectDelete(TAG+"HD");
   for(int k=0;k<tfnumber+1;k++)
      ObjectDelete(TAG+k);
   for(k=0;k<tfnumber+1;k++)
      ObjectDelete(tf[k-1]);
   
//----
   return(0);
  }
  
//+------------------------------------------------------------------+
int start()
  {
   
//----
   
   for( j=0;j<tfnumber ;j++)
   {
      if (ObjectFind(TAG+j) != 0)
      {
         ObjectCreate(TAG+j,OBJ_LABEL,0,0,0,0,0);
         ObjectSet(TAG+j,OBJPROP_CORNER,Corner);
         ObjectSet(TAG+j,OBJPROP_XDISTANCE,xpos[j]);
         ObjectSet(TAG+j,OBJPROP_YDISTANCE,yAxis+30);
         ObjectSetText(TAG+j,CharToStr(110),12,"Wingdings",White);
      }// if
   } // for
      
   for(int x=0;x<tfnumber;x++)
      {
      
      PADX=iADX(NULL,tframe[x],ADX_Period ,ADX_Price,1,0);
      NADX=iADX(NULL,tframe[x],ADX_Period ,ADX_Price,2,0);
      Psar=iSAR(NULL,tframe[x],Step_Psar,Max_Psar,0) ;
      
        if (Psar < iClose(NULL,tframe[x],0) && PADX > NADX)
        {
         IndVal[x]   = 1;
         theArrow[x] = ArrowHeadUp ;
         theColor[x] = UpColor ;
        }
        else if (Psar > iClose(NULL,tframe[x],0) && NADX > PADX)
        {
         IndVal[x]   = -1;
         theArrow[x] = ArrowHeadDn ;
         theColor[x] = DownColor ;         
        }
        else 
        {
         IndVal[x]   = 0;
         theArrow[x] = ArrowHeadRt ;
         theColor[x] = FlatColor ;
        }
     }
   
   
      for(int y=0;y<tfnumber;y++)
      {
         ObjectSetText(TAG+y,theArrow[y],12,"Wingdings",theColor[y]);
      }  
        
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
Gordon Gekko
623
Gordon Gekko 2009.05.11 10:12  

Nice work, TRO.

membank
3
membank 2009.06.01 22:10  

been trying to download gg trendbar what file do i save it in and how do i activate it so it comes up on my screen thanks

Gordon Gekko
623
Gordon Gekko 2009.06.01 23:40  

Save the GG-TrendBar.mq4 file into the MT4/Experts/Indicators folder, then open it in the Metaeditor, and compile. Attach it to a chart.

12
To add comments, please log in or register