無料でロボットをダウンロードする方法を見る
Twitter上で私たちを見つけてください。
私たちのファンページに参加してください
興味深いスクリプト?
それではリンクにそれを投稿してください。-
他の人にそれを評価してもらいます
記事を気に入りましたか?MetaTrader 5ターミナルの中でそれを試してみてください。
ライブラリ

clock - MetaTrader 4のためのライブラリ

削除済み
ビュー:
6817
評価:
(27)
パブリッシュ済み:
2021.04.08 05:15
アップデート済み:
2021.04.09 21:08
\MQL4\Experts\ \MQL4\Include\
clock.mqh (6.44 KB) ビュー
このコードに基づいたロボットまたはインジケーターが必要なら、フリーランスでご注文ください フリーランスに移動

CClock - Extension for the datetime


Installation

  • Put clock.mqh into your Include folder
  • Use one of the samples that shows the usage

    Inputs

    • GMTOffset, int(-23~23) Server GMTOffset value
    • DSTMethod, either DAYLIGHTSAVING_METHOD_US, DAYLIGHTSAVING_METHOD_UK or DAYLIGHTSAVING_METHOD_NONE


    Methods


       void              CClock(void); 
       void              CClock(int offset, int method);
       void              Set(const datetime value);
       datetime          DateTime(int offset, int method);
       datetime          ServerTime(void) {return(srvdt);}
       datetime          GreenwichMeanTime(void) {return(gmtdt);}
       bool              IsDaylightSavingTime(void);
       bool              IsDaylightSavingTime(int method);
       bool              IsDaylightSavingTime(datetime value, int method);


    Usage


    #property copyright "Copyright 2021, MetaQuotes Software Corp."
    #property link      "https://www.mql5.com"
    #property version   "1.00"
    #property strict
    
    // from clock.mqh
    #define DAYLIGHTSAVING_METHOD_NONE 0
    #define DAYLIGHTSAVING_METHOD_US 1
    #define DAYLIGHTSAVING_METHOD_UK 2
    
    #include <clock.mqh>
    
    //+------------------------------------------------------------------+
    //| Global variables                                                 |
    //+------------------------------------------------------------------+
    CClock Clock;
    //+------------------------------------------------------------------+
    //| Expert initialization function                                   |
    //+------------------------------------------------------------------+
    int OnInit()
      {
    //---
       Clock.GMTOffset = 2;
       Clock.DSTMethod = DAYLIGHTSAVING_METHOD_US;
    //---
       return(INIT_SUCCEEDED);
      }
    //+------------------------------------------------------------------+
    //| Expert deinitialization function                                 |
    //+------------------------------------------------------------------+
    void OnDeinit(const int reason)
      {
    //---
      }
    //+------------------------------------------------------------------+
    //| Expert tick function                                             |
    //+------------------------------------------------------------------+
    void OnTick()
      {
    //---
       Clock.Set(TimeCurrent()); // set clock
       
       Clock.IsDaylightSavingTime(); // return true if the clock time is with in DaylightSavingTime
       Clock.ServerTime(); // return server time with datetime
       Clock.GreenwichMeanTime(); // return GMT time with datetime
       Clock.DateTime(2,DAYLIGHTSAVING_METHOD_US); // return the timezone time with datetime. 
    
      }
    //+------------------------------------------------------------------+
    



















    forex revelation forex revelation

    Short description.

    Daily Target, Max Daily Losses with MagicNumber Daily Target, Max Daily Losses with MagicNumber

    With the aim of educating you how to make trading tools that are simple and can be used immediately.

    Reverse MACD Reverse MACD

    Give the return zone of the MACD Zero Lag

    RSI levels rendered on price as bands RSI levels rendered on price as bands

    RSI levels rendered on price as bands