Mira cómo descargar robots gratis
¡Búscanos en Facebook!
Pon "Me gusta" y sigue las noticias
¿Es interesante este script?
Deje un enlace a él, ¡qué los demás también lo valoren!
¿Le ha gustado el script?
Evalúe su trabajo en el terminal MetaTrader 5
Librerías

ZZ_TimeWinter 1-1000.mq4 - librería para MetaTrader 4

Visualizaciones:
682
Ranking:
(11)
Publicado:
2016.03.10 08:57
Actualizado:
2016.03.29 08:52
MQL5 Freelance ¿Necesita un robot o indicador basado en este código? Solicítelo en la bolsa freelance Pasar a la bolsa
////////////////////////////////////////////////////////////// 
//
// YURAZ yzh mail ru
//
// la función devolverá
// true - tiempo de verano
// false - invierno
// 
// volver a la hora en la noche del último domingo de octubre
// cambiar a horario en la noche del último domingo de marzo
// 
bool TimeWinter(datetime dt) 
{
   int i;
 
   if (   TimeMonth(dt) >= 11 || TimeMonth(dt) <= 2 ) // WINTER
   {
      return(false); //    Winter
   }
   if (   TimeMonth(dt) >= 4 && TimeMonth(dt) <= 9) // SUMMER
   {
      return(true); //    Summer
   }
 
// It can't be helped, let's determine
   datetime tSeek;
   string sTIM;
   if ( TimeMonth(dt) == 10 ) // october
   {
      if ( TimeDay(dt) >= 20 ) // at night of the last sunday of october - revert to standard time
      {
         tSeek = StrToTime( StringTrimRight(StringTrimLeft(DoubleToStr(TimeYear(dt),0)))+".10.31");  // determine the last day of october
         // search for the first sunday from the end
         for ( i = 31; i >= 20; i-- )
         {
            if ( TimeDayOfWeek(tSeek) == 0 ) 
            {
               break;   // found the last sunday of october
            }
            tSeek = tSeek - 86400; // another day
         }
         if ( dt >= tSeek  ) // already standard time
         {
            return(false); // yes winter
         }
      }
      return(true);
   }
   if ( TimeMonth(dt) == 3 ) // march
   {
      if ( TimeDay(dt) >= 20 ) // at night of the last sunday of march - switch to daylight saving time
      {
         tSeek = StrToTime( StringTrimRight(StringTrimLeft(DoubleToStr(TimeYear(dt),0)))+".03.31");  // determine the last day of march
        
         for ( i = 31; i >= 20; i-- )
         {
            if ( TimeDayOfWeek(tSeek) == 0 ) // search for the first sunday from the end
            {
               break; // found the last sunday of march
            }
            tSeek = tSeek - 86400; // another day
         }
         if ( dt >= tSeek  ) // already daylight saving time
         {
            return(true); //  already summer 
         }
      }
      return(false);
   }
}

Traducción del ruso realizada por MetaQuotes Ltd
Artículo original: https://www.mql5.com/ru/code/7357

Pivote Pivote

Pivot Point es un punto de inflexión para la dirección de movimiento de precios en el mercado.

Pivot Lines TimeZone Pivot Lines TimeZone

El indicador que muestra un máximo y un mínimo de pregoing día.

SilverTrend_Signal SilverTrend_Signal

Indicador SilverTrend señal.

StepMA_v6 StepMA_v6

El indicador de sistema de trading pabloski.