TRUE Forex

Просмотр кода форекс индикатора !!Y4-MT4 PROFITDATA.mq4

#property indicator_chart_window

color    color1            = LimeGreen;
color    color3            = White;
color    color4            = DodgerBlue;
color    TextColor2        = C'192,192,192';
color    TextColor3        = C'50,160,50';
color    Warna_Text        = Snow;
color    Warna_Order_Sell  = Orange;
color    Warna_Order_Buy   = DeepSkyBlue;
color    Warna_Rugi        = Orange;
color    Warna_Laba        = DeepSkyBlue;


extern int   X.position     = 0;
extern int   Y.position     = 0;
extern color PanelBgd2         = C'20,20,20';//C'40,65,90';
extern bool  show.right.panel  = true;
int   Corner=1;
int   Window=0;
string NamaFont        = "Arial Black";
int    UkuranFont      = 10;
double posX            = 60;
double posY            = 0;


int Font=9;
int x = NULL;

int         WhatCorner3       = 1;

extern bool show.timer        =  true;
bool        show.extra.digit  =  false;  
int         BidFontSize       =  29;
string      BidFontType       =  "Arial Bold";
int         FontSize          =  11;
string      FontType          =  "Arial";
string      FontType2         =  "Verdana Bold";
double      DecNos;
double      myPoint;

double      col               =  White;

double      SetPoint() 

   { 
   double mPoint; 
   
   if (Digits < 4) 
   mPoint = 0.01; 
   else 
   mPoint = 0.0001; 
   
   return(mPoint); 
   }



   int init()
   {
   IndicatorShortName("Xard Panel");  
    myPoint = SetPoint(); 
        
   return(0);
   }


int deinit()
  {
//----
   int    idx;

   if(x != NULL) {
      for(idx = 0; idx<x; idx++) {
         ObjectDelete("Panel242"+idx);
         ObjectDelete("PL"+idx);
      }
         
      ObjectDelete("Panel241"); 
      ObjectDelete("Panel243");     
      ObjectDelete("h");      
      ObjectDelete("Total1");
      ObjectDelete("Total2");

   }
  
   deleteObjects();
//----
   return(0);
  }
