Stochastic oscillator - FXB.ta.Stochastic

The FXB.ta.Stochastic class calculates the Stochastic oscillator. It is unusual because it can be either bar-based or value-based depending on the mode. Parameters are as follows:

Parameter

Description

mode

Type of calculation: either "hl" (high-low) or "value", defaulting to "hl". In high-low mode, the calculation is bar-based and requires candle data. In "value" mode, the calculation is value-based and can be calculated on any array of values.

kPeriod

Period for the %K values

dPeriod

Period for the %D values

slowing

Slowing/smoothing which is applied to the %K values

maType

Type of moving average for the smoothing. Defaults to a simple moving average (sma / 0).

The primary output - GetValue() etc - is the %K values. The signal output - GetSignalValue() etc - contains the %D values.