TRUE Forex

Просмотр кода форекс индикатора !BDP FIBONACCI DAILY.mq4

// +----------------------------------------------------------------------------------------+ //
// |    .-._______                           XARD777                          _______.-.    | //
// |---( )_)______)                 Knowledge of the ancients                (______(_( )---| //
// |  (    ()___)                              \¦/                             (___()    )  | //
// |       ()__)                              (o o)                             (__()       | //
// |--(___()_)__________________________oOOo___(_)___oOOo_________________________(_()___)--| //
// |_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|____|_____| //
// |                                                                                   2011 | //
// |----------------------------------------------------------------------------------------| //
// |                 File:     !BDP FIBONACCI DAILY.mq4                                     | //
// | Programming language:     MQL4                                                         | //
// | Development platform:     MetaTrader 4                                                 | //
// |          End product:     Indicator for MetaTrader 4 designed                          | //
// |                           for Build 229 (current version)                              | //
// |                                                               [BILLION DOLLAR PROJECT] | //
// +----------------------------------------------------------------------------------------+ //

#property indicator_chart_window
#property indicator_buffers 8
#property indicator_color1 Red         // 1.618
#property indicator_width1 2 
#property indicator_color2 Lime        // 1.272
#property indicator_width2 2 
#property indicator_color3 DodgerBlue  // 1.000
#property indicator_width3 2 
#property indicator_color4 Gold        // 0.618
#property indicator_width4 2 
#property indicator_color5 Gold        // 0.382
#property indicator_width5 2 
#property indicator_color6 DodgerBlue  // 0.000
#property indicator_width6 2 
#property indicator_color7 Lime        //-1.272
#property indicator_width7 2 
#property indicator_color8 Red         //-1.618
#property indicator_width8 2 

// ------------------------------------------------------------------------------------------ //
//                            E X T E R N A L   V A R I A B L E S                             //
// ------------------------------------------------------------------------------------------ //

//Input Params
extern string PivotStart = "02:00";
extern string PivotEnd =   "02:00";

// ------------------------------------------------------------------------------------------ //
//                            I N T E R N A L   V A R I A B L E S                             //
// ------------------------------------------------------------------------------------------ //

double Buffer1[];
double Buffer2[];
double Buffer3[];
double Buffer4[];
double Buffer5[];
double Buffer6[];
double Buffer7[];
double Buffer8[];

double LastHigh,LastLow,LastClose;
double Fib1000,Fib0618,Fib0382,Fib0000;
double FibP1272,FibP1618,FibN1272,FibN1618;

int OpenBar;

// ------------------------------------------------------------------------------------------ //
//                             I N I T I A L I S A T I O N                                    //
// ------------------------------------------------------------------------------------------ //

int init()
{  SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,167);
   SetIndexBuffer(0,Buffer1);
   SetIndexLabel(0,"Fibonacci +1.618");

   SetIndexStyle(1,DRAW_ARROW);
   SetIndexArrow(1,167);
   SetIndexBuffer(1,Buffer2);
   SetIndexLabel(1,"Fibonacci +1.272");

   SetIndexStyle(2,DRAW_ARROW);
   SetIndexArrow(2,167);
   SetIndexBuffer(2,Buffer3);
   SetIndexLabel(2,"Fibonacci 1.000");
   
   SetIndexStyle(3,DRAW_ARROW);
   SetIndexArrow(3,167);
   SetIndexBuffer(3,Buffer4);
   SetIndexLabel(3,"Fibonacci 0.618");
   
   SetIndexStyle(4,DRAW_ARROW);
   SetIndexArrow(4,167);
   SetIndexBuffer(4,Buffer5);
   SetIndexLabel(4,"Fibonacci 0.382");
   
   SetIndexStyle(5,DRAW_ARROW);
   SetIndexArrow(5,167);
   SetIndexBuffer(5,Buffer6);
   SetIndexLabel(5,"Fibonacci 0.000");
   
   SetIndexStyle(6,DRAW_ARROW);
   SetIndexArrow(6,167);
   SetIndexBuffer(6,Buffer7);
   SetIndexLabel(6,"Fibonacci -1.272");
   
   SetIndexStyle(7,DRAW_ARROW);
   SetIndexArrow(7,167);
   SetIndexBuffer(7,Buffer8);
   SetIndexLabel(7,"Fibonacci -1.618");
   
   return(0); }

// ------------------------------------------------------------------------------------------ //
//                            D E - I N I T I A L I S A T I O N                               //
// ------------------------------------------------------------------------------------------ //

