TRUE Forex

Просмотр кода форекс индикатора !!Y1-MT4 MATRIX HOURLY.mq4

// THIS CODE WAS WRITTEN BY XARD777 AND EXTENSIVELY REVISED BY TZUMAN (CapeCoddah)
// FEEL FREE TO RAPE AND PILLAGE ANY OR ALL OF THIS CODE AS YOU SEE FIT
// FOR THOSE OF YOU THAT IMPROVE UPON THIS HERE CODE I ASK YOU ONE THING
// PLEASE POST A COPY UP ON THE FOREX FORUMS FOR YOUR FELLOW TRADERS

#property indicator_chart_window

extern int     X.Position              = -10;
extern int     Y.Position              = -20;
extern bool    ResetEveryHour          = true;
extern string  Note6                   = "Reset specified in Local Military Time";
extern string  Note7                   = "Trading Open is Eastern Time Zone";
extern string  Note8                   = "No adjust. for for Daylight Savings Time";
extern string  ResetOnTradingOpen      = "";//"18:00";  All times quoted are NYC time 
extern string  ResetOnLondonOpen       = "";//London Begins @ 08:00, set session 1hr before @ 07:00
extern string  ResetOnNYCOpen          = "";//NYC    Begins @ 08:00, set session 1hr before @ 07:00
extern string  ResetOnAsiaOpen         = "";//Tokyo  Begins @ 09:00, set session 1hr before @ 08:00
extern string  Note10                  = "For micro account, use suffix m or .fx";
extern string  if.micro                = "";
 
extern color   Negative.Pips           = DarkOrange;
extern color   Positive.Pips           = DodgerBlue;
extern color   Neutral.Pips            = DimGray;
extern bool    show.background.panel   = true;

#define TradingOpen 0
#define LondonOpen 1
#define NYCOpen 2
#define AsiaOpen 3

int      OpenBar=9999,openbar[4];
int      WhatWindow   = 0;
int      WhatCorner   = 0;
color    PanelColor1  = C'144,144,144';
color    PanelColor2  = C'20,20,20';
datetime StartTime;            
string   buffer.name  = "MATRIX SESSION";  
           
string Symbols[];
int    Symbols.Number,Symbols.Index[][2], chartpair[2];
#define Majors.Number 8
#define NZD 0//EUR 0
#define AUD 1//GBP 1
#define JPY 2//CHF 2
#define EUR 3//USD 3
#define GBP 4//CAD 4
#define CHF 5//NZD 5
#define USD 6//AUD 6
#define CAD 7//JPY 7
double Symbols.Open[],Symbols.Sorted[][2],Sorted[Majors.Number][2],Pips[Majors.Number][Majors.Number],Tally[10];
string Majors[]  = {"NZD","AUD","JPY","EUR","GBP","CHF","USD","CAD"}; 
string space = "";            
color Colors[]={C'50,225,50',C'50,195,60', C'50,165,70',C'50,135,80',C'135,80,50',C'165,70,50',C'195,60,50',C'235,50,50'};

#import "kernel32.dll"
   void GetLocalTime(int& a0[]);
   void GetSystemTime(int& a0[]);
   int  GetTimeZoneInformation(int& a0[]);
   bool SystemTimeToTzSpecificLocalTime(int& a0[], int& a1[], int& a2[]);
#import

color opencolor = C'0,117,213', closecolor = C'150,34,34';
bool Highlight_Market_Open = TRUE;
bool Broker_MMSS_Is_Gold_Standard = TRUE;
bool Suppress_Bar_HH_Below_H1 = TRUE;
string Time.London,Time.Asia,Time.NYC;
bool Weekend_Test_Mode = FALSE;

int gia_216[43];
int gia_220[43];
int gia_224[43];
int gia_228[43];
int gia_232[43];
int gia_236[43];
int gia_240[43];
int gia_244[43];
int gia_248[43];

double g_ibuf_252[];
int gi_256 = 8;
int gi_260 = 17;
int gi_264 = 7;
int gi_268 = 16;
int g_datetime_272;

