TRUE Forex

Просмотр кода форекс индикатора ! T_Kiads BMI Long Mod v01.mq4

//+------------------------------------------------------------------+
//|                                 !   T_Kiads BMI Long Mod v01.mq4 |
//|                 Original Copyright by:BlueMental, Mod by T_Kiads |
//|                                             http://www.kiads.net |
//+------------------------------------------------------------------+
#property copyright "Original Copyright by:BlueMental, Mod by T_Kiads"
#property link      "http://www.kiads.net"
/*=============================================================================================
1. Automatic_Zoom-
   This feature will have widths automatically adjust, with the next arriving tick, to what 
   is appropriate for the chart zoom setting.  When MT4 is first started the bar widths are 
   incorrect until the first tick arrives.  If ticks are slow coming, or if there is no live
   feed (weekend/holiday), you can force the width adjustment by switching the chart TF.  
      
   The widths are set by code based on encountered "WindowBarsPerChart( )".  As you zoom
   out, there are more.  As you zoom in there are less.  This might be affected by the 
   width capacity of the monitor.  Extra wide monitors, if showing more bars per chart
   on all zoom settings than what the code expects, can result in narrower bars displayed 
   than intended.  This is because the additional bars encountered are interpreted by the 
   code as meaning the chart has been zoomed out an extra step or more, and the code displays
   the narrower bar widths that would otherwise be appropriate.  Downsizing charts presents a 
   problem also, causing bar widths that are too wide because the fewer bars encountered are 
   interpreted by the code as meaning the chart has been zoomed in an extra step or more.  It
   therefore displays the wider bars that would otherwise be appropriate.  So, in cases of an 
   extra wide monitor or downsizing of charts, undesirable results can occur and you should 
   use the manual width adjustment.  
            
2. Manual_Zoom_01234-
   For reasons stated in #1 above, or if you tend to use only the standard zoom setting, or 
   some other single zoom setting, manually selecting the zoom setting is the best choice.  
   Selecting "0" sets widths appropriate for the two chart zoom out/"-" settings that are
   below the standard chart zoom setting.  Selecting "1" sets width appropriate for the Mt4
   standard/default chart zoom setting.  Apply "2,3, or 4" for zooming in/"+" on a chart from
   the standard zoom setting to get the wider bars that are appropriate.  
*/
//=============================================================================================
#property indicator_separate_window
#property indicator_buffers 8
#property indicator_color1 Gray   // 0 HistogramBuffer2
#property indicator_color2 Maroon      // 0 HistogramBuffer2
#property indicator_color3 Blue        // 1 HistogramBuffer1
//#property indicator_color4 DodgerBlue  // 2 SignalLineGold
//#property indicator_color5 White       // 3 MACDLineBuffer
//#property indicator_color6 DeepPink    // 4 SignalLineBuffer
//#property indicator_color7 DarkOrange  // 5 UpperLine
//#property indicator_color8 SpringGreen // 6 LowerLine

#property indicator_width3 1
#property indicator_width4 3
#property indicator_width5 3
#property indicator_width6 3
#property indicator_width7 3
#property indicator_width8 3

#property indicator_level1    0.002
#property indicator_level2    -0.002
#property indicator_level3    0.004
#property indicator_level4    -0.004
#property indicator_level5    0.008
#property indicator_level6    -0.008



#property indicator_levelwidth 1
#property indicator_levelcolor Aqua

//---- input parameters
extern string  IndicatorID       =  "1";
extern bool    Automatic_Zoom    =  true;
extern int     Manual_Zoom_01234 =  1;
extern int     FastMAPeriod      =  24;   //144 //75 
extern int     SlowMAPeriod      =  72;  //312 //365
extern int     SignalMAPeriod    =  36;   //108 //60
extern int     MAmethod          =  1;
extern int     MAprice           =  4;
extern int     MAprecision       =  5;
extern color   OsMAClr           =  DodgerBlue;
extern color   MACDClr           =  White;
extern color   SIGNClr           =  DeepPink;
extern color   UPBBClr           =  DarkOrange;
extern color   LOBBClr           =  SpringGreen;