void DisplayText(string objname, string text, int fontsize, color clr,  double X, double Y, string font)
{
   ObjectDelete(objname);
   ObjectCreate(objname, OBJ_LABEL, Window, 0, 0);
   ObjectSetText(objname, text, fontsize, font, clr);
   ObjectSet(objname, OBJPROP_CORNER, Corner);
   ObjectSet(objname, OBJPROP_XDISTANCE, X+posX);
   ObjectSet(objname, OBJPROP_YDISTANCE, Y+posY);
}
  

   int start()
   {
   int    counted_bars=IndicatorCounted();
   int    j;
   int    idx;
   string text;
   double PL;
   double total;
//----
         if(x != NULL) {
            for(idx = 0; idx<x; idx++) {
               ObjectDelete("Panel242"+idx);
               ObjectDelete("Panel243"+idx);
            }
            
            ObjectDelete("Total1");
            ObjectDelete("Total2");
         }
            
         text = "";
         j=0;
         total = 0;
         
         for (int i = OrdersTotal()-1 ; i >= 0; i--) 
         { 
            if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == true)
            { 
               
               if(OrderType() == OP_BUY)  {
               
              //    DisplayText("Panel242"+j, OrderSymbol(), 12, Warna_Order_Buy, 10, Font+28 + j * 18, "Arial Black"); 
                  PL = (OrderClosePrice()-OrderOpenPrice())/MarketInfo(OrderSymbol(),MODE_POINT)/10;
                  total = total + PL;
               //   if(PL<0) DisplayText("Panel243"+j, DoubleToStr(PL, 0), 12, Warna_Rugi, -30, Font+28 + j * 18, "Arial Black"); 
               //   else if(PL>0) DisplayText("Panel243"+j, "+"+DoubleToStr(PL, 0), 12, Warna_Laba, -30, Font+28 + j * 18, "Arial Black"); 
               //   else DisplayText("Panel243"+j, DoubleToStr(PL, 0), 12, Warna_Text, -30, Font+28 + j * 18, "Arial Black"); 
               }
               else if(OrderType() == OP_SELL)  {
                  
              //    DisplayText("Panel242"+j, OrderSymbol(), 12, Warna_Order_Sell, 10, Font+28 + j * 18, "Arial Black"); 
                  PL = (OrderOpenPrice()-OrderClosePrice())/MarketInfo(OrderSymbol(),MODE_POINT)/10;
                  total = total + PL;
               //   if(PL<0) DisplayText("Panel243"+j, DoubleToStr(PL, 0), 12, Warna_Rugi, -30, Font+28 + j * 18, "Arial Black"); 
               //   else if(PL>0) DisplayText("Panel243"+j,"+"+DoubleToStr(PL, 0), 12, Warna_Laba, -30, Font+28 + j * 18, "Arial Black"); 
              //    else DisplayText("Panel243"+j,DoubleToStr(PL, 0), 12, Warna_Text, -30, Font+28 + j * 18, "Arial Black"); 
               }
               j=j+1;
            } 
         } 
         ObjectDelete("Total2");
         DisplayText("Panel241", "PIPS", 12, Warna_Text, 33, 20 , "Arial Black");  
         if(total<0)  DisplayText("Total2", DoubleToStr(total, 0), 12, Warna_Rugi, -30, 20, "Arial Black");
         if (total>0) DisplayText("Total2","+" + DoubleToStr(total, 0), 12, Warna_Laba, -30, 20, "Arial Black");
 
         x=j;
   
   //////////////////////////////////////////////////////////
    if(show.extra.digit){int digit=1;int digitshift=-3;int digitshift1=-5;int digitshift2=3;int fontsize=4;int sprd=1;}
    else{ digitshift=0;digitshift1=0;digitshift2=0;fontsize=0;sprd=0;}

        
   if (StringFind (Symbol(), "JPY", 0) != -1){ DecNos = 2+digit;}
   else if(Symbol()=="XAUUSD" || Symbol()=="XAUUSDm"){ DecNos = 1+digit; }
   else if(Symbol()=="XAGUSD" || Symbol()=="XAGUSDm"){ DecNos = 2+digit; }
   else if(Symbol()=="USDMXN" || Symbol()=="USDMXNm"){ DecNos = 3+digit; }
   else if(Symbol()=="GBPMXN" || Symbol()=="GBPMXNm"){ DecNos = 3+digit; }
  // else if(Symbol()=="USDZAR" || Symbol()=="USDZARm"){ DecNos = 4+digit; }
   else { DecNos = 4+digit; } 
     
        
   counted_bars=IndicatorCounted();

   if(show.right.panel){   
   Create.right.top.panel("Panel001",20,18);  ObjectSetText("Panel001", "ggggg", 18, "Webdings", PanelBgd2);
   Create.right.top.panel("Panel002",2,18);  ObjectSetText("Panel002", "ggggg", 18, "Webdings", PanelBgd2);
 //  Create.right.top.panel("Panel003",5,242);  ObjectSetText("Panel003", "g", 98, "Webdings", PanelBgd2);
 //  Create.right.top.panel("Panel004",5,362);  ObjectSetText("Panel004", "g", 98, "Webdings", PanelBgd2);
   //-----
//   Create.right.bot.panel("Panel006",5,6);    ObjectSetText("Panel006", "g", 98, "Webdings", PanelBgd2);
//   Create.right.bot.panel("Panel007",5,122);  ObjectSetText("Panel007", "g", 98, "Webdings", PanelBgd2);
//   Create.right.bot.panel("Panel008",5,242);  ObjectSetText("Panel008", "g", 98, "Webdings", PanelBgd2);
//   Create.right.bot.panel("Panel009",5,362);  ObjectSetText("Panel009", "g", 98, "Webdings", PanelBgd2);  
   }//End show.panel.. reason for gap at top of panel is for smiley face to be seen if an expert is run

 
   double spread = (Ask-Bid)/myPoint;
   if(spread>1 && spread<=10)
   
   int sprdshift=4;
   
   string symbol=Symbol();
   if(StringLen(symbol)==7) symbol=StringSubstr(symbol,0,6);
    int syblsize = 5;int syblshift=2;

   if(show.timer) Show_Timer();
     
   return(0);  

}
   