int init()
   {
   IndicatorShortName("Currency Matrix"); 
   buffer.name  = "MATRIX SESSION"; 
   if(ResetOnTradingOpen != "")  buffer.name  = buffer.name+"T";
   if(ResetOnLondonOpen != "")  buffer.name  = buffer.name+"L";
   if(ResetOnNYCOpen != "")  buffer.name  = buffer.name+"N";
   if(ResetOnAsiaOpen != "")  buffer.name  = buffer.name+"A";
   buffer.name=buffer.name+":";
       
   Symbols.Number = createPairArray();
   ArrayResize(Symbols.Open,Symbols.Number);
   double work[][2]; ArrayResize(Symbols.Sorted,Symbols.Number);
   GetAllTimeZoneInfo(gia_216, gia_220, gia_224, gia_228, gia_232, gia_236, gia_240, gia_244, gia_248);
   Show_Panel();
   return(0);
   }
      
int deinit()
   {
   deleteObjects();
   return(0);
   }
int Reset_OpeningData()
{
   static datetime LastTime;
    
   if(Time[0] == LastTime)       return(0);     // time already set for this hour 
   
   for(int row=1;row<10;row++) for(int col=0;col<10;col++)
      {
      ObjectDelete(buffer.name+ "BR"+row+"C"+col);
      ObjectDelete(buffer.name+ "FR"+row+"C"+col);
      }
      
   if(ResetEveryHour && Time[0] != LastTime)
      {
      LastTime=Time[0];
      for(int index=0;index<Symbols.Number;index++)             Symbols.Open[index]=iOpen(Symbols[index], PERIOD_H1, 0);
      return(1);
      }
   
   if(ResetOnTradingOpen != "")
      {
      openbar[TradingOpen]=StrToInteger(StringSubstr(Time.NYC,0,2))-StrToInteger(StringSubstr(ResetOnTradingOpen,0,2));
      if(openbar[TradingOpen]<0) openbar[TradingOpen]=24+openbar[TradingOpen];
      }
      else openbar[TradingOpen]=999;
   
   if(ResetOnLondonOpen != "")
      {
      openbar[LondonOpen]=StrToInteger(StringSubstr(Time.London,0,2))-StrToInteger(StringSubstr(ResetOnLondonOpen,0,2));
      if(openbar[LondonOpen]<0) openbar[LondonOpen]=24+openbar[LondonOpen];
      }
      else openbar[LondonOpen]=999;
   
   if(ResetOnNYCOpen != "")
      {
      openbar[NYCOpen]=StrToInteger(StringSubstr(Time.NYC,0,2))-StrToInteger(StringSubstr(ResetOnNYCOpen,0,2));
      if(openbar[NYCOpen]<0) openbar[NYCOpen]=24+openbar[NYCOpen];
      }
      else openbar[NYCOpen]=999;
      
   if(ResetOnAsiaOpen != "")
      {
      openbar[AsiaOpen]=StrToInteger(StringSubstr(Time.Asia,0,2))-StrToInteger(StringSubstr(ResetOnAsiaOpen,0,2));
      if(openbar[AsiaOpen]<0) openbar[AsiaOpen]=24+openbar[AsiaOpen];   
      }
      else  openbar[AsiaOpen]=999;
      
   for(int i=0;i<4;i++)  if(openbar[i]<OpenBar) OpenBar=openbar[i];   
   
   for(index=0;index<Symbols.Number;index++)  Symbols.Open[index]=iOpen(Symbols[index], PERIOD_H1, OpenBar);
   LastTime=Time[0];   
   return(1);   
}
int start()
{
   int    index,counted_bars=IndicatorCounted(); 
    
   Clock();
   Reset_OpeningData();
   
   for(index=0;index<Symbols.Number;index++)
      {
      double DecNos=10000.;             
      if(Symbols.Index[index,0] == JPY || Symbols.Index[index,1] == JPY) DecNos=100.;
      double value = ((iClose(Symbols[index], PERIOD_H1,0) - Symbols.Open[index])* DecNos);
               
      Pips[Symbols.Index[index,0],Symbols.Index[index,1]]=-value;  //note that the value is reversed as we are printing by rows NOT columns.
      Pips[Symbols.Index[index,1],Symbols.Index[index,0]]=value;
      Symbols.Sorted[index,0]=value;
      Symbols.Sorted[index,1]=index;
      }
      
    Tally[NZD] =    Pips[EUR,NZD]+Pips[GBP,NZD]+Pips[NZD,CHF]-Pips[NZD,USD]+Pips[NZD,CAD]+Pips[AUD,NZD]-Pips[NZD,JPY]; 
    Tally[AUD] =    Pips[EUR,AUD]+Pips[GBP,AUD]-Pips[AUD,CHF]-Pips[AUD,USD]-Pips[AUD,CAD]-Pips[AUD,NZD]-Pips[AUD,JPY];
    Tally[JPY] =    Pips[EUR,JPY]+Pips[GBP,JPY]+Pips[CHF,JPY]+Pips[USD,JPY]+Pips[CAD,JPY]+Pips[AUD,JPY]+Pips[NZD,JPY];   
    Tally[EUR] = -( Pips[EUR,GBP]+Pips[EUR,CHF]+Pips[EUR,USD]+Pips[EUR,CAD]+Pips[EUR,NZD]+Pips[EUR,AUD]+Pips[EUR,JPY]);
    Tally[GBP] =    Pips[EUR,GBP]-Pips[GBP,CHF]-Pips[GBP,USD]-Pips[GBP,CAD]-Pips[GBP,NZD]-Pips[GBP,AUD]-Pips[GBP,JPY];
    Tally[CHF] =    Pips[EUR,CHF]+Pips[GBP,CHF]+Pips[USD,CHF]+Pips[CAD,CHF]+Pips[NZD,CHF]+Pips[AUD,CHF]-Pips[CHF,JPY];
    Tally[USD] =    Pips[EUR,USD]+Pips[GBP,USD]-Pips[USD,CHF]-Pips[USD,CAD]+Pips[NZD,USD]+Pips[AUD,USD]-Pips[USD,JPY];
    Tally[CAD] =    Pips[EUR,CAD]+Pips[GBP,CAD]-Pips[CAD,CHF]+Pips[USD,CAD]+Pips[NZD,CAD]+Pips[AUD,CAD]-Pips[CAD,JPY];
     
    for(int currency=0;currency<Majors.Number;currency++)
      {
      Sorted[currency,0]=Tally[currency];
      Sorted[currency,1]=currency;
      }
  
   ArraySort(Sorted,WHOLE_ARRAY,0,MODE_DESCEND);
  
   for(currency=0;currency<Majors.Number;currency++)
      {
      Print_Rows(currency);
      Print_Totals(currency);
      //Print_SortedOrder(currency);
      }
      
   Print_HighLows();
// ------------------------------------------------------------------------------------------ //
   }
