+1 888 340 6572

LowestPriceNBarz

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

Download: FUNCTION-LOWESTPRICENBARZ.ELA

File Includes: Function - LowestPriceNBarz

Description:This Function will return the Lowest 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: LOWDAY(0);
ARRAY: LMONTHS[500](99999);

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

LMONTHS[1] = PRICE;
LOWDAY = PRICE;

FOR VALUE2 = 1 TO LENGTH BEGIN
IF LOWDAY > LMONTHS[VALUE2] THEN
LOWDAY = LMONTHS[VALUE2];
END;
LOWESTPRICENBARZ = LOWDAY;
END
ELSE
LOWESTPRICENBARZ = LOW;