+1 888 340 6572

RainbowOsc

Article/Author: Stocks&Commodities Magazine, Traders Tips, 07/1997

Download: FUNCTION-RAINBOWOSC.ELA

File Includes: Function - RainbowOsc

Category: Function > RainbowOsc

Description:

Inputs:
Price - цена по которой строится Moving Average
Length - период, за который строится Moving Average
Level -

EasyLanguage Code:
INPUTS: PRICE(NUMERIC), LENGTH(NUMERIC), LEVEL(NUMERIC);

VARS: AVGAVGS(0), HIPRICE(0), LOPRICE(0), AVGVAL(0);
ARRAY: AVG[10](0);

AVGAVGS = 0;
AVG[1] = AVERAGE(PRICE, LENGTH);
AVG[2] = AVERAGE(AVG[1], LENGTH);
AVG[3] = AVERAGE(AVG[2], LENGTH);
AVG[4] = AVERAGE(AVG[3], LENGTH);
AVG[5] = AVERAGE(AVG[4], LENGTH);
AVG[6] = AVERAGE(AVG[5], LENGTH);
AVG[7] = AVERAGE(AVG[6], LENGTH);
AVG[8] = AVERAGE(AVG[7], LENGTH);
AVG[9] = AVERAGE(AVG[8], LENGTH);
AVG[10] = AVERAGE(AVG[9], LENGTH);

HIPRICE = HIGHEST(PRICE, LEVEL);
LOPRICE = LOWEST(PRICE, LEVEL);
FOR VALUE1 = 1 TO LEVEL BEGIN
AVGAVGS = AVGAVGS + AVG[VALUE1];
END;
AVGVAL = AVGAVGS / LEVEL;

IF HIPRICE - LOPRICE <> 0 THEN
RAINBOWOSC = 100 * ((CLOSE - AVGVAL) / (HIPRICE - LOPRICE));