void  Print_Rows(int row)
{
   int index,  xpos=17, ypos=68+17*row;
   index=Sorted[row,1];
   string sBbuffer=buffer.name+ "BR"+(row+1)+"C",  sFbuffer=buffer.name+ "FR"+(row+1)+"C";
   double value;
   
   xpos=17;
   CreateBX1_Labels(sBbuffer+"0",xpos,  ypos,"ggg", 11, "Webdings",Colors[row]) ;
   CreateBX1_Labels(sFbuffer+"0",xpos+5,ypos+1,Majors[index], 11, "Arial Black",White);
   xpos+=44;
   
   for(int col=0;col<Majors.Number;col++)
      {
      value=Pips[index,col];
      if(value==0)
         {
         ObjectDelete(sBbuffer+(col+1));
         ObjectDelete(sFbuffer+(col+1));
         }  
      else
         {
         if (value <= -12)       color Color = Negative.Pips; 
         else if (value >= 12)         Color = Positive.Pips;  
         else                          Color = Neutral.Pips;
   
         CreateBX1_Labels(sBbuffer+(col+1),xpos,ypos,"ggg", 11, "Webdings", Color);
         CreateBX1_Labels(sFbuffer+(col+1),xpos+1,ypos+2, Set_Text(DoubleToStr(value,0)), 10, "Arial Black", White);
         }
      xpos+=44;   
      }
      
   CreateBX1_Labels(sBbuffer+"9",xpos,  ypos,"ggg", 11, "Webdings",Colors[row]) ;
   CreateBX1_Labels(sFbuffer+"9",xpos+2,ypos+2,Set_Text(DoubleToStr(Tally[index],0)), 10, "Arial Black", White);
          
}
string Set_Text(string text)
   {
   switch(StringLen(text))
      {
      case 1:  text="      "+text;    break; 
      case 2:  text="     " +text;    break;
      case 3:  text="   "   +text;    break;
      case 4:  text="  "    +text;    break;
      }
   return(text);
   }      
