Black Friday great discounts start today Learn more
+1 888 340 6572

NVDI

Article/Author: “Enhancing On-Balance Volume and Negative Volume” Philip C. Holt, Stocks&Commodities Magazine, Traders Tips, 06/1996

Download: FUNCTION-NVDI.ELA

File Includes: Function - NVDI

Category: Function > NVDI

Description:

Inputs:
LENGTH

EasyLanguage Code:
INPUTS: LENGTH(NUMERIC);


VARS: BOLLTOP(0), BOLLBOT(0), PERB(0), NEGVBOLLTOP(0), NEGVBOLLBOT(0), NEGVPERB(0), NEGV(0);

IF CURRENTBAR = 1 THEN NEGV = 100;
BOLLTOP = BOLLINGERBAND(CLOSE, LENGTH, 2);
BOLLBOT = BOLLINGERBAND(CLOSE, LENGTH, -2);
IF (BOLLTOP - BOLLBOT) <> 0 THEN
PERB = (CLOSE - BOLLBOT) / (BOLLTOP - BOLLBOT);
NEGV = IFF(VOLUME < VOLUME[1], NEGV + ((CLOSE - CLOSE[1]) / CLOSE[1]) * 100, NEGV);

NEGVBOLLTOP = BOLLINGERBAND(NEGV, LENGTH, 2);
NEGVBOLLBOT = BOLLINGERBAND(NEGV, LENGTH, -2);
IF (NEGVBOLLTOP - NEGVBOLLBOT) <> 0 THEN
NEGVPERB = (NEGV - NEGVBOLLBOT) / (NEGVBOLLTOP - NEGVBOLLBOT);

NVDI = (1 + PERB) / (1 + NEGVPERB);