StochasticExp (Function)

image\trumpet2.gif Disclaimer

The StochasticExp series function returns the exponentially smoothed values FastD and SlowD.

Syntax

StochasticExp(PriceH, PriceL, PriceC, StochLength, SmoothingLength1, SmoothingLength2, oFastK, oSlowD)

Returns (Integer)

The oFastD and oSlowD output parameters return the fast and slow averages for the D line.  The StochasticExp function itself returns 1.

Parameters

Name

Type

Description

PriceH

Numeric

Specifies which bar value (price, function, or formula) to use for the high in stochastic calculations.

PriceL

Numeric

Specifies which bar value (price, function, or formula) to use for the low in stochastic calculations.

PriceC

Numeric

Specifies which bar value (price, function, or formula) to use for the close in stochastic calculations.

StochLength

Numeric

Sets the number of bars to consider.

SmoothingLength1

Numeric

Sets the constant for smoothing the fast K line.

SmoothingLength2

Numeric

Sets the constant for smoothing the fast D line.

oFastD

Numeric

Outputs the value for the fast D line.

oSlowD

Numeric

Outputs the value for the slow D line.

Usage

The Stochastic oscillators indicate overbought and oversold areas in the market, based upon momentum or price velocity.

Stochastics are made up of four individual calculations: FastK, FastD, SlowK, SlowD. The core of the calculations is based upon the FastK value that is calculated in the following manner.

FastK = (C - L)/(H - L)*100… where

   L = Lowest Low of a specified period

   H = Highest High of a specified period

   C = Current bar Close

FastD is a smoothed average of FastK,  SlowK is a value equal to FastD, and SlowD is a further smoothed SlowK.

See Multiple Output Function for more information on using output parameters to return values.

Example

Outputs the FastD and SlowD stochastic values to the declared variables over 14 bars using smoothing values of 3..

Vars: oFastD(0), oSlowD(0);
Value1 = StochasticExp(H, L, C, 14, 3, 3, oFastD, oSlowD);

Reference

Takano, Mike. Stochastic Oscillator, Technical Analysis of Stocks and Commodities. April 1991.

Stein, John. The Traders’ Guide to Technical Indicators, Futures Magazine. August 1990.