+1 888 340 6572

GetDate

Article/Author: Victor Cuadra for Omega Research Inc., 1995

Download: FUNCTION-GETDATE.ELA

File Includes: Function - Getdate

Description: Returns the DATE of the NTH occurence of FORMULA
Inputs: Formula (TrueFalse)
NTH (Numeric)
Example: GetDate(Close > Open, 5) will return the date of the fifth time that the Close was greater than the Open


EasyLanguage Code:
INPUTS: FORMULA(TRUEFALSE), NTH(NUMERIC);

ARRAY: FSTORE[10](0);

IF FORMULA THEN
BEGIN
FOR VALUE1 = 10 DOWNTO 2
BEGIN
FSTORE[VALUE1] = FSTORE[VALUE1-1];
END;
FSTORE[1] = DATE;
END;

GETDATE = ROUND(FSTORE[NTH],0);