+1 888 340 6572

MO

Article/Author: “Guaging Mobility With Price Distributions”, Mel Widner, Stocks&Commodities Magazine, Traders Tips, 02/1996

Download: FUNCTION-MO.ELA

File Includes:
Function - MO
Function - PDF

Category: Function > PDF

Description:

Inputs:
M
LookBack

EasyLanguage Code:
INPUTS: M(NUMERIC), LOOKBACK(NUMERIC);

VARS: HMAX(0), LMIN(0), RX(0), IMX(0), BU(0), BL(0), PDFI(0), PDFC(0), PDFMX(0),
PMO(0), MOVAR(0);

HMAX=HIGHEST(HIGH,LOOKBACK);
LMIN=LOWEST(LOW,LOOKBACK);

RX=(HMAX-LMIN)/M;
IMX=1;
FOR VALUE1=1 TO M BEGIN
BU=LMIN+VALUE1*RX;
BL=BU-RX;
PDFI=PDF(VALUE1, M, LOOKBACK);
IF VALUE1=1 THEN PDFMX=PDFI;
IF PDFI>PDFMX THEN BEGIN
IMX=VALUE1;
PDFMX=PDFI;
END;
IF VALUE1=1 THEN PDFC=PDFI;
IF C[LOOKBACK-1 ]>BL AND C[LOOKBACK-1] <= BU THEN PDFC=PDFI;
END;
PMO=LMIN+(IMX-.5)*RX;
MOVAR=100*(1-PDFC/PDFMX);
IF C[LOOKBACK-1] < PMO THEN MOVAR=-MOVAR;
MO=MOVAR;


{COPYRIGHT C 1997, TECHNICAL ANALYSIS, INC.}