We are happy to announce the MultiCharts Easter Sale! Learn more
+1 888 340 6572

WEEKLYAVDAILYDAT

Article/Author: Omega Research Inc., 1995

Download: FUNCTION-WEEKLYAVDAILYDAT.ELA

File Includes: Function - WEEKLYAVDAILYDAT

EasyLanguage Code:
INPUT:PRICE(NUMERIC),WHICHDAY(NUMERIC),LENGTH(NUMERIC);


ARRAY:DOWARRAY[200](0);

VALUE3 = 0;

IF DAYOFWEEK(DATE) = WHICHDAY THEN BEGIN
FOR VALUE1 = 1 TO LENGTH - 1 BEGIN
DOWARRAY[VALUE1] = DOWARRAY[VALUE1 + 1];
END;
DOWARRAY[LENGTH] = PRICE;
FOR VALUE2 = 1 TO LENGTH BEGIN
VALUE3 = VALUE3 + DOWARRAY[VALUE2];
END;
VALUE3 = VALUE3 / LENGTH;
END;

IF VALUE3 > 0 THEN WEEKLYAVDAILYDAT = VALUE3;