iStochastic

Calculates the Stochastic Oscillator indicator value for any symbol and timeframe.

Syntax

iStochastic(
symbol: string,
timeframe: number,
index: number,
kperiod: number,
dperiod: number,
slowing: number,
applyToPrice: 0 | 1,
bufferIdx: 0 | 1
): number

Parameters

Parameter
Type
Description

symbol

string

Symbol name

timeframe

number

Timeframe in minutes

index

number

Index of the bar to calculate Stochastic for

kperiod

number

%K period (default 5)

dperiod

number

%D period (default 3)

slowing

number

Slowing period (default 3)

applyToPrice

0 | 1

0 = Low/High, 1 = Close/Close

bufferIdx

0 | 1

Buffer index: 0 = %K line (main), 1 = %D line (signal)

Return Value

Returns a number representing the Stochastic value (0-100) at the specified bar index.

Description

Calculates the Stochastic Oscillator indicator.

Example

Last updated