거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Facebook에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
조회수:
7516
평가:
(34)
게시됨:
2013.01.28 10:29
업데이트됨:
2016.11.22 07:32
\MQL5\Include\ \MQL5\Scripts\
dayofweek.mq5 (1.09 KB) 조회
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

The "Day of Week" function is designed to determine the number of required month according to data of the week and the day of the week inside this month. For example, we need the third Friday in February, 2000 or the fourth Wednesday in November, 1998. The function allows to determine the number of search day.

The idea of creating this function came to me when I was writing the indicator and came across many dates connected with the definite days of the week in the month. For example, there are such dates as Martin Luther King, Jr. Day which is celebrated on the third Monday of January. I could not find this day using the standard functions. As the days of the week are repeating every 28 years, the idea was just to enter the data for the next 10 years and do not create this function, but I like difficulties that is why I decided to make it anyhow.

Function parameters:

  • int year - a year,
  • int month - a month,
  • int day_o_w - the day of the week required (Monday=1, Tuesday=2,..., Sunday=7),
  • int sequence - the number of the day of the week in this month (from 1 to 5, when enter the fifth day, if this day is absent in this month, then the previous, i.e. the fourth day will output).

The example of using this function in the code:

Required: the second Friday in February, 1980.

The code for obtaining this number:

int day=func_day_o_w(1980,2,5,2);

Required: the last Thursday in December, 2013

The code for obtaining this number:

int day=func_day_o_w(2013,12,4,5);

Also the "DayOfWeek.mq5" script is attached. It uses this function to find the date according to the first example (the second Friday in February, 1980)

Input parameters:


The result:


 

Check the result using Windows OS time bar:


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

MaxMinRange MaxMinRange

Two histograms to define the current market situation

ExTrend ExTrend

The channel formed by two trend lines drawn at the high and low formed by the last two fractals

Range Range

The Range indicator calculates the range expansion index and displays the range of price change in the current bar

Exp_ColorCoppock Exp_ColorCoppock

The trade system using the ColorCoppock oscillator.