TRUE Forex

Просмотр кода форекс индикатора ! 0 1 aa DBY.mq4

//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//|                                          ! 2 Yesterday.mq4       |
//|                                                                  |  
//|        DBY         the day before Yesterday DBY                  |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2015"


#property description "Показывает HLOC позавчера"
#property description "* поручик *      4.10.16"

#property indicator_chart_window
#property  indicator_buffers 4

string  HL_name1 = "DBY HIGH";            // Can be renamed to create a unique horizontal line.
string  HL_desc1 = "Alert_10";            // Alert_##    ## serves as a numerical set point for the Alerter EA by Tesla.
                                          // Set numerical value to desired distance from the horizontal line to receive alert.
color   HL_color1 = clrRed;
int     HL_style1 = 0;                    // STYLE:  0 - solid, 1 - dash, 2 - dot, 3 - dashdot, 4 - dashdotdot
int     HL_width1 = 2;                    // WIDTH:  1, 2, 3, 4, 5

string  HL_name2 = "DBY LOW";       
string  HL_desc2 = "Alert_10";         
color   HL_color2 = clrBlue;
int     HL_style2 = 0;                 
int     HL_width2 = 2;                 
 
string  HL_name3 = "DBY OPEN";       
string  HL_desc3 = "Alert_10";         
color   HL_color3 = clrDarkOrange;
int     HL_style3 = 0;                 
int     HL_width3 = 2; 

string  HL_name4 = "DBY Close";       
string  HL_desc4 = "Alert_10";         
color   HL_color4 = clrGreen;
int     HL_style4 = 0;                 
int     HL_width4 = 3;                 
 
string  HL_name5 = "DBY MEDIAN";       
string  HL_desc5 = "Alert_10";         
color   HL_color5 = clrDarkBlue;
int     HL_style5 = 4;                 
int     HL_width5 = 1;      
        
int     iHr1 = 3600;       // one hour          Used to offset event time for visiual effect
int     iHr12 = 43200;     // twelve hours      Used to offset event time start for visual effect
   
double array_daily[3][6];

//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
  
int start()
  {
      ObjectDelete(HL_name1);
      ObjectDelete(HL_name2);
      ObjectDelete(HL_name3);
      ObjectDelete(HL_name4);
      ObjectDelete(HL_name5);
  
      ArrayCopyRates(array_daily,Symbol(),PERIOD_D1);
      
      {
      datetime dtToday         = array_daily[0][0];
      double   dTodayOpen      = array_daily[0][1];
      datetime dtDBY      = array_daily[2][0];
      double   dDBYHigh   = array_daily[2][3];
      double   dDBYLow    = array_daily[2][2];
      double   dDBYOpen   = array_daily[2][1];
      double   dDBYClose  = array_daily[2][4];
      double   dDBYMedian = (dDBYHigh + dDBYLow)/2;
   
//----  
      {   
      DrawObjects(HL_name1,dtDBY,dDBYHigh,TimeCurrent(),dDBYHigh,HL_color1,HL_style1,HL_width1,HL_desc1);
      DrawObjects(HL_name2,dtDBY,dDBYLow,TimeCurrent(),dDBYLow,HL_color2,HL_style2,HL_width2,HL_desc2);
      DrawObjects(HL_name3,dtDBY,dDBYOpen,TimeCurrent(),dDBYOpen,HL_color3,HL_style3,HL_width3,HL_desc3);
      DrawObjects(HL_name4,dtToday-iHr1,dDBYClose,TimeCurrent(),dDBYClose,HL_color4,HL_style4,HL_width4,HL_desc4);
      DrawObjects(HL_name5,dtToday-iHr12,dDBYMedian,TimeCurrent(),dDBYMedian,HL_color5,HL_style5,HL_width5,HL_desc5);      
      } 
    return(0);  
}
}
void DrawObjects(string sObjName,datetime dtTime1,double dPrice1,datetime dtTime2,double dPrice2,color HL_color,int HL_style,int HL_width, string sObjDesc)
   {
      ObjectCreate(sObjName,OBJ_TREND,0,dtTime1,dPrice1,dtTime2,dPrice2); 
      ObjectSet(sObjName,OBJPROP_COLOR,HL_color);
      ObjectSet(sObjName,OBJPROP_STYLE,HL_style);
      ObjectSet(sObjName,OBJPROP_WIDTH,HL_width);
      ObjectSetText(sObjName,sObjDesc,10,"Times New Roman",clrBlack); 
   }
      
//+------------------------------------------------------------------+

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

  • X
  • 0% загружено
« индикатор ! $ 2012 SEMA4X - White Only.mq4
индикатор ! 0 aVert mtf.mq4 »