TRUE Forex

Просмотр кода форекс индикатора !!Y3-MT4 CURRENCY POWER.mq4

#property indicator_chart_window

extern int   Window            = 0;
extern int   Corner            = 2;
extern int   UpDown            = -104;
extern int   LeftRight         = 531;
extern color BackGroundColor   = White;

extern bool  SortedDisplay     = true;

int      X.position      = 4;
int      Y.position      = 114;
color    PanelColor1     = C'144,144,144';
extern color    PanelColor2     = C'20,20,20';
extern color    PanelColor3     = C'200,50,50';

string buffer.name = "CP";
int Font.size = 12;

#define Majors.Number 8

int chartpair[2];
string buffer;
string Majors[]  = {"USD","EUR","GBP","JPY","CHF","CAD","NZD","AUD"};            

string Symbols[] = {"EURUSD", "GBPUSD", "USDJPY", "USDCHF", "USDCAD", "AUDUSD", "NZDUSD",
                    "EURGBP", "EURJPY", "EURCHF", "EURCAD", "EURAUD", "EURNZD",
                    "GBPJPY", "GBPCHF", "GBPCAD", "GBPAUD", "GBPNZD",
                    "AUDJPY", "AUDCHF", "AUDCAD", "AUDNZD",
                    "CHFJPY", "CADJPY", "NZDJPY",
                    "USDSGD"};

string space = "";
string NomeIndi;
int Xoffset[4]={135,150,135,150};  
int Yoffset[4]={0,0,0,0};
  
  
int Translate(string symbol)
   {
   for(int i=0;i<Majors.Number;i++)     if(Majors[i] == symbol)   break;  
   return(i);
   }   




int init()
  {
   X.position += LeftRight;
   Y.position += UpDown;
   NomeIndi = WindowExpertName();
   string currency=StringSubstr(Symbol(),0,3);
   chartpair[0]=Translate(currency);
   currency=StringSubstr(Symbol(),3,3);
   chartpair[1]=Translate(currency);
   Show_Panel();
   Y.position+=2;
   
  return(0);
  }




int deinit()
  {
  for (int i = 0; i <= ArraySize(Majors)*2; i++) 
      {    
       ObjectDelete(Majors[i]+"_val");
       ObjectDelete(Majors[i]+"_nom");
       ObjectDelete(Majors[i]+"_pos");
       }    
       ObjectDelete("AA-Panel-1");
       ObjectDelete("AA-Panel-2");
       ObjectDelete("AA-Panel-3");
       ObjectDelete("AA-Panel-4");
       DeleteExistingLabels();
  
   return(0);
  }



void  Show_Panel()
{
      string text="g";
      int xoffset=130,fontsize=80;
      CreateXX2_Labels("AA-Panel-1",X.position+Xoffset[Corner]-xoffset+0,Y.position+36, text, fontsize, "Webdings", PanelColor1);
      CreateXX2_Labels("AA-Panel-2",X.position+Xoffset[Corner]-xoffset+0,Y.position+13, text, fontsize, "Webdings", PanelColor1); 
      CreateXX2_Labels("AA-Panel-3",X.position+Xoffset[Corner]-xoffset+2,Y.position+38, text, fontsize-3, "Webdings", PanelColor2); 
      CreateXX2_Labels("AA-Panel-4",X.position+Xoffset[Corner]-xoffset+2,Y.position+15, text, fontsize-3, "Webdings", PanelColor2);
      }
      
      
      
      
int start()
  {  
   int    counted_bars=IndicatorCounted();
   displayMeter();

   return(0);
  }
  


