iFractals

Calculates the Fractals indicator value for any symbol and timeframe.

Syntax

iFractals(
symbol: string,
timeframe: number,
index: number,
period: number,
bufferIdx: 0 | 1
): number

Parameters

Parameter
Type
Description

symbol

string

Symbol name

timeframe

number

Timeframe in minutes

index

number

Index of the bar to check for fractal

period

number

Number of bars on each side to check (typically 2)

bufferIdx

0 | 1

Buffer index: 0 = Up fractal, 1 = Down fractal

Return Value

Returns a number:

  • For up fractal (bufferIdx = 0): Returns the high price if an up fractal exists, 0 otherwise

  • For down fractal (bufferIdx = 1): Returns the low price if a down fractal exists, 0 otherwise

Description

Calculates the Fractals indicator.

Example

Last updated