+1 888 340 6572 GET STARTED

PivotLowVS

Article/Author: Omega Research Inc., 1995

Download: FUNCTION-PIVOTLOWVS.ELA

File Includes: Function - PivotLowVS

Description: Works just like the "SwingLow" Function, returning the price of the Swing or Pivot bar,
except it allows you to specify a Strengh for both the Right and Left side of the Swing or Pivot Bar.
INPUTS:
Price - specifies which price of the asset of interest is to be used.
LStren - specifies the required number of bars to the Left of the Pivot bar.
RStren - specifies the required number of bars to the Right of the Pivot bar.
Length - specifies the number of trailing bars to consider.

EasyLanguage Code:
INPUTS:  PRICE(NUMERICSERIES), LSTREN(NUMERICSIMPLE), RSTREN(NUMERICSIMPLE), LENGTH(NUMERIC);

VARS: SHBAR(0), MAINLOOP(0), PREPVT(0);

PREPVT = 0;
FOR MAINLOOP = LENGTH-1 DOWNTO RSTREN BEGIN
CONDITION1 = TRUE;
CONDITION2 = TRUE;
SHBAR = PRICE[MAINLOOP];

FOR VALUE1 = MAINLOOP - RSTREN TO MAINLOOP -1 BEGIN
IF SHBAR >= PRICE[VALUE1] THEN
CONDITION1 = FALSE;
END;

IF CONDITION1 THEN BEGIN
FOR VALUE1 = MAINLOOP + 1 TO MAINLOOP + LSTREN BEGIN
IF SHBAR > PRICE[VALUE1] THEN
CONDITION2 = FALSE;
END;
END;
IF CONDITION1 AND CONDITION2 THEN
PREPVT = SHBAR;
END;

IF PREPVT <> 0 THEN
PIVOTLOWVS = PREPVT
ELSE
PIVOTLOWVS = -1;