void Print_Totals(int col)
   {
   int offset=61+col*44;
   for(int index=0;index<Majors.Number;index++)    if(col==Sorted[index,1])  break;
   col+=1;
   CreateBX1_Labels(buffer.name+ "BR9C"+col,   offset,204,"ggg", 11, "Webdings", Colors[index]);
   CreateBX1_Labels(buffer.name+ "FR9C"+col,   offset+1,206, Set_Text(DoubleToStr(Tally[col-1],0)), 10, "Arial Black",White);   
   CreateBX1_Labels(buffer.name+ "BR0C"+col,   offset,51,  "ggg", 11, "Webdings", Colors[index]);
   CreateBX1_Labels(buffer.name+ "FR0C"+col,   offset+5,52, Majors[col-1], 11, "Arial Black",White);
   }
void  Print_HighLows()
   {
   ArraySort(Symbols.Sorted,WHOLE_ARRAY,0,MODE_DESCEND);
   
   int xpos=461,index,ypos=68,nbr=0,row;
   for(int roww=0;roww<8;roww++)
      {
      row=roww;
      if(row>3) row=Symbols.Number-8+roww;
      CreateBX1_Labels(buffer.name+" Panel19"+roww,xpos,  ypos,"ggggg", 11, "Webdings",Colors[roww]) ;//HighLowB
      index=Symbols.Sorted[row,1];
      
      ObjectDelete(buffer.name+" Panel20" + roww);
      if(Symbols.Sorted[row,0] >= 12 || Symbols.Sorted[row,0] <= -12)
              CreateBX1_Labels(buffer.name+" Panel20"+roww,xpos+4,ypos+2,Symbols[index], 10, "Arial Black", White);
      //CreateBX1_Labels(buffer.name+"HighLowN"+roww,xpos+68,ypos+2,DoubleToStr(Symbols.Sorted[row,0],0), 10, "Arial Black", Color);
      nbr+=4;
      ypos+=17;
      }
   }           
int createPairArray() {
   string symbol;
   int index = 0;
   for (int base = 0; base < Majors.Number - 1; base++) 
      {
      for (int counter = base + 1; counter < Majors.Number; counter++) {
         symbol = Majors[base] + Majors[counter] + if.micro;
         if (MarketInfo(symbol, MODE_BID) > 0.0) 
            {
            //Print("BaseCounter ",symbol," ",base," ",counter);
            ArrayResize(Symbols, index + 1);
            Symbols[index] = symbol;
            ArrayResize(Symbols.Index, index + 1);
            Symbols.Index[index,0]=base;
            Symbols.Index[index,1]=counter;
            index++;
            }
           
                  
         symbol = Majors[counter] + Majors[base] + if.micro;
         if (MarketInfo(symbol, MODE_BID) > 0.0) 
            {
            //Print("CounterBase ",symbol," ",base," ",counter);
            ArrayResize(Symbols, index + 1);
            Symbols[index] = symbol;
            ArrayResize(Symbols.Index, index + 1);
            Symbols.Index[index,0]=counter;
            Symbols.Index[index,1]=base;
            index++;
            }
         }
   }
   GetLastError();         //to clear legitimate 4106 errors
   return(ArraySize(Symbols));
   }   