void displayMeter() 
   {
   double ValoreZero[Majors.Number,2];
   color  ColoreZero[Majors.Number,2];
   
   for(int currency=0; currency<Majors.Number; currency++)
      {
      ValoreZero[currency,0] = currency_strength(Majors[currency]);
      ValoreZero[currency,1] = currency;
      }

   if(SortedDisplay)
      {
      int mode=MODE_DESCEND;
      if(Corner > 1)   mode=MODE_ASCEND;
      ArraySort(ValoreZero,WHOLE_ARRAY,0,mode);
      }
      
   int win = WindowFind(NomeIndi);
   double value;
   int j,Y2=Y.position+14;
   string Font,Name;
   for(int i=0; i<Majors.Number; i++)
   {
      j = ValoreZero[i,1];
      color Color=SpringGreen;
      Font="Courier New";
      value=ValoreZero[i,0]*10.0;
      buffer=buffer.name + Majors[j];
      switch(Corner)
      
         {
         case 0: Name=(i+1)+" "+Majors[j]; break;
         case 1: Name=(i+1)+" "+Majors[j]; break;
         case 2: Name=(8-i)+" "+Majors[j]; break;
         case 3: Name=(8-i)+" "+Majors[j]; break;
         }
      
      if(j == chartpair[0] || j == chartpair[1]) {Font="Courier New Bold"; Color=White;}
      objectCreate(buffer+"_nom", Corner, X.position+Xoffset[Corner]-124, Y2, 0, Name, Font.size, Font, Color);
      objectCreate(buffer+"_val", Corner, X.position+Xoffset[Corner]-64, Y2, 0, DoubleToStr(value,0)+"%", Font.size, Font, Color);
      Y2 += 15;
   }  
}


double currency_strength(string couple) {
   int index;
   string Pair;
   double HiLo;
   double ld_28;
   double ld_ret_36 = 0;
   
    
   int cnt = 0;
   for (int i = 0; i < ArraySize(Symbols); i++) {
      index = 0;
      Pair = Symbols[i];
      if (couple == StringSubstr(Pair, 0, 3) || couple == StringSubstr(Pair, 3, 3)) {
         Pair = Pair + space;
         HiLo = (MarketInfo(Pair, MODE_HIGH) - MarketInfo(Pair, MODE_LOW)) * MarketInfo(Pair, MODE_POINT);
         if (HiLo != 0.0) {
            
            ld_28 = 100.0 * ((MarketInfo(Pair, MODE_BID) - MarketInfo(Pair, MODE_LOW)) / HiLo * MarketInfo(Pair, MODE_POINT));
            if (ld_28 >  3.0) index = 1;
            if (ld_28 > 10.0) index = 2;
            if (ld_28 > 25.0) index = 3;
            if (ld_28 > 40.0) index = 4;
            if (ld_28 > 50.0) index = 5;
            if (ld_28 > 60.0) index = 6;
            if (ld_28 > 75.0) index = 7;
            if (ld_28 > 90.0) index = 8;
            if (ld_28 > 97.0) index = 9;
            cnt++;
            if (couple == StringSubstr(Pair, 3, 3)) index = 9 - index;
            ld_ret_36 += index;
         }
      }
   }
   ld_ret_36 /= cnt;
   return (ld_ret_36);  
}



void objectCreate(string nome, int angolo, int val_x, int val_y, int val_ang, string testo = "-", int fontsize = 42, string fontname = "Arial", color color1 = -1)
   {
   if (ObjectFind(nome) != 0)       ObjectCreate(nome, OBJ_LABEL, Window, 0, 0);
   
   ObjectSet(nome, OBJPROP_CORNER, Corner);
   ObjectSet(nome, OBJPROP_COLOR, color1);
   ObjectSet(nome, OBJPROP_BACK, 0);
   ObjectSet(nome, OBJPROP_XDISTANCE, val_x);
   ObjectSet(nome, OBJPROP_YDISTANCE, val_y);
   ObjectSet(nome, OBJPROP_ANGLE, val_ang);
   ObjectSetText(nome, testo, fontsize, fontname, color1);
   }
   
   
   
int CreateXX2_Labels( string bj, int xj, int yj, string text, int fontsize, string font, color colore ) 
   {
   ObjectCreate( bj, OBJ_LABEL, Window, 0, 0 );
   ObjectSet( bj, OBJPROP_CORNER, Corner );
   ObjectSet( bj, OBJPROP_XDISTANCE,xj);
   ObjectSet( bj, OBJPROP_YDISTANCE,yj+(Font.size/fontsize)*UpDown);
   ObjectSet( bj, OBJPROP_BACK, 0 );
   ObjectSetText(bj, text, fontsize, font, colore);
   }



