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

Detect Friday of The First Week of The Month - To Detect NFP Day - MetaTrader 4용 expert

조회수:
12839
평가:
(3)
게시됨:
2024.07.23 10:12
업데이트됨:
2024.07.23 15:51
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동
//+------------------------------------------------------------------+
//|                                                  FirstFriday.mq4 |
//|                                  Copyright 2023, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2023, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict


datetime lastTime = 0; // Variable to store the time of the last detected candle

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   lastTime = iTime(Symbol(),PERIOD_D1,0);
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   datetime currentTime = iTime(NULL, PERIOD_D1, 0); // Get the time of the current candle
   if(IsFirstFriday() && currentTime != lastTime)
     {
      Print("This is Friday of The First Week of The Month");
      lastTime = currentTime; // Update the lastTime to the current candle time

     }

  }
//+------------------------------------------------------------------+


//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
bool IsFirstFriday()
  {
// Get the current day of the week (0=Sunday, 1=Monday, ..., 5=Friday, 6=Saturday)
   int dayOfWeek = TimeDayOfWeek(TimeCurrent());

// Get the current day of the month
   int dayOfMonth = TimeDay(TimeCurrent());

// Check if today is Friday
   if(dayOfWeek == 5)
     {
      // Check if the day of the month is between 1 and 7
      if(dayOfMonth >= 1 && dayOfMonth <= 7)
        {
         return(true);
        }
     }
   return(false);
  }
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+

DPO - MA modified DPO - MA modified

change of MA curve to horizontal line and DPO curve shall represent the distance from close price to zero level (or MA curve)

Linear Regression Value Linear Regression Value

Linear Regression Value (metatrader 4 version)

Trend Strength Index Trend Strength Index

The Trend Strength Index indicator measures strength of current trend.

Abiroid Switch Templates Script Abiroid Switch Templates Script

This is a template switcher script mq4 file. This script will work with your MT4 (Metatrader 4) platform. It is to switch between templates.