// ====.====================================================================================== //
int CreateBX1_Labels( string K, int x, int y, string Text, int FontSize, string Font, color Color ) 
   {
   ObjectCreate( K, OBJ_LABEL, WhatWindow, 0, 0 );
   ObjectSet( K, OBJPROP_CORNER, WhatCorner);
   ObjectSet( K, OBJPROP_XDISTANCE,x+X.Position);
   ObjectSet( K, OBJPROP_YDISTANCE,y+Y.Position);
   ObjectSet( K, OBJPROP_BACK, false );
   ObjectSetText(K, Text, FontSize, Font, Color);
   }   
        
 void deleteObjects(){
   for(int i=0;   i<10;i++)  ObjectDelete(buffer.name+" Panel0" + i);
   for(    i=0;   i<34;i++)  ObjectDelete(buffer.name+" Panel" + i);
   for(    i=0;   i<8;i++)   ObjectDelete(buffer.name+"HighLowB" + i);
   for(    i=0;   i<8;i++)   ObjectDelete(buffer.name+" Panel19" + i);
   for(    i=0;   i<8;i++)   ObjectDelete(buffer.name+" Panel20" + i);
   for(int row=0;row<10;row++) for(int col=0;col<10;col++)
      {
      ObjectDelete(buffer.name+ "BR"+row+"C"+col);
      ObjectDelete(buffer.name+ "FR"+row+"C"+col);
      }
   GetLastError();
   }
   
void Show_Panel()
   {     
      CreateBX1_Labels(buffer.name+" Panel30",200, 36, " LONDON                  NY ", 11, "Arial Bold", White);
      CreateBX1_Labels(buffer.name+" Panel31",70,36, " TOKYO ", 11, "Arial Bold", White);
      
   if(!show.background.panel)  return;    
      CreateBX1_Labels(buffer.name+" Panel01",57,31,  "gg", 90, "Webdings", PanelColor1);
      CreateBX1_Labels(buffer.name+" Panel02",175,31, "gg", 90, "Webdings", PanelColor1);
      CreateBX1_Labels(buffer.name+" Panel03",13,67,  "gg", 90, "Webdings", PanelColor1);
      CreateBX1_Labels(buffer.name+" Panel04",13,90,  "gg", 90, "Webdings", PanelColor1);
      CreateBX1_Labels(buffer.name+" Panel05",295,67, "gg", 90, "Webdings", PanelColor1);
      CreateBX1_Labels(buffer.name+" Panel06",295,90, "gg", 90, "Webdings", PanelColor1);
      CreateBX1_Labels(buffer.name+" Panel07",57,107, "gg", 90, "Webdings", PanelColor1);
      CreateBX1_Labels(buffer.name+" Panel08",175,107,"gg", 90, "Webdings", PanelColor1);
      CreateBX1_Labels(buffer.name+" Panel09",59,33,  "gg", 90, "Webdings", PanelColor2);
      CreateBX1_Labels(buffer.name+" Panel10",173,33, "gg", 90, "Webdings", PanelColor2); 
      CreateBX1_Labels(buffer.name+" Panel11",59,105, "gg", 90, "Webdings", PanelColor2);
      CreateBX1_Labels(buffer.name+" Panel12",173,105,"gg", 90, "Webdings", PanelColor2);
      CreateBX1_Labels(buffer.name+" Panel13",15,69,  "gg", 90, "Webdings", PanelColor2);
      CreateBX1_Labels(buffer.name+" Panel14",15,88,  "gg", 90, "Webdings", PanelColor2);
      CreateBX1_Labels(buffer.name+" Panel15",217,69, "gg", 90, "Webdings", PanelColor2);
      CreateBX1_Labels(buffer.name+" Panel16",217,88, "gg", 90, "Webdings", PanelColor2);
      CreateBX1_Labels(buffer.name+" Panel17",459,69,  "g", 56, "Webdings", PanelColor2); 
      CreateBX1_Labels(buffer.name+" Panel18",459,134, "g", 56, "Webdings", PanelColor2);    
   }
   
