PINE LIBRARY
TRZigZagLib

Library "TRZigZagLib"
method directionName(this)
Gets pivot direction as string
Namespace types: Pivot
Parameters:
this (Pivot): Pivot instance
Returns: "HIGH" or "LOW"
method isHigh(this)
Checks if pivot is a high
Namespace types: Pivot
Parameters:
this (Pivot): Pivot instance
Returns: true if pivot is a high
method isLow(this)
Checks if pivot is a low
Namespace types: Pivot
Parameters:
this (Pivot): Pivot instance
Returns: true if pivot is a low
method newSettings(minLength, minBarSize, maxBarSize)
Creates default ZigZag settings
Namespace types: series int, simple int, input int, const int
Parameters:
minLength (int): Minimum pivot length (default: 10)
minBarSize (int): Minimum bars between pivots (default: 5)
maxBarSize (int): Maximum bars to lookback (default: 300)
Returns: New ZigZagSettings instance
method setLineStyle(this, lineColor, lineWidth, lineStyle)
Sets line appearance
Namespace types: ZigZagSettings
Parameters:
this (ZigZagSettings): Settings instance
lineColor (color)
lineWidth (int)
lineStyle (string)
Returns: Modified settings instance
method newZigZag(settings, depth)
Creates a new ZigZag instance
Namespace types: ZigZagSettings
Parameters:
settings (ZigZagSettings): ZigZag settings
depth (int): Depth value for this ZigZag
Returns: New ZigZag instance
method calculate(this)
Calculates ZigZag using LuxAlgo-style pivot detection
Namespace types: ZigZag
Parameters:
this (ZigZag): ZigZag instance
method getLastPivots(this, count)
Gets the last N pivots
Namespace types: ZigZag
Parameters:
this (ZigZag): ZigZag instance
count (int): Number of pivots to get (default: 5)
Returns: Array of pivots
method getPivot(this, index)
Gets pivot at index
Namespace types: ZigZag
Parameters:
this (ZigZag): ZigZag instance
index (int): Index (0 = most recent)
Returns: Pivot or na
method truncate(this, maxBars)
Truncates old pivots beyond lookback window
Namespace types: ZigZag
Parameters:
this (ZigZag): ZigZag instance
maxBars (int): Maximum bars to keep
method newMultiZigZag(settings, minDepth, maxDepth, count)
Creates a new MultiZigZag manager
Namespace types: ZigZagSettings
Parameters:
settings (ZigZagSettings): Base settings for all ZigZags
minDepth (int): Minimum depth value
maxDepth (int): Maximum depth value
count (int): Number of ZigZag instances (max 11)
Returns: New MultiZigZag instance
method calculateAll(this)
Updates all ZigZag instances
Namespace types: MultiZigZag
Parameters:
this (MultiZigZag): MultiZigZag instance
method getZigZag(this, index)
Gets ZigZag at index
Namespace types: MultiZigZag
Parameters:
this (MultiZigZag): MultiZigZag instance
index (int): Index (0 to count-1)
Returns: ZigZag instance or na
method getDepth(this, index)
Gets depth value at index
Namespace types: MultiZigZag
Parameters:
this (MultiZigZag): MultiZigZag instance
index (int): Index (0 to count-1)
Returns: Depth value
method size(this)
Gets total number of ZigZag instances
Namespace types: MultiZigZag
Parameters:
this (MultiZigZag): MultiZigZag instance
Returns: Count of ZigZag instances
method truncateAll(this, maxBars)
Truncates all ZigZag instances
Namespace types: MultiZigZag
Parameters:
this (MultiZigZag): MultiZigZag instance
maxBars (int): Maximum bars to keep
method distance(p1, p2)
Calculates distance between two pivots
Namespace types: Pivot
Parameters:
p1 (Pivot): First pivot
p2 (Pivot): Second pivot
Returns: Price distance (absolute)
method barSpan(p1, p2)
Calculates bar span between two pivots
Namespace types: Pivot
Parameters:
p1 (Pivot): First pivot
p2 (Pivot): Second pivot
Returns: Bar span (absolute)
method isAlternating(pivots)
Checks if pivots are alternating (high-low-high or low-high-low)
Namespace types: array<Pivot>
Parameters:
pivots (array<Pivot>): Array of pivots
Returns: true if alternating pattern exists
Pivot
Pivot point in the chart
Fields:
d (series int): Direction: 1=high, -1=low
x (series int): Bar index
y (series float): Price
confirmed (series bool): Pivot confirmation flag
ZigZagSettings
ZigZag configuration settings
Fields:
minLength (series int): Minimum pivot detection length
minBarSize (series int): Minimum bars between pivots
maxBarSize (series int): Maximum bars to lookback
lineColor (series color): ZigZag line color
lineWidth (series int): ZigZag line width
lineStyle (series string): ZigZag line style
ZigZag
Single ZigZag instance
Fields:
settings (ZigZagSettings): Configuration settings
pivots (array<Pivot>): Array of pivot points (max 25 for patterns)
lastUpdateBar (series int): Last bar index when updated
depth (series int): Current depth value
MultiZigZag
Multi-depth ZigZag manager
Fields:
zigzags (array<ZigZag>): Array of ZigZag instances (max 11)
depthValues (array<int>): Array of depth values being used
currentBar (series int): Current bar index being processed
method directionName(this)
Gets pivot direction as string
Namespace types: Pivot
Parameters:
this (Pivot): Pivot instance
Returns: "HIGH" or "LOW"
method isHigh(this)
Checks if pivot is a high
Namespace types: Pivot
Parameters:
this (Pivot): Pivot instance
Returns: true if pivot is a high
method isLow(this)
Checks if pivot is a low
Namespace types: Pivot
Parameters:
this (Pivot): Pivot instance
Returns: true if pivot is a low
method newSettings(minLength, minBarSize, maxBarSize)
Creates default ZigZag settings
Namespace types: series int, simple int, input int, const int
Parameters:
minLength (int): Minimum pivot length (default: 10)
minBarSize (int): Minimum bars between pivots (default: 5)
maxBarSize (int): Maximum bars to lookback (default: 300)
Returns: New ZigZagSettings instance
method setLineStyle(this, lineColor, lineWidth, lineStyle)
Sets line appearance
Namespace types: ZigZagSettings
Parameters:
this (ZigZagSettings): Settings instance
lineColor (color)
lineWidth (int)
lineStyle (string)
Returns: Modified settings instance
method newZigZag(settings, depth)
Creates a new ZigZag instance
Namespace types: ZigZagSettings
Parameters:
settings (ZigZagSettings): ZigZag settings
depth (int): Depth value for this ZigZag
Returns: New ZigZag instance
method calculate(this)
Calculates ZigZag using LuxAlgo-style pivot detection
Namespace types: ZigZag
Parameters:
this (ZigZag): ZigZag instance
method getLastPivots(this, count)
Gets the last N pivots
Namespace types: ZigZag
Parameters:
this (ZigZag): ZigZag instance
count (int): Number of pivots to get (default: 5)
Returns: Array of pivots
method getPivot(this, index)
Gets pivot at index
Namespace types: ZigZag
Parameters:
this (ZigZag): ZigZag instance
index (int): Index (0 = most recent)
Returns: Pivot or na
method truncate(this, maxBars)
Truncates old pivots beyond lookback window
Namespace types: ZigZag
Parameters:
this (ZigZag): ZigZag instance
maxBars (int): Maximum bars to keep
method newMultiZigZag(settings, minDepth, maxDepth, count)
Creates a new MultiZigZag manager
Namespace types: ZigZagSettings
Parameters:
settings (ZigZagSettings): Base settings for all ZigZags
minDepth (int): Minimum depth value
maxDepth (int): Maximum depth value
count (int): Number of ZigZag instances (max 11)
Returns: New MultiZigZag instance
method calculateAll(this)
Updates all ZigZag instances
Namespace types: MultiZigZag
Parameters:
this (MultiZigZag): MultiZigZag instance
method getZigZag(this, index)
Gets ZigZag at index
Namespace types: MultiZigZag
Parameters:
this (MultiZigZag): MultiZigZag instance
index (int): Index (0 to count-1)
Returns: ZigZag instance or na
method getDepth(this, index)
Gets depth value at index
Namespace types: MultiZigZag
Parameters:
this (MultiZigZag): MultiZigZag instance
index (int): Index (0 to count-1)
Returns: Depth value
method size(this)
Gets total number of ZigZag instances
Namespace types: MultiZigZag
Parameters:
this (MultiZigZag): MultiZigZag instance
Returns: Count of ZigZag instances
method truncateAll(this, maxBars)
Truncates all ZigZag instances
Namespace types: MultiZigZag
Parameters:
this (MultiZigZag): MultiZigZag instance
maxBars (int): Maximum bars to keep
method distance(p1, p2)
Calculates distance between two pivots
Namespace types: Pivot
Parameters:
p1 (Pivot): First pivot
p2 (Pivot): Second pivot
Returns: Price distance (absolute)
method barSpan(p1, p2)
Calculates bar span between two pivots
Namespace types: Pivot
Parameters:
p1 (Pivot): First pivot
p2 (Pivot): Second pivot
Returns: Bar span (absolute)
method isAlternating(pivots)
Checks if pivots are alternating (high-low-high or low-high-low)
Namespace types: array<Pivot>
Parameters:
pivots (array<Pivot>): Array of pivots
Returns: true if alternating pattern exists
Pivot
Pivot point in the chart
Fields:
d (series int): Direction: 1=high, -1=low
x (series int): Bar index
y (series float): Price
confirmed (series bool): Pivot confirmation flag
ZigZagSettings
ZigZag configuration settings
Fields:
minLength (series int): Minimum pivot detection length
minBarSize (series int): Minimum bars between pivots
maxBarSize (series int): Maximum bars to lookback
lineColor (series color): ZigZag line color
lineWidth (series int): ZigZag line width
lineStyle (series string): ZigZag line style
ZigZag
Single ZigZag instance
Fields:
settings (ZigZagSettings): Configuration settings
pivots (array<Pivot>): Array of pivot points (max 25 for patterns)
lastUpdateBar (series int): Last bar index when updated
depth (series int): Current depth value
MultiZigZag
Multi-depth ZigZag manager
Fields:
zigzags (array<ZigZag>): Array of ZigZag instances (max 11)
depthValues (array<int>): Array of depth values being used
currentBar (series int): Current bar index being processed
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.