int deinit() {
    ObjectDelete("Fib161");
    ObjectDelete("Fib127");
    ObjectDelete("Fib100");
    ObjectDelete("Fib618");
    ObjectDelete("Fib382");
    ObjectDelete("Fib000");
    ObjectDelete("Fib128");
    ObjectDelete("Fib162");
    //Comment("");
    return(0); }

// ------------------------------------------------------------------------------------------ //
//                                M A I N   P R O C E D U R E                                 //
// ------------------------------------------------------------------------------------------ //

int start()
{  string BarTime="", LastBarTime="";         
   string BarDay="", LastBarDay="";
   int CloseBar;
          
   for(int i=Bars; i>=0; i--)
   {  if (Period() > 240) return(0);        //Chart cannot be higher than H4
      BarTime = TimeToStr(Time[i], TIME_MINUTES);
      LastBarTime = TimeToStr(Time[i+1], TIME_MINUTES);
      BarDay = TimeToStr(Time[i],TIME_DATE);
      LastBarDay = TimeToStr(Time[i+1],TIME_DATE); 
      
      if ((PivotEnd == "00:00" && BarTime>=PivotEnd && BarDay>LastBarDay) || (BarTime>=PivotEnd && LastBarTime<PivotEnd))
      {  CloseBar = i + 1;
         
         if (OpenBar>0)
         {  calculatePivotRangeValues(OpenBar, CloseBar);  }  }
      
      if ((PivotStart == "00:00" && BarTime>=PivotStart && BarDay>LastBarDay) || (BarTime>=PivotStart && LastBarTime<PivotStart))
      { OpenBar = i; }
      
      if (OpenBar>0)
      { drawIndicators(i);  }
      }
   return(0);
   }
   
void calculatePivotRangeValues(int openBar, int closeBar)
   {
   LastHigh = High[Highest(NULL, 0, MODE_HIGH, (openBar - closeBar + 1), closeBar)];
   LastLow = Low[Lowest(NULL, 0, MODE_LOW, (openBar - closeBar + 1), closeBar)];
   LastClose = Close[closeBar];
   double R  = (LastHigh - LastLow);
   FibP1618 = LastHigh + R * 0.618;
   FibP1272 = LastHigh + R * 0.272;
   Fib1000  = LastHigh;
   Fib0618 = LastLow + R * 0.618;
   Fib0382 = LastLow + R * 0.382;
   Fib0000 = LastLow;
   FibN1272 = LastLow - R * 0.272;
   FibN1618 = LastLow - R * 0.618;       
   }

void drawIndicators(int curBar)
   {
   Buffer1[curBar]=FibP1618;
   Buffer2[curBar]=FibP1272;
   Buffer3[curBar]=Fib1000;
   Buffer4[curBar]=Fib0618;
   Buffer5[curBar]=Fib0382;
   Buffer6[curBar]=Fib0000;
   Buffer7[curBar]=FibN1272;
   Buffer8[curBar]=FibN1618;
   
   DoLabel( "Fib161", Buffer1[0], indicator_color1 );
   DoLabel( "Fib127", Buffer2[0], indicator_color2 );
   DoLabel( "Fib100", Buffer3[0], indicator_color3 );
   DoLabel( "Fib618", Buffer4[0], indicator_color4 );
   DoLabel( "Fib382", Buffer5[0], indicator_color5 );
   DoLabel( "Fib000", Buffer6[0], indicator_color6 );
   DoLabel( "Fib128", Buffer7[0], indicator_color7 );
   DoLabel( "Fib162", Buffer8[0], indicator_color8 );
    return(0); }
    
void DoLabel( string dName, double dValue, color dColor )
   {
   if (ObjectFind(dName) != 0)
      {
      ObjectCreate(dName,OBJ_ARROW,0,Time[0],dValue);
      ObjectSet(dName,OBJPROP_ARROWCODE,SYMBOL_RIGHTPRICE);
      ObjectSet(dName,OBJPROP_COLOR,dColor);
      ObjectSet(dName,OBJPROP_BACK,1);  
      } 
   else
      {
      ObjectMove(dName,0,Time[0],dValue);
      }
   }
// ------------------------------------------------------------------------------------------ //
//                                     E N D   P R O G R A M                                  //
// ------------------------------------------------------------------------------------------ //
/*                                                         
                                        ud$$$**BILLION$bc.                          
                                    u@**"        PROJECT$$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$.$W$$$$$$$$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         '#$       
                     9$$$$$$b   4$$                          ^$$k         '$      
                      "$$6""$b u$$                             '$    d$$$$$P      
                        '$F $$$$$"                              ^b  ^$$$$b$       
                         '$W$$$$"                                'b@$$$$"         
                                                                  ^$$$*/

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

  • X
  • 0% загружено
« индикатор !1~.mq4
индикатор !BySu-Fx info 3.0.mq4 »