void DeleteExistingLabels() {
   string l_name_4;
   int l_objs_total_0 = ObjectsTotal(OBJ_LABEL);
   if (l_objs_total_0 > 0) {
      for (int l_objs_total_12 = l_objs_total_0; l_objs_total_12 >= 0; l_objs_total_12--) {
         l_name_4 = ObjectName(l_objs_total_12);
         if (StringFind(l_name_4, buffer.name, 0) >= 0) ObjectDelete(l_name_4);
      }
   }
}
//--------------------------------------------Xard@hotmail.co.uk-----+
/*                                                                   
                              ud$$$**$$$$$$$bc.                          
                          u@**"        4$$$$$$$Nu                       
                        J                ""#$$$$$$r                     
                       @                       $$$$b                    
                     .F                        ^*3$$$                   
                    :% 4                         J$$$N                  
                    $  :F                       :$$$$$                  
                   4F  9                       J$$$$$$$                 
                   4$   k             4$$$$bed$$$$$$$$$                 
                   $$r  'F            $$$$$$$$$$$$$$$$$r                
                   $$$   b.           $$$$$$$$$$$$$$$$$N                
                   $$$$$k 3eeed$$b    XARD777."$$$$$$$$$                
    .@$**N.        $$$$$" $$$$$$F'L $$$$$$$$$$$  $$$$$$$                
    :$$L  'L       $$$$$ 4$$$$$$  * $$$$$$$$$$F  $$$$$$F         edNc   
   @$$$$N  ^k      $$$$$  3$$$$*%   $F4$$$$$$$   $$$$$"        d"  z$N  
   $$$$$$   ^k     '$$$"   #$$$F   .$  $$$$$c.u@$$$          J"  @$$$$r 
   $$$$$$$b   *u    ^$L            $$  $$$$$$$$$$$$u@       $$  d$$$$$$ 
    ^$$$$$$.    "NL   "N. z@*     $$$  $$$$$$$$$$$$$P      $P  d$$$$$$$ 
       ^"*$$$$b   '*L   9$E      4$$$  d$$$$$$$$$$$"     d*   J$$$$$r   
            ^$$$$u  '$.  $$$L     "#" d$$$$$$".@$$    .@$"  z$$$$*"     
              ^$$$$. ^$N.3$$$       4u$$$$$$$ 4$$$  u$*" z$$$"          
                '*$$$$$$$$ *$b      J$$$$$$$b u$$P $"  d$$P             
                   #$$$$$$ 4$ 3*$"$*$ $"$'c@@$$$$ .u@$$$P               
                     "$$$$  ""F~$ $uNr$$$^&J$$$$F $$$$#                 
                       "$$    "$$$bd$.TZUMAN$$$$F $$"                   
                         ?k         ?$$$$$$$$$$$F'*                     
                          9$$bL     z$$$$$$$$$$$F                       
                           $$$$    $$$$$$$$$$$$$                        
                            '#$$c  '$$$$$$$$$"                          
                             .@"#$$$$$$$$$$$$b                          
                           z*      $$$$$$$$$$$$N.                       
                         e"      z$$"  #$$$k  '*$$.                     
                     .u*      u@$P"      '#$$c   "$$c                   
              u@$*"""       d$$"            "$$$u  ^*$$b.               
            :$F           J$P"                ^$$$c   '"$$$$$$bL        
           d$$  ..      @$#                      #$$b         '#$       
           #ISMAEL#   4$$                          ^$$k         '$      
            "$$6""$b u$$                             '$    d$$$$$P      
              '$F $$$$$"                              ^b  ^$$$$b$       
               '$W$$$$"                                'b@$$$$"         
                                                        ^$$$*  
*/

Комментарии к исходному коду форекс индикатора !!Y3-MT4 CURRENCY POWER.mq4
В целях безопасности и борьбы со спамом в тексте комментариев запрещено размещать html-теги и ссылки. Благодарим за понимание.

  • X
  • 0% загружено
« индикатор !!Y2-MT4 MATRIX SESSION.mq4
индикатор !!Y4-MT4 PROFITDATA.mq4 »