void Show_Timer()
{
int Bar.Hour = Time[0] + 60 * Period() - TimeCurrent();
   double ld_0 = Bar.Hour / 60.0;
   int Bar.Sec = Bar.Hour % 60;
   Bar.Hour = (Bar.Hour - Bar.Hour % 60) / 60;
   
   if(Bar.Sec<=9)string zero="0";
   if(Bar.Hour>=1 && Bar.Hour<=9)int shift=-1;
   else if(Bar.Hour>=10 && Bar.Hour<=99)shift=-6;
   else if(Bar.Hour>=100 && Bar.Hour<=999)shift=-15;
   else if(Bar.Hour>=1000 && Bar.Hour<=9999)shift=-16;
   else if(Bar.Hour>=10000 && Bar.Hour<=99999)shift=-19;
   
   CreateFX3_Labels( "Panel013",14+shift,0); 
   ObjectSetText("Panel013", "t-" + Bar.Hour + ":"+zero+"" + Bar.Sec, 13, FontType2, White);
}      
   
   int CreateFX3_Labels( string c, int x2, int y2 ) {
   ObjectCreate( c, OBJ_LABEL,Window, 0, 0 );
   ObjectSet( c, OBJPROP_CORNER, WhatCorner3 );
   ObjectSet( c, OBJPROP_XDISTANCE,x2+X.position+10);
   ObjectSet( c, OBJPROP_YDISTANCE,y2+Y.position+0);
   ObjectSet( c, OBJPROP_BACK, false );
   }
  
  int Create.right.top.panel( string e, int x3, int y3 ) {
   ObjectCreate( e, OBJ_LABEL,Window, 0, 0 );
   ObjectSet( e, OBJPROP_CORNER, Corner );
   ObjectSet( e, OBJPROP_XDISTANCE,x3);
   ObjectSet( e, OBJPROP_YDISTANCE,y3);
   ObjectSet( e, OBJPROP_BACK, false );
   }
   
 /*  int Create.right.bot.panel( string g, int x3b, int y3b ) {
   ObjectCreate( g, OBJ_LABEL,Window, 0, 0 );
   ObjectSet( g, OBJPROP_CORNER, WhatCorner3 );
   ObjectSet( g, OBJPROP_XDISTANCE,x3b);
   ObjectSet( g, OBJPROP_YDISTANCE,y3b);
   ObjectSet( g, OBJPROP_BACK, false );
   }*/
  
  
   void deleteObjects(){
   
   ObjectDelete("Panel001");
   ObjectDelete("Panel002");
   ObjectDelete("Panel003");
   ObjectDelete("Panel004");
   ObjectDelete("Panel005");
   ObjectDelete("Panel006");
   ObjectDelete("Panel007");
   ObjectDelete("Panel008");
   ObjectDelete("Panel009");
   ObjectDelete("Panel010");
   ObjectDelete("Panel011");
   ObjectDelete("Panel012");
   ObjectDelete("Panel013");
   }
   //--------------------------------------------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@$$$$"         
                                                        ^$$$*  
*/

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

  • X
  • 0% загружено
« индикатор !!Y3-MT4 CURRENCY POWER.mq4
индикатор !!Z01-MT4 LSMA 2D.mq4 »