extern bool    BBonSignal        =  false;
extern bool    BBonMACDline      =  true;
extern int     BBperiod          =  4;
extern double  BBdeviation       =  8;
extern int     BBshift           =  0;
extern int     BBprecision       =  3;
extern double  Alpha_adjuster1   = 36;
extern double  Alpha_adjuster2   =  12;
extern double  MACD_Multiplier   =  2;
extern bool    UseStochFilter    =  true;
extern string  txt01             =  "Stoch Setting";
extern int     Kperiod           =  5;
extern int     Dperiod           =  2;
extern int     Slowing           =  1;
extern bool    ShowZeroLine      =  true;
extern color   ZeroLineColor     =  Yellow;
extern int     ZeroLineStyle     =  0;
extern int     ZeroLineWidth     =  2;
extern bool    ShowLegend        =  true;
extern color   UpColor           =  SpringGreen;
extern color   DnColor           =  HotPink;
extern color   FlColor           =  DodgerBlue;

//---- buffers
double MACDLineBuffer[];
double SignalLineBuffer[];
double HistogramBuffer1[];
double HistogramBuffer2[];
double HistogramBuffer3[];
double SignalLineGold[];
double UpperLine[];
double LowerLine[];

//---- variables
double alpha = 0;
double alpha_1 = 0;
string ShortName;
string FontType                  =  "Terminal";
int    FontSize                  =  10;

