+1 888 340 6572 GET STARTED

DayOfWkMn

Article/Author: Omega Research Inc., 1996

Download: FUNCTION-DAYOFWKMN.ELA

File Includes: Function - DayOfWkMn

Description: This is a True/False Function which identifies a user specified day within a user specified week
of each month. On the user specified day, in the user specified week, the Function will return True. Otherwise
the Function will return False. Please note, this Function can only be used in TradeStation and SuperCharts
versions 4 and above. The Function below can be used for either.
Inputs:
DoW - the user specified day of the week ex. Mon = 1, Tues = 2, etc.
WeekNo - the user specified week number within the month.

EasyLanguage Code:
INPUTS: DOW(NUMERIC), WEEKNO(NUMERIC);


IF MONTH(DATE) <> MONTH(DATE[1]) THEN
VALUE1 = 1;

IF DAYOFWEEK(DATE) = DOW AND VALUE1 >= 1 THEN BEGIN
IF VALUE1 = WEEKNO THEN BEGIN
DAYOFWKMN = TRUE;
VALUE1 = 0;
END
ELSE BEGIN
VALUE1 = VALUE1 + 1;
DAYOFWKMN = FALSE;
END;
END ELSE
DAYOFWKMN = FALSE;