/////////////////////clock subroutines
int Clock()
   {
   int lia_0[4];
   int lia_4[4];
   int lia_8[4];
   int lia_12[4];
   int lia_16[4];
   int li_40;
   int li_48;
  
   int NYTime,LondonTime,TokyoTime;
  
   string l_text_88;
   
   int li_176;
   string l_time2str_180;
   if (!IsDllsAllowed()) {
      if (TimeCurrent() - g_datetime_272 >= 7) {
         g_datetime_272 = TimeCurrent();
         Alert(WindowExpertName(), ": ERROR. DLLs are disabled. To enable, select \'Allow DLL Imports\' in the Common Tab of indicator");
      }
   } else {
      if (!Weekend_Test_Mode && TimeCurrent() - g_datetime_272 == 0) return;
      g_datetime_272 = TimeCurrent();
      GetLocalTime(lia_0);
      li_40 = TimeArrayToTime(lia_0);
      int CurrentTime = TimeCurrent();
      li_48 = 0;
      if (Broker_MMSS_Is_Gold_Standard && !Weekend_Test_Mode) {
         li_48 = 60 * TimeMinute(CurrentTime) + TimeSeconds(CurrentTime) - 60 * TimeMinute(li_40) - TimeSeconds(li_40);
         if (li_48 > 1800) li_48 -= 3600;
         else
            if (li_48 < -1800) li_48 += 3600;
      }
      GetSystemTime(lia_4);
      
      SystemTimeToTzSpecificLocalTime(gia_220, lia_4, lia_8);
      NYTime = TimeArrayToTime(lia_8) + li_48;
      SystemTimeToTzSpecificLocalTime(gia_224, lia_4, lia_12);
      LondonTime = TimeArrayToTime(lia_12) + li_48;
      SystemTimeToTzSpecificLocalTime(gia_228, lia_4, lia_16);
      TokyoTime = TimeArrayToTime(lia_16) + li_48;       
      
      Time.London = TimeToString(LondonTime,true);
      Time.Asia = TimeToString(TokyoTime,true);
      Time.NYC = TimeToString(NYTime,true);
            
      li_176 = 60 * Period() + Time[0] - TimeCurrent();
      if (li_176 >= 0) {
      l_time2str_180 = TimeToStr(60 * Period() + Time[0] - TimeCurrent(), TIME_MINUTES);
         if (Suppress_Bar_HH_Below_H1 && Period() <= PERIOD_H1 && StringLen(l_time2str_180) > 6) l_time2str_180 = StringSubstr(l_time2str_180, 3);
      } 
          
      color ctimes[3];
      for(int i=0;i<3;i++) ctimes[i]=closecolor;
      
       if (TimeDayOfWeek(TokyoTime) != 0 && TimeDayOfWeek(TokyoTime) != 8 && Highlight_Market_Open && TimeHour(TokyoTime) >= gi_256 && TimeHour(TokyoTime) < gi_260) 
       ctimes[2]=opencolor;
      
         if (TimeDayOfWeek(LondonTime) != 0 && TimeDayOfWeek(LondonTime) != 8 && Highlight_Market_Open && TimeHour(LondonTime) >= gi_256 && TimeHour(LondonTime) < gi_260) 
         ctimes[0]=opencolor;
      
         if (TimeDayOfWeek(NYTime) != 0 && TimeDayOfWeek(NYTime) != 8 && Highlight_Market_Open && TimeHour(NYTime) >= gi_256 && TimeHour(NYTime) < gi_260) 
         ctimes[1]=opencolor;
      
   }
   
      CreateBX1_Labels(buffer.name+" Panel21", 61,34,"ggggg",12, "Webdings", ctimes[2]);
      CreateBX1_Labels(buffer.name+" Panel22",127,34,"gggg", 12, "Webdings", ctimes[2]);
      CreateBX1_Labels(buffer.name+" Panel23",193,34,"ggggg",  12, "Webdings", ctimes[0]);
      CreateBX1_Labels(buffer.name+" Panel24",259,34,"gggg",  12, "Webdings", ctimes[0]);
      CreateBX1_Labels(buffer.name+" Panel25",325,34,"gggg",12, "Webdings", ctimes[1]);
      CreateBX1_Labels(buffer.name+" Panel26",363,34,"ggg", 12, "Webdings", ctimes[1]);
      CreateBX1_Labels(buffer.name+" Panel27",270,35,Time.London, 10, "Arial Black", White);
      CreateBX1_Labels(buffer.name+" Panel28",360,35,Time.NYC,    10, "Arial Black", White);
      CreateBX1_Labels(buffer.name+" Panel29",136,35,Time.Asia,   10, "Arial Black", White);
   return (0);
   }

string TimeToString(int theTime,bool MilitaryTime) {
   string Return;
   int hour = TimeHour(theTime);
   
   if (!MilitaryTime && (hour > 12 || hour == 0)) Return = TimeToStr(theTime - 43200, TIME_MINUTES);
   else                        Return = TimeToStr(theTime, TIME_MINUTES);
   
   if(!MilitaryTime)
      {
      if (hour >= 12)             Return = StringConcatenate(Return, " PM");
      else                        Return = StringConcatenate(Return, " AM");
      }
      
   return (Return);
   }