//---- auto_zoom parameters (you can adjust this numbers if your display hv high resolution/wide screen display)
int         Bar_Width;
int         Zoom_Out_2_Bars      =  1200;
int         Zoom_Out_1_Bars      =  700;
int         Zoom_Std_Bars        =  300;
int         Zoom_In_1_Bars       =  150;
int         Zoom_In_2_Bars       =  60;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
{
   // Auto_Zoom Initial setting
   if(Automatic_Zoom)   
    {
          if (WindowBarsPerChart( ) >= Zoom_Out_2_Bars) {Bar_Width = 0;} 
    else {if (WindowBarsPerChart( ) >= Zoom_Out_1_Bars) {Bar_Width = 1;} 
    else {if (WindowBarsPerChart( ) >= Zoom_Std_Bars)   {Bar_Width = 2;} 
    else {if (WindowBarsPerChart( ) >= Zoom_In_1_Bars)  {Bar_Width = 3;} 
    else {if (WindowBarsPerChart( ) >= Zoom_In_2_Bars)  {Bar_Width = 6;} 
    else {Bar_Width = 13;} }}}}
    }
  else //Manually Adjust Width
    {
          if (Manual_Zoom_01234 <= 0) {Bar_Width = 1;}
    else {if (Manual_Zoom_01234 == 1) {Bar_Width = 2;}
    else {if (Manual_Zoom_01234 == 2) {Bar_Width = 3;}
    else {if (Manual_Zoom_01234 == 3) {Bar_Width = 6;}
    else {Bar_Width = 13;} }}}
    }
   
   //   IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+1);
   //---- indicators
   SetIndexStyle        (0,DRAW_HISTOGRAM,0, Bar_Width);
   SetIndexBuffer       (0,HistogramBuffer2);   // MACD Histo above 0
   SetIndexDrawBegin    (0,SlowMAPeriod);
   
   SetIndexStyle        (1,DRAW_HISTOGRAM,0, Bar_Width);
   SetIndexBuffer       (1,HistogramBuffer3);   //MACD Histo bellow 0
   SetIndexDrawBegin    (1,SlowMAPeriod);
   
   SetIndexStyle        (2,DRAW_HISTOGRAM);
   SetIndexBuffer       (2,HistogramBuffer1);   //OsMA Histo
   SetIndexDrawBegin    (2,0);//SlowMAPeriod+SignalMAPeriod);

   SetIndexStyle        (3,DRAW_LINE,EMPTY,EMPTY,OsMAClr);
   SetIndexBuffer       (3,SignalLineGold);
   SetIndexDrawBegin    (3,SlowMAPeriod);

   SetIndexStyle        (4,DRAW_LINE,EMPTY,EMPTY,MACDClr);
   SetIndexBuffer       (4,MACDLineBuffer);
   SetIndexDrawBegin    (4,0);//SlowMAPeriod);

   SetIndexStyle        (5,DRAW_LINE,EMPTY,EMPTY,SIGNClr);
   SetIndexBuffer       (5,SignalLineBuffer);  
   SetIndexDrawBegin    (5,SlowMAPeriod);//SlowMAPeriod+SignalMAPeriod);

   SetIndexStyle        (6,DRAW_LINE,EMPTY,EMPTY,UPBBClr);
   SetIndexBuffer       (6,UpperLine);
   SetIndexDrawBegin    (6,0);

   SetIndexStyle        (7,DRAW_LINE,EMPTY,EMPTY,LOBBClr);
   SetIndexBuffer       (7,LowerLine);  
   SetIndexDrawBegin    (7,0);


   
   
   //---- name for DataWindow and indicator subwindow label
   ShortName            ="T_Kiads BMI Long Mod v01("+FastMAPeriod+","+SlowMAPeriod+","+SignalMAPeriod+")";
   IndicatorShortName   (ShortName);
   SetIndexLabel        (0,"MACD Histo abv 0");
   SetIndexLabel        (1,"MACD Histo blw 0");
   SetIndexLabel        (2,"OsMA Histo");
   SetIndexLabel        (3,"OsMA Line");
   SetIndexLabel        (4,"MACD Line");
   SetIndexLabel        (5,"MACD Signal");
   SetIndexLabel        (6,"UpperLine");
   SetIndexLabel        (7,"LowerLine");
   //----
    alpha =Alpha_adjuster1 / (SignalMAPeriod + Alpha_adjuster2);
    alpha_1 = 1.0 - alpha;
   //----
   
   return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
{
   //---- 
   ObjectDelete   (  "Zeroline"+IndicatorID  );
   //----
   return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
{
   int limit,i,j;
   int counted_bars = IndicatorCounted();
   double StoMain, StoSign;
   //---- check for possible errors
   if (counted_bars<0) return(-1);
   //---- last counted bar will be recounted
   if (counted_bars>0) counted_bars--;
   limit = Bars - counted_bars;

   for(i=limit; i>=0; i--)
   {
      MACDLineBuffer[i]    =  NormalizeDouble   (
                                                   iMA(NULL,0,FastMAPeriod,0,MAmethod,MAprice,i)-
                                                   iMA(NULL,0,SlowMAPeriod,0,MAmethod,MAprice,i),
                                                MAprecision)*MACD_Multiplier;
      SignalLineBuffer[i]  =  NormalizeDouble   (
                                                   (alpha*MACDLineBuffer[i] + alpha_1*SignalLineBuffer[i+1])*1,
                                                MAprecision);

      SignalLineGold[i]    =  NormalizeDouble   (  
                                                   (MACDLineBuffer[i] - SignalLineBuffer[i])*Alpha_adjuster1,
                                                MAprecision);
      HistogramBuffer1[i]  =  NormalizeDouble   (
                                                   (MACDLineBuffer[i] - SignalLineBuffer[i])*Alpha_adjuster1,
                                                MAprecision);//-HistogramBuffer2[i+1];
      
      StoMain              =  iStochastic(NULL,0,Kperiod,Dperiod,Slowing,MAmethod,MAprice,0,i);
      StoSign              =  iStochastic(NULL,0,Kperiod,Dperiod,Slowing,MAmethod,MAprice,1,i);
      
      if       (UseStochFilter)
               {
               if       (StoMain>StoSign)
               {
               HistogramBuffer2[i] =   NormalizeDouble(MACDLineBuffer[i],MAprecision);// - SignalLineGold[i];
               HistogramBuffer3[i] =   EMPTY_VALUE;
               }
               else if  (StoMain<StoSign)
               {
               HistogramBuffer2[i] =   EMPTY_VALUE;
               HistogramBuffer3[i] =   NormalizeDouble(MACDLineBuffer[i],MAprecision);// - SignalLineGold[i];
               }
               }
      else if  (!UseStochFilter)
               {
               if       (MACDLineBuffer[i]>SignalLineBuffer[i])
                        {
                        HistogramBuffer2[i] =   NormalizeDouble(MACDLineBuffer[i],MAprecision);// - SignalLineGold[i];
                        HistogramBuffer3[i] =   EMPTY_VALUE;
                        }
               else if  (MACDLineBuffer[i]<SignalLineBuffer[i])
                        {
                        HistogramBuffer2[i] =   EMPTY_VALUE;
                        HistogramBuffer3[i] =   NormalizeDouble(MACDLineBuffer[i],MAprecision);// - SignalLineGold[i];
                        }
               }
   if       (ShowLegend)
            {
            string   OsMAArea,OsMADirx,MAcdArea,MAcdDirx,SignArea,SignDirx;
            color    OsMAAreaClr,OsMADirxClr,MAcdAreaClr,MAcdDirxClr,SignAreaClr,SignDirxClr;
            //==========
            if       (SignalLineGold[i]>  0                    )  {OsMAArea="Above Zero";    OsMAAreaClr=UpColor;}
            else if  (SignalLineGold[i]<  0                    )  {OsMAArea="Bellow Zero";   OsMAAreaClr=DnColor;}  
            else                                                  {OsMAArea="At Zero";       OsMAAreaClr=FlColor;}
            if       (SignalLineGold[i]>  SignalLineGold[i+1]  )  {OsMADirx="_UpHill";       OsMADirxClr=UpColor;}
            else if  (SignalLineGold[i]<  SignalLineGold[i+1]  )  {OsMADirx="_DownHill";     OsMADirxClr=DnColor;}     
            else                                                  {OsMADirx="_FlatLine";     OsMADirxClr=FlColor;}       
            //==========
            if       (MACDLineBuffer[i]>  0                    )  {MAcdArea="Above Zero";    MAcdAreaClr=UpColor;}
            else if  (MACDLineBuffer[i]<  0                    )  {MAcdArea="Bellow Zero";   MAcdAreaClr=DnColor;}  
            else                                                  {MAcdArea="At Zero";       MAcdAreaClr=FlColor;}
            if       (MACDLineBuffer[i]>  MACDLineBuffer[i+1]  )  {MAcdDirx="_UpHill";       MAcdDirxClr=UpColor;}
            else if  (MACDLineBuffer[i]<  MACDLineBuffer[i+1]  )  {MAcdDirx="_DownHill";     MAcdDirxClr=DnColor;}     
            else                                                  {MAcdDirx="_FlatLine";     MAcdDirxClr=FlColor;}       
            //==========
            if       (SignalLineBuffer[i]>  0                  )  {SignArea="Above Zero";    SignAreaClr=UpColor;}
            else if  (SignalLineBuffer[i]<  0                  )  {SignArea="Bellow Zero";   SignAreaClr=DnColor;}  
            else                                                  {SignArea="At Zero";       SignAreaClr=FlColor;}
            if       (SignalLineBuffer[i]>SignalLineBuffer[i+1])  {SignDirx="_UpHill";       SignDirxClr=UpColor;}
            else if  (SignalLineBuffer[i]<SignalLineBuffer[i+1])  {SignDirx="_DownHill";     SignDirxClr=DnColor;}     
            else                                                  {SignDirx="_FlatLine";     SignDirxClr=FlColor;}       
            //==========
            
            
            }
   }
   
   for(j=limit; j>=0; j--)
   {   
   if       (BBonSignal && !BBonMACDline)
            {
            UpperLine[j]   =NormalizeDouble(iBandsOnArray(SignalLineGold,0,BBperiod,BBdeviation,BBshift,1,j),BBprecision);
            LowerLine[j]   =NormalizeDouble(iBandsOnArray(SignalLineGold,0,BBperiod,BBdeviation,BBshift,2,j),BBprecision);
            }
   else if  (!BBonSignal && BBonMACDline)
            {
            UpperLine[j]   =NormalizeDouble(iBandsOnArray(MACDLineBuffer,0,BBperiod,BBdeviation,BBshift,1,j),BBprecision);
            LowerLine[j]   =NormalizeDouble(iBandsOnArray(MACDLineBuffer,0,BBperiod,BBdeviation,BBshift,2,j),BBprecision);
            }
   else if  (BBonSignal && BBonMACDline)
            {
            UpperLine[j]   =( NormalizeDouble(iBandsOnArray(SignalLineGold,0,BBperiod,BBdeviation,BBshift,1,j),BBprecision)+
                              NormalizeDouble(iBandsOnArray(MACDLineBuffer,0,BBperiod,BBdeviation,BBshift,1,j),BBprecision))/2;
            LowerLine[j]   =( NormalizeDouble(iBandsOnArray(SignalLineGold,0,BBperiod,BBdeviation,BBshift,2,j),BBprecision)+
                              NormalizeDouble(iBandsOnArray(MACDLineBuffer,0,BBperiod,BBdeviation,BBshift,2,j),BBprecision))/2;
            }
   else     {
            UpperLine[j]   =EMPTY_VALUE;
            LowerLine[j]   =EMPTY_VALUE;
            }
   if       (ShowLegend)
            {
            string   UPBBArea,UPBBDirx,LOBBArea,LOBBDirx;
            color    UPBBAreaClr,UPBBDirxClr,LOBBAreaClr,LOBBDirxClr;
            //==========
            if       (UpperLine[j]>  0           ) {UPBBArea="Above Zero";    UPBBAreaClr=UpColor;}
            else if  (UpperLine[j]<  0           ) {UPBBArea="Bellow Zero";   UPBBAreaClr=DnColor;}  
            else                                   {UPBBArea="At Zero";       UPBBAreaClr=FlColor;}
            if       (UpperLine[j]>UpperLine[j+1]) {UPBBDirx="_UpHill";       UPBBDirxClr=UpColor;}
            else if  (UpperLine[j]<UpperLine[j+1]) {UPBBDirx="_DownHill";     UPBBDirxClr=DnColor;}     
            else                                   {UPBBDirx="_FlatLine";     UPBBDirxClr=FlColor;}       
            //==========
            if       (LowerLine[j]>  0           ) {LOBBArea="Above Zero";    LOBBAreaClr=UpColor;}
            else if  (LowerLine[j]<  0           ) {LOBBArea="Bellow Zero";   LOBBAreaClr=DnColor;}  
            else                                   {LOBBArea="At Zero";       LOBBAreaClr=FlColor;}
            if       (LowerLine[j]>LowerLine[j+1]) {LOBBDirx="_UpHill";       LOBBDirxClr=UpColor;}
            else if  (LowerLine[j]<LowerLine[j+1]) {LOBBDirx="_DownHill";     LOBBDirxClr=DnColor;}     
            else                                   {LOBBDirx="_FlatLine";     LOBBDirxClr=FlColor;}       
            //==========
            
            }
   }
   
   if       (ShowZeroLine)
            {
            ObjectDelete   (  "Zeroline"+IndicatorID  );
            ObjectCreate   (  "Zeroline"+IndicatorID, OBJ_HLINE,     WindowFind(ShortName),Time[0],0);
            ObjectSet      (  "Zeroline"+IndicatorID, OBJPROP_COLOR, ZeroLineColor );
            ObjectSet      (  "Zeroline"+IndicatorID, OBJPROP_STYLE, ZeroLineStyle );
            ObjectSet      (  "Zeroline"+IndicatorID, OBJPROP_WIDTH, ZeroLineWidth );
            ObjectSet      (  "Zeroline"+IndicatorID, OBJPROP_BACK,  True          );
            }
   if       (ShowLegend)
            {
            ObjectDelete   (  "OsMAtxt1"+IndicatorID  );
            ObjectCreate   (  "OsMAtxt1"+IndicatorID, OBJ_LABEL,     WindowFind(ShortName),  0, 0, 0, 0  );
            ObjectSet      (  "OsMAtxt1"+IndicatorID, OBJPROP_CORNER,   1  );
            ObjectSet      (  "OsMAtxt1"+IndicatorID, OBJPROP_XDISTANCE,260);
            ObjectSet      (  "OsMAtxt1"+IndicatorID, OBJPROP_YDISTANCE,5  );
            ObjectSetText  (  "OsMAtxt1"+IndicatorID, "ЫЫ", FontSize,   FontType, OsMAClr);
            
            ObjectDelete   (  "OsMAtxt2"+IndicatorID  );
            ObjectCreate   (  "OsMAtxt2"+IndicatorID, OBJ_LABEL,     WindowFind(ShortName),  0, 0, 0, 0  );
            ObjectSet      (  "OsMAtxt2"+IndicatorID, OBJPROP_CORNER,   1  );
            ObjectSet      (  "OsMAtxt2"+IndicatorID, OBJPROP_XDISTANCE,170);
            ObjectSet      (  "OsMAtxt2"+IndicatorID, OBJPROP_YDISTANCE,5  );
            ObjectSetText  (  "OsMAtxt2"+IndicatorID, "OsMA Line:",   FontSize+1, FontType, OsMAClr);
            
            ObjectDelete   (  "OsMAtxt3"+IndicatorID  );
            ObjectCreate   (  "OsMAtxt3"+IndicatorID, OBJ_LABEL,     WindowFind(ShortName),  0, 0, 0, 0  );
            ObjectSet      (  "OsMAtxt3"+IndicatorID, OBJPROP_CORNER,   1  );
            ObjectSet      (  "OsMAtxt3"+IndicatorID, OBJPROP_XDISTANCE,80 );
            ObjectSet      (  "OsMAtxt3"+IndicatorID, OBJPROP_YDISTANCE,5  );
            ObjectSetText  (  "OsMAtxt3"+IndicatorID, OsMAArea,       FontSize+1, FontType, OsMAAreaClr);
            
            ObjectDelete   (  "OsMAtxt4"+IndicatorID  );
            ObjectCreate   (  "OsMAtxt4"+IndicatorID, OBJ_LABEL,     WindowFind(ShortName),  0, 0, 0, 0  );
            ObjectSet      (  "OsMAtxt4"+IndicatorID, OBJPROP_CORNER,   1  );
            ObjectSet      (  "OsMAtxt4"+IndicatorID, OBJPROP_XDISTANCE,10 );
            ObjectSet      (  "OsMAtxt4"+IndicatorID, OBJPROP_YDISTANCE,5  );
            ObjectSetText  (  "OsMAtxt4"+IndicatorID, OsMADirx,       FontSize+1, FontType, OsMADirxClr);
            //==============
            ObjectDelete   (  "MACDtxt1"+IndicatorID  );
            ObjectCreate   (  "MACDtxt1"+IndicatorID, OBJ_LABEL,     WindowFind(ShortName),  0, 0, 0, 0  );
            ObjectSet      (  "MACDtxt1"+IndicatorID, OBJPROP_CORNER,   1  );
            ObjectSet      (  "MACDtxt1"+IndicatorID, OBJPROP_XDISTANCE,260);
            ObjectSet      (  "MACDtxt1"+IndicatorID, OBJPROP_YDISTANCE,20 );
            ObjectSetText  (  "MACDtxt1"+IndicatorID, "ЫЫ", FontSize,   FontType, MACDClr);
            
            ObjectDelete   (  "MACDtxt2"+IndicatorID  );
            ObjectCreate   (  "MACDtxt2"+IndicatorID, OBJ_LABEL,     WindowFind(ShortName),  0, 0, 0, 0  );
            ObjectSet      (  "MACDtxt2"+IndicatorID, OBJPROP_CORNER,   1  );
            ObjectSet      (  "MACDtxt2"+IndicatorID, OBJPROP_XDISTANCE,170);
            ObjectSet      (  "MACDtxt2"+IndicatorID, OBJPROP_YDISTANCE,20 );
            ObjectSetText  (  "MACDtxt2"+IndicatorID, "MACD Line:",   FontSize+1, FontType, MACDClr);
            
            ObjectDelete   (  "MACDtxt3"+IndicatorID  );
            ObjectCreate   (  "MACDtxt3"+IndicatorID, OBJ_LABEL,     WindowFind(ShortName),  0, 0, 0, 0  );
            ObjectSet      (  "MACDtxt3"+IndicatorID, OBJPROP_CORNER,   1  );
            ObjectSet      (  "MACDtxt3"+IndicatorID, OBJPROP_XDISTANCE,80 );
            ObjectSet      (  "MACDtxt3"+IndicatorID, OBJPROP_YDISTANCE,20 );
            ObjectSetText  (  "MACDtxt3"+IndicatorID, MAcdArea,       FontSize+1, FontType, MAcdAreaClr);
            
            ObjectDelete   (  "MACDtxt4"+IndicatorID  );
            ObjectCreate   (  "MACDtxt4"+IndicatorID, OBJ_LABEL,     WindowFind(ShortName),  0, 0, 0, 0  );
            ObjectSet      (  "MACDtxt4"+IndicatorID, OBJPROP_CORNER,   1  );
            ObjectSet      (  "MACDtxt4"+IndicatorID, OBJPROP_XDISTANCE,10 );
            ObjectSet      (  "MACDtxt4"+IndicatorID, OBJPROP_YDISTANCE,20 );
            ObjectSetText  (  "MACDtxt4"+IndicatorID, MAcdDirx,       FontSize+1, FontType, MAcdDirxClr);
            //==============
            ObjectDelete   (  "SIGNtxt1"+IndicatorID  );
            ObjectCreate   (  "SIGNtxt1"+IndicatorID, OBJ_LABEL,     WindowFind(ShortName),  0, 0, 0, 0  );
            ObjectSet      (  "SIGNtxt1"+IndicatorID, OBJPROP_CORNER,   1  );
            ObjectSet      (  "SIGNtxt1"+IndicatorID, OBJPROP_XDISTANCE,260);
            ObjectSet      (  "SIGNtxt1"+IndicatorID, OBJPROP_YDISTANCE,35 );
            ObjectSetText  (  "SIGNtxt1"+IndicatorID, "ЫЫ", FontSize,   FontType, SIGNClr);
            
            ObjectDelete   (  "SIGNtxt2"+IndicatorID  );
            ObjectCreate   (  "SIGNtxt2"+IndicatorID, OBJ_LABEL,     WindowFind(ShortName),  0, 0, 0, 0  );
            ObjectSet      (  "SIGNtxt2"+IndicatorID, OBJPROP_CORNER,   1  );
            ObjectSet      (  "SIGNtxt2"+IndicatorID, OBJPROP_XDISTANCE,170);
            ObjectSet      (  "SIGNtxt2"+IndicatorID, OBJPROP_YDISTANCE,35 );
            ObjectSetText  (  "SIGNtxt2"+IndicatorID, "SIGN Line:",   FontSize+1, FontType, SIGNClr);
            
            ObjectDelete   (  "SIGNtxt3"+IndicatorID  );
            ObjectCreate   (  "SIGNtxt3"+IndicatorID, OBJ_LABEL,     WindowFind(ShortName),  0, 0, 0, 0  );
            ObjectSet      (  "SIGNtxt3"+IndicatorID, OBJPROP_CORNER,   1  );
            ObjectSet      (  "SIGNtxt3"+IndicatorID, OBJPROP_XDISTANCE,80 );
            ObjectSet      (  "SIGNtxt3"+IndicatorID, OBJPROP_YDISTANCE,35 );
            ObjectSetText  (  "SIGNtxt3"+IndicatorID, SignArea,       FontSize+1, FontType, SignAreaClr);
            
            ObjectDelete   (  "SIGNtxt4"+IndicatorID  );
            ObjectCreate   (  "SIGNtxt4"+IndicatorID, OBJ_LABEL,     WindowFind(ShortName),  0, 0, 0, 0  );
            ObjectSet      (  "SIGNtxt4"+IndicatorID, OBJPROP_CORNER,   1  );
            ObjectSet      (  "SIGNtxt4"+IndicatorID, OBJPROP_XDISTANCE,10 );
            ObjectSet      (  "SIGNtxt4"+IndicatorID, OBJPROP_YDISTANCE,35 );
            ObjectSetText  (  "SIGNtxt4"+IndicatorID, SignDirx,       FontSize+1, FontType, SignDirxClr);
            //==============
            ObjectDelete   (  "UPBBtxt1"+IndicatorID  );
            ObjectCreate   (  "UPBBtxt1"+IndicatorID, OBJ_LABEL,     WindowFind(ShortName),  0, 0, 0, 0  );
            ObjectSet      (  "UPBBtxt1"+IndicatorID, OBJPROP_CORNER,   1  );
            ObjectSet      (  "UPBBtxt1"+IndicatorID, OBJPROP_XDISTANCE,260);
            ObjectSet      (  "UPBBtxt1"+IndicatorID, OBJPROP_YDISTANCE,50 );
            ObjectSetText  (  "UPBBtxt1"+IndicatorID, "ЫЫ", FontSize,   FontType, UPBBClr);
            
            ObjectDelete   (  "UPBBtxt2"+IndicatorID  );
            ObjectCreate   (  "UPBBtxt2"+IndicatorID, OBJ_LABEL,     WindowFind(ShortName),  0, 0, 0, 0  );
            ObjectSet      (  "UPBBtxt2"+IndicatorID, OBJPROP_CORNER,   1  );
            ObjectSet      (  "UPBBtxt2"+IndicatorID, OBJPROP_XDISTANCE,170);
            ObjectSet      (  "UPBBtxt2"+IndicatorID, OBJPROP_YDISTANCE,50 );
            ObjectSetText  (  "UPBBtxt2"+IndicatorID, "UpBB Line:",   FontSize+1, FontType, UPBBClr);
            
            ObjectDelete   (  "UPBBtxt3"+IndicatorID  );
            ObjectCreate   (  "UPBBtxt3"+IndicatorID, OBJ_LABEL,     WindowFind(ShortName),  0, 0, 0, 0  );
            ObjectSet      (  "UPBBtxt3"+IndicatorID, OBJPROP_CORNER,   1  );
            ObjectSet      (  "UPBBtxt3"+IndicatorID, OBJPROP_XDISTANCE,80 );
            ObjectSet      (  "UPBBtxt3"+IndicatorID, OBJPROP_YDISTANCE,50 );
            ObjectSetText  (  "UPBBtxt3"+IndicatorID, UPBBArea,       FontSize+1, FontType, UPBBAreaClr);
            
            ObjectDelete   (  "UPBBtxt4"+IndicatorID  );
            ObjectCreate   (  "UPBBtxt4"+IndicatorID, OBJ_LABEL,     WindowFind(ShortName),  0, 0, 0, 0  );
            ObjectSet      (  "UPBBtxt4"+IndicatorID, OBJPROP_CORNER,   1  );
            ObjectSet      (  "UPBBtxt4"+IndicatorID, OBJPROP_XDISTANCE,10 );
            ObjectSet      (  "UPBBtxt4"+IndicatorID, OBJPROP_YDISTANCE,50 );
            ObjectSetText  (  "UPBBtxt4"+IndicatorID, UPBBDirx,       FontSize+1, FontType, UPBBDirxClr);
            //==============
            ObjectDelete   (  "LOBBtxt1"+IndicatorID  );
            ObjectCreate   (  "LOBBtxt1"+IndicatorID, OBJ_LABEL,     WindowFind(ShortName),  0, 0, 0, 0  );
            ObjectSet      (  "LOBBtxt1"+IndicatorID, OBJPROP_CORNER,   1  );
            ObjectSet      (  "LOBBtxt1"+IndicatorID, OBJPROP_XDISTANCE,260);
            ObjectSet      (  "LOBBtxt1"+IndicatorID, OBJPROP_YDISTANCE,65 );
            ObjectSetText  (  "LOBBtxt1"+IndicatorID, "ЫЫ", FontSize,   FontType, LOBBClr);
            
            ObjectDelete   (  "LOBBtxt2"+IndicatorID  );
            ObjectCreate   (  "LOBBtxt2"+IndicatorID, OBJ_LABEL,     WindowFind(ShortName),  0, 0, 0, 0  );
            ObjectSet      (  "LOBBtxt2"+IndicatorID, OBJPROP_CORNER,   1  );
            ObjectSet      (  "LOBBtxt2"+IndicatorID, OBJPROP_XDISTANCE,170);
            ObjectSet      (  "LOBBtxt2"+IndicatorID, OBJPROP_YDISTANCE,65 );
            ObjectSetText  (  "LOBBtxt2"+IndicatorID, "LoBB Line:",   FontSize+1, FontType, LOBBClr);
            
            ObjectDelete   (  "LOBBtxt3"+IndicatorID  );
            ObjectCreate   (  "LOBBtxt3"+IndicatorID, OBJ_LABEL,     WindowFind(ShortName),  0, 0, 0, 0  );
            ObjectSet      (  "LOBBtxt3"+IndicatorID, OBJPROP_CORNER,   1  );
            ObjectSet      (  "LOBBtxt3"+IndicatorID, OBJPROP_XDISTANCE,80 );
            ObjectSet      (  "LOBBtxt3"+IndicatorID, OBJPROP_YDISTANCE,65 );
            ObjectSetText  (  "LOBBtxt3"+IndicatorID, LOBBArea,       FontSize+1, FontType, LOBBAreaClr);
            
            ObjectDelete   (  "LOBBtxt4"+IndicatorID  );
            ObjectCreate   (  "LOBBtxt4"+IndicatorID, OBJ_LABEL,     WindowFind(ShortName),  0, 0, 0, 0  );
            ObjectSet      (  "LOBBtxt4"+IndicatorID, OBJPROP_CORNER,   1  );
            ObjectSet      (  "LOBBtxt4"+IndicatorID, OBJPROP_XDISTANCE,10 );
            ObjectSet      (  "LOBBtxt4"+IndicatorID, OBJPROP_YDISTANCE,65 );
            ObjectSetText  (  "LOBBtxt4"+IndicatorID, LOBBDirx,       FontSize+1, FontType, LOBBDirxClr);
            //==============
            }
   //----
   return(0);
}
//+-------------------------------------------

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

  • X
  • 0% загружено
« индикатор ! Alfa Romeo Z.mq4
индикатор !! [i] Darma_Bollatr.mq4 »