거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Telegram에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
라이브러리

YZ_Summer_Time - MetaTrader 5용 라이브러리

조회수:
3677
평가:
(34)
게시됨:
2015.01.28 15:29
업데이트됨:
2016.11.22 07:32
\MQL5\Include\
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

Checking a date for belonging to winter or summer time. The function determines time (summer or winter).

Shift to winter time is made at night of the last October Sunday, and shift to summer time is made at night of the last Sunday of March.

There is not more reliable way of figuring summer and winter time.

The code was developed for news debugging.

//
// The algorithm was improved on 2014.10.09
//
// YURAZ yzh@mail.ru
// function determines summer or winter time
// shift to winter time is made at night of the last October Sunday
// and shift to summer time is made at night of the last Sunday of March
// there is not more reliable way of figuring summer and winter time
// return 0 - summer time
// return 1 - winter time
//
int YZ_summer_time(datetime pdt)
  {
   MqlDateTime dt;
   TimeToStruct(pdt,dt);
   int code=1;
   if(dt.mon>=11 || dt.mon<=2) // WINTER
     {
      code=1;
     }
   if(dt.mon>=4 && dt.mon<=9) // SUMMER
     {
      code=0;
     }
   datetime tSeek;
   MqlDateTime dtf;
   if(dt.mon==10) // October
     {
      if(dt.day<25) // night of the last October Sunday - shift to winter time
         code=0; // still summer
      else
        {
         TimeToStruct(pdt,dtf);
         tSeek=StringToTime(IntegerToString(dtf.year)+".10.31 02:00");  // set the last October day
         TimeToStruct(tSeek,dtf);
         for(int i=31; i>=25;  i--)
           {
            if(dtf.day_of_week==0 ) // Necessary  to find the night  from Saturday to Sunday
               break;  
            tSeek=tSeek-86400; // ( FIND  exactly 2 o'clock in the morning  i.e. the shift itself has no sense as Forex is closed from Saturday to Sunday  )
            TimeToStruct(tSeek,dtf);
           }
         if(pdt<tSeek)
           {
            code=0; // summer
           }
         else
            code=1; // winter
        }
     }
   if(dt.mon==3) // March
     {
      if(dt.day<25) // night of the last Sunday of March  - shift to summer time
         code=1; // still winter
      else
        {
         TimeToStruct(pdt,dtf);
         tSeek=StringToTime(IntegerToString(dtf.day_of_year)+".03.31 03:00");  // set the last day of March
         for(int i=31; i>=25;  i--)
           {
            if(dtf.day_of_week==0 ) // Necessary  to find the night  from Saturday to Sunday
               break;  
            tSeek=tSeek-86400; // ( FIND  exactly 3 o'clock in the morning  i.e. the shift itself has no sense as Forex is closed from Saturday to Sunday  )
            TimeToStruct(tSeek,dtf);
           }
         if(pdt>tSeek)
           {
            code=0; // summer
           }
         else
            code=1; // winter
        }
     }
  return( code);
  }

MetaQuotes Ltd에서 러시아어로 번역함.
원본 코드: https://www.mql5.com/ru/code/11932

Trading Signals Module Based on Delta ZigZag Indicator Trading Signals Module Based on Delta ZigZag Indicator

Trading signals module based on Delta ZigZag indicator.

Trailing Stop Module Based on Delta ZigZag Trailing Stop Module Based on Delta ZigZag

The module for tracking open positions based on Delta ZigZag for MQL5 Wizard.

Margin Calculation Margin Calculation

Library for calculation of a margin required for opening a position in MetaТrader 5.

Mutex - WinAPI Mutex - WinAPI

Synchronize ОС/EA/MT processes etc. Any self-made DLLs are not needed now.