+1 888 340 6572

HighestPriceNBarz

Article/Author: Emmanuel Lavelanet for Omega Research Inc., 1995

Download: FUNCTION-HIGHESTPRICENBARZ.ELA

File Includes: Function - HighestPriceNBarz

Description:This Function will return the Highest specified Price over a specified Length.
The Function requires a MaxBarsBack setting no greater than 0 (zero). The Length limit for this Function is 500.

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

VARS: HIGHDAY(0);
ARRAY: HMONTHS[500](0);

IF LENGTH <= 500 THEN BEGIN
FOR VALUE1 = LENGTH DOWNTO 2 BEGIN
HMONTHS[VALUE1] = HMONTHS[VALUE1 - 1];
END;

HMONTHS[1] = PRICE;
HIGHDAY = PRICE;

FOR VALUE2 = 1 TO LENGTH BEGIN
IF HIGHDAY < HMONTHS[VALUE2] THEN
HIGHDAY = HMONTHS[VALUE2];
END;
HIGHESTPRICENBARZ = HIGHDAY;
END
ELSE
HIGHESTPRICENBARZ = PRICE;