Library "ZigzagLite"
Lighter version of the Zigzag Library. Without indicators and sub-component divisions
method getPrices(pivots)
Gets the array of prices from array of Pivots
Namespace types: Pivot[]
Parameters:
pivots (Pivot[]): array<Pivot> array of Pivot objects
Returns: array<float> array of pivot prices
method getBars(pivots)
Gets the array of bars from array of Pivots
Namespace types: Pivot[]
Parameters:
pivots (Pivot[]): array<Pivot> array of Pivot objects
Returns: array<int> array of pivot bar indices
method getPoints(pivots)
Gets the array of chart.point from array of Pivots
Namespace types: Pivot[]
Parameters:
pivots (Pivot[]): array<Pivot> array of Pivot objects
Returns: array<chart.point> array of pivot points
method getPoints(this)
Namespace types: Zigzag
Parameters:
this (Zigzag)
method calculate(this, ohlc, ltfHighTime, ltfLowTime)
Calculate zigzag based on input values and indicator values
Namespace types: Zigzag
Parameters:
this (Zigzag): Zigzag object
ohlc (float[]): Array containing OHLC values. Can also have custom values for which zigzag to be calculated
ltfHighTime (int): Used for multi timeframe zigzags when called within request.security. Default value is current timeframe open time.
ltfLowTime (int): Used for multi timeframe zigzags when called within request.security. Default value is current timeframe open time.
Returns: current Zigzag object
method calculate(this)
Calculate zigzag based on properties embedded within Zigzag object
Namespace types: Zigzag
Parameters:
this (Zigzag): Zigzag object
Returns: current Zigzag object
method nextlevel(this)
Namespace types: Zigzag
Parameters:
this (Zigzag)
method clear(this)
Clears zigzag drawings array
Namespace types: ZigzagDrawing[]
Parameters:
this (ZigzagDrawing[]): array<ZigzagDrawing>
Returns: void
method clear(this)
Clears zigzag drawings array
Namespace types: ZigzagDrawingPL[]
Parameters:
this (ZigzagDrawingPL[]): array<ZigzagDrawingPL>
Returns: void
method drawplain(this)
draws fresh zigzag based on properties embedded in ZigzagDrawing object without trying to calculate
Namespace types: ZigzagDrawing
Parameters:
this (ZigzagDrawing): ZigzagDrawing object
Returns: ZigzagDrawing object
method drawplain(this)
draws fresh zigzag based on properties embedded in ZigzagDrawingPL object without trying to calculate
Namespace types: ZigzagDrawingPL
Parameters:
this (ZigzagDrawingPL): ZigzagDrawingPL object
Returns: ZigzagDrawingPL object
method drawfresh(this, ohlc)
draws fresh zigzag based on properties embedded in ZigzagDrawing object
Namespace types: ZigzagDrawing
Parameters:
this (ZigzagDrawing): ZigzagDrawing object
ohlc (float[]): values on which the zigzag needs to be calculated and drawn. If not set will use regular OHLC
Returns: ZigzagDrawing object
method drawcontinuous(this, ohlc)
draws zigzag based on the zigzagmatrix input
Namespace types: ZigzagDrawing
Parameters:
this (ZigzagDrawing): ZigzagDrawing object
ohlc (float[]): values on which the zigzag needs to be calculated and drawn. If not set will use regular OHLC
Returns: [array<line> zigzaglines, array<label> zigzaglabels]
PivotCandle
PivotCandle represents data of the candle which forms either pivot High or pivot low or both
Fields:
_high (series float): High price of candle forming the pivot
_low (series float): Low price of candle forming the pivot
length (series int): Pivot length
pHighBar (series int): represents number of bar back the pivot High occurred.
pLowBar (series int): represents number of bar back the pivot Low occurred.
pHigh (series float): Pivot High Price
pLow (series float): Pivot Low Price
Pivot
Pivot refers to zigzag pivot. Each pivot can contain various data
Fields:
point (chart.point): pivot point coordinates
dir (series int): direction of the pivot. Valid values are 1, -1, 2, -2
level (series int): is used for multi level zigzags. For single level, it will always be 0
ratio (series float): Price Ratio based on previous two pivots
sizeRatio (series float)
ZigzagFlags
Flags required for drawing zigzag. Only used internally in zigzag calculation. Should not set the values explicitly
Fields:
newPivot (series bool): true if the calculation resulted in new pivot
doublePivot (series bool): true if the calculation resulted in two pivots on same bar
updateLastPivot (series bool): true if new pivot calculated replaces the old one.
Zigzag
Zigzag object which contains whole zigzag calculation parameters and pivots
Fields:
length (series int): Zigzag length. Default value is 5
numberOfPivots (series int): max number of pivots to hold in the calculation. Default value is 20
offset (series int): Bar offset to be considered for calculation of zigzag. Default is 0 - which means calculation is done based on the latest bar.
level (series int): Zigzag calculation level - used in multi level recursive zigzags
zigzagPivots (Pivot[]): array<Pivot> which holds the last n pivots calculated.
flags (ZigzagFlags): ZigzagFlags object which is required for continuous drawing of zigzag lines.
ZigzagObject
Zigzag Drawing Object
Fields:
zigzagLine (series line): Line joining two pivots
zigzagLabel (series label): Label which can be used for drawing the values, ratios, directions etc.
ZigzagProperties
Object which holds properties of zigzag drawing. To be used along with ZigzagDrawing
Fields:
lineColor (series color): Zigzag line color. Default is color.blue
lineWidth (series int): Zigzag line width. Default is 1
lineStyle (series string): Zigzag line style. Default is line.style_solid.
showLabel (series bool): If set, the drawing will show labels on each pivot. Default is false
textColor (series color): Text color of the labels. Only applicable if showLabel is set to true.
maxObjects (series int): Max number of zigzag lines to display. Default is 300
xloc (series string): Time/Bar reference to be used for zigzag drawing. Default is Time - xloc.bar_time.
curved (series bool): Boolean field to print curved zigzag - used only with polyline implementation
ZigzagDrawing
Object which holds complete zigzag drawing objects and properties.
Fields:
zigzag (Zigzag): Zigzag object which holds the calculations.
properties (ZigzagProperties): ZigzagProperties object which is used for setting the display styles of zigzag
drawings (ZigzagObject[]): array<ZigzagObject> which contains lines and labels of zigzag drawing.
ZigzagDrawingPL
Object which holds complete zigzag drawing objects and properties - polyline version
Fields:
zigzag (Zigzag): Zigzag object which holds the calculations.
properties (ZigzagProperties): ZigzagProperties object which is used for setting the display styles of zigzag
zigzagLabels (label[])
zigzagLine (series polyline): polyline object of zigzag lines
Lighter version of the Zigzag Library. Without indicators and sub-component divisions
method getPrices(pivots)
Gets the array of prices from array of Pivots
Namespace types: Pivot[]
Parameters:
pivots (Pivot[]): array<Pivot> array of Pivot objects
Returns: array<float> array of pivot prices
method getBars(pivots)
Gets the array of bars from array of Pivots
Namespace types: Pivot[]
Parameters:
pivots (Pivot[]): array<Pivot> array of Pivot objects
Returns: array<int> array of pivot bar indices
method getPoints(pivots)
Gets the array of chart.point from array of Pivots
Namespace types: Pivot[]
Parameters:
pivots (Pivot[]): array<Pivot> array of Pivot objects
Returns: array<chart.point> array of pivot points
method getPoints(this)
Namespace types: Zigzag
Parameters:
this (Zigzag)
method calculate(this, ohlc, ltfHighTime, ltfLowTime)
Calculate zigzag based on input values and indicator values
Namespace types: Zigzag
Parameters:
this (Zigzag): Zigzag object
ohlc (float[]): Array containing OHLC values. Can also have custom values for which zigzag to be calculated
ltfHighTime (int): Used for multi timeframe zigzags when called within request.security. Default value is current timeframe open time.
ltfLowTime (int): Used for multi timeframe zigzags when called within request.security. Default value is current timeframe open time.
Returns: current Zigzag object
method calculate(this)
Calculate zigzag based on properties embedded within Zigzag object
Namespace types: Zigzag
Parameters:
this (Zigzag): Zigzag object
Returns: current Zigzag object
method nextlevel(this)
Namespace types: Zigzag
Parameters:
this (Zigzag)
method clear(this)
Clears zigzag drawings array
Namespace types: ZigzagDrawing[]
Parameters:
this (ZigzagDrawing[]): array<ZigzagDrawing>
Returns: void
method clear(this)
Clears zigzag drawings array
Namespace types: ZigzagDrawingPL[]
Parameters:
this (ZigzagDrawingPL[]): array<ZigzagDrawingPL>
Returns: void
method drawplain(this)
draws fresh zigzag based on properties embedded in ZigzagDrawing object without trying to calculate
Namespace types: ZigzagDrawing
Parameters:
this (ZigzagDrawing): ZigzagDrawing object
Returns: ZigzagDrawing object
method drawplain(this)
draws fresh zigzag based on properties embedded in ZigzagDrawingPL object without trying to calculate
Namespace types: ZigzagDrawingPL
Parameters:
this (ZigzagDrawingPL): ZigzagDrawingPL object
Returns: ZigzagDrawingPL object
method drawfresh(this, ohlc)
draws fresh zigzag based on properties embedded in ZigzagDrawing object
Namespace types: ZigzagDrawing
Parameters:
this (ZigzagDrawing): ZigzagDrawing object
ohlc (float[]): values on which the zigzag needs to be calculated and drawn. If not set will use regular OHLC
Returns: ZigzagDrawing object
method drawcontinuous(this, ohlc)
draws zigzag based on the zigzagmatrix input
Namespace types: ZigzagDrawing
Parameters:
this (ZigzagDrawing): ZigzagDrawing object
ohlc (float[]): values on which the zigzag needs to be calculated and drawn. If not set will use regular OHLC
Returns: [array<line> zigzaglines, array<label> zigzaglabels]
PivotCandle
PivotCandle represents data of the candle which forms either pivot High or pivot low or both
Fields:
_high (series float): High price of candle forming the pivot
_low (series float): Low price of candle forming the pivot
length (series int): Pivot length
pHighBar (series int): represents number of bar back the pivot High occurred.
pLowBar (series int): represents number of bar back the pivot Low occurred.
pHigh (series float): Pivot High Price
pLow (series float): Pivot Low Price
Pivot
Pivot refers to zigzag pivot. Each pivot can contain various data
Fields:
point (chart.point): pivot point coordinates
dir (series int): direction of the pivot. Valid values are 1, -1, 2, -2
level (series int): is used for multi level zigzags. For single level, it will always be 0
ratio (series float): Price Ratio based on previous two pivots
sizeRatio (series float)
ZigzagFlags
Flags required for drawing zigzag. Only used internally in zigzag calculation. Should not set the values explicitly
Fields:
newPivot (series bool): true if the calculation resulted in new pivot
doublePivot (series bool): true if the calculation resulted in two pivots on same bar
updateLastPivot (series bool): true if new pivot calculated replaces the old one.
Zigzag
Zigzag object which contains whole zigzag calculation parameters and pivots
Fields:
length (series int): Zigzag length. Default value is 5
numberOfPivots (series int): max number of pivots to hold in the calculation. Default value is 20
offset (series int): Bar offset to be considered for calculation of zigzag. Default is 0 - which means calculation is done based on the latest bar.
level (series int): Zigzag calculation level - used in multi level recursive zigzags
zigzagPivots (Pivot[]): array<Pivot> which holds the last n pivots calculated.
flags (ZigzagFlags): ZigzagFlags object which is required for continuous drawing of zigzag lines.
ZigzagObject
Zigzag Drawing Object
Fields:
zigzagLine (series line): Line joining two pivots
zigzagLabel (series label): Label which can be used for drawing the values, ratios, directions etc.
ZigzagProperties
Object which holds properties of zigzag drawing. To be used along with ZigzagDrawing
Fields:
lineColor (series color): Zigzag line color. Default is color.blue
lineWidth (series int): Zigzag line width. Default is 1
lineStyle (series string): Zigzag line style. Default is line.style_solid.
showLabel (series bool): If set, the drawing will show labels on each pivot. Default is false
textColor (series color): Text color of the labels. Only applicable if showLabel is set to true.
maxObjects (series int): Max number of zigzag lines to display. Default is 300
xloc (series string): Time/Bar reference to be used for zigzag drawing. Default is Time - xloc.bar_time.
curved (series bool): Boolean field to print curved zigzag - used only with polyline implementation
ZigzagDrawing
Object which holds complete zigzag drawing objects and properties.
Fields:
zigzag (Zigzag): Zigzag object which holds the calculations.
properties (ZigzagProperties): ZigzagProperties object which is used for setting the display styles of zigzag
drawings (ZigzagObject[]): array<ZigzagObject> which contains lines and labels of zigzag drawing.
ZigzagDrawingPL
Object which holds complete zigzag drawing objects and properties - polyline version
Fields:
zigzag (Zigzag): Zigzag object which holds the calculations.
properties (ZigzagProperties): ZigzagProperties object which is used for setting the display styles of zigzag
zigzagLabels (label[])
zigzagLine (series polyline): polyline object of zigzag lines
릴리즈 노트
v2Updated:
Pivot
Pivot refers to zigzag pivot. Each pivot can contain various data
Fields:
point (chart.point): pivot point coordinates
dir (series int): direction of the pivot. Valid values are 1, -1, 2, -2
level (series int): is used for multi level zigzags. For single level, it will always be 0
ratio (series float): Price Ratio based on previous two pivots
sizeRatio (series float): ratio of current zigzag wave size in comparison to last zigzag wave in the same direction
barRatio (series float): Bar Ratio based on previous two pivots
릴리즈 노트
v3릴리즈 노트
v4Updated:
ZigzagProperties
Object which holds properties of zigzag drawing. To be used along with ZigzagDrawing
Fields:
lineColor (series color): Zigzag line color. Default is color.blue
lineWidth (series int): Zigzag line width. Default is 1
lineStyle (series string): Zigzag line style. Default is line.style_solid.
showLabel (series bool): If set, the drawing will show labels on each pivot. Default is false
textColor (series color): Text color of the labels. Only applicable if showLabel is set to true.
maxObjects (series int): Max number of zigzag lines to display. Default is 300
xloc (series string): Time/Bar reference to be used for zigzag drawing. Default is Time - xloc.bar_time.
curved (series bool): Boolean field to print curved zigzag - used only with polyline implementation
force_overlay (series bool): force drawing in price overlay
파인 라이브러리
진정한 트레이딩뷰 정신에 따라 작성자는 이 파인 코드를 오픈 소스 라이브러리로 공개하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 건배! 이 라이브러리는 개인적으로 또는 다른 오픈 소스 출판물에서 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰의 적용을 받습니다.
Trial - trendoscope.io/trial
Subscribe - trendoscope.io/pricing
Blog - docs.trendoscope.io
Subscribe - trendoscope.io/pricing
Blog - docs.trendoscope.io
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
파인 라이브러리
진정한 트레이딩뷰 정신에 따라 작성자는 이 파인 코드를 오픈 소스 라이브러리로 공개하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 건배! 이 라이브러리는 개인적으로 또는 다른 오픈 소스 출판물에서 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰의 적용을 받습니다.
Trial - trendoscope.io/trial
Subscribe - trendoscope.io/pricing
Blog - docs.trendoscope.io
Subscribe - trendoscope.io/pricing
Blog - docs.trendoscope.io
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.