string FormatDateTime(int theTime, int ai_4, int ai_8, int ai_12, int ai_16, int ai_20) {
   string ls_24 = ai_4 + 100;
   ls_24 = StringSubstr(ls_24, 1);
   string ls_32 = ai_8 + 100;
   ls_32 = StringSubstr(ls_32, 1);
   string ls_40 = ai_12 + 100;
   ls_40 = StringSubstr(ls_40, 1);
   string ls_48 = ai_16 + 100;
   ls_48 = StringSubstr(ls_48, 1);
   string ls_56 = ai_20 + 100;
   ls_56 = StringSubstr(ls_56, 1);
   return (StringConcatenate(theTime, ".", ls_24, ".", ls_32, " ", ls_40, ":", ls_48, ":", ls_56));
   }

int TimeArrayToTime(int aia_0[4]) {
   int l_str2time_44;
   int li_4 = aia_0[0] & 65535;
   int li_8 = aia_0[0] >> 16;
   int li_16 = aia_0[1] >> 16;
   int li_20 = aia_0[2] & 65535;
   int li_24 = aia_0[2] >> 16;
   int li_28 = aia_0[3] & 65535;
   int li_32 = aia_0[3] >> 16;
   string ls_36 = FormatDateTime(li_4, li_8, li_16, li_20, li_24, li_28);
   l_str2time_44 = StrToTime(ls_36);
   return (l_str2time_44);
   }

void GetAllTimeZoneInfo(int aia_0[43], int &aia_4[43], int &aia_8[43], int &aia_12[43], int &aia_16[43], int &aia_20[43], int &aia_24[43], int &aia_28[43], int &aia_32[43]) {
   int li_36 = GetTimeZoneInformation(aia_0);
   aia_4[0] = 300;
   aia_4[17] = 720896;
   aia_4[18] = 65536;
   aia_4[19] = 2;
   aia_4[20] = 0;
   aia_4[21] = 0;
   aia_4[38] = 196608;
   aia_4[39] = 131072;
   aia_4[40] = 2;
   aia_4[41] = 0;
   aia_4[42] = -60;
   aia_8[0] = 0;
   aia_8[17] = 655360;
   aia_8[18] = 327680;
   aia_8[19] = 2;
   aia_8[20] = 0;
   aia_8[21] = 0;
   aia_8[38] = 196608;
   aia_8[39] = 327680;
   aia_8[40] = 1;
   aia_8[41] = 0;
   aia_8[42] = -60;
   aia_12[0] = -540;
   aia_12[17] = 0;
   aia_12[18] = 0;
   aia_12[19] = 0;
   aia_12[20] = 0;
   aia_12[21] = 0;
   aia_12[38] = 0;
   aia_12[39] = 0;
   aia_12[40] = 0;
   aia_12[41] = 0;
   aia_12[42] = 0;
   aia_16[0] = -600;
   aia_16[17] = 262144;
   aia_16[18] = 65536;
   aia_16[19] = 3;
   aia_16[20] = 0;
   aia_16[21] = 0;
   aia_16[38] = 655360;
   aia_16[39] = 65536;
   aia_16[40] = 2;
   aia_16[41] = 0;
   aia_16[42] = -60;
   aia_20[0] = -720;
   aia_20[17] = 262144;
   aia_20[18] = 65536;
   aia_20[19] = 3;
   aia_20[20] = 0;
   aia_20[21] = 0;
   aia_20[38] = 589824;
   aia_20[39] = 327680;
   aia_20[40] = 2;
   aia_20[41] = 0;
   aia_20[42] = -60;
   ArrayCopy(aia_24, aia_8);
   aia_24[0] = -180;
   ArrayCopy(aia_28, aia_8);
   aia_28[0] = -60;
   ArrayCopy(aia_32, aia_4);
   aia_32[0] = 480;
   }        
// ==================================
// LET THERE BE ORDER... XARD777 2011
// AND THERE WILL BE ORDER.....TZUMAN
//--------------------------------------------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@$$$$"         
                                                        ^$$$*  
*/

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

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