PINE LIBRARY

Zigzag

77
Library "Zigzag"
Zigzag related user defined types and methods

method tostring(this, sortKeys, sortOrder, includeKeys)
  Converts ZigzagTypes/Pivot object to string representation
  Namespace types: Pivot
  Parameters:
    this (Pivot): ZigzagTypes/Pivot
    sortKeys (bool): If set to true, string output is sorted by keys.
    sortOrder (int): Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
    includeKeys (array<string>): Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of ZigzagTypes/Pivot

method tostring(this, sortKeys, sortOrder, includeKeys)
  Converts Array of Pivot objects to string representation
  Namespace types: array<Pivot>
  Parameters:
    this (array<Pivot>): Pivot object array
    sortKeys (bool): If set to true, string output is sorted by keys.
    sortOrder (int): Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
    includeKeys (array<string>): Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of Pivot object array

method tostring(this)
  Converts ZigzagFlags object to string representation
  Namespace types: ZigzagFlags
  Parameters:
    this (ZigzagFlags): ZigzagFlags object
  Returns: string representation of ZigzagFlags

method tostring(this, sortKeys, sortOrder, includeKeys)
  Converts ZigzagTypes/Zigzag object to string representation
  Namespace types: Zigzag
  Parameters:
    this (Zigzag): ZigzagTypes/Zigzagobject
    sortKeys (bool): If set to true, string output is sorted by keys.
    sortOrder (int): Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
    includeKeys (array<string>): Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of ZigzagTypes/Zigzag

method getPrices(pivots)
  Gets the array of prices from array of Pivots
  Namespace types: array<Pivot>
  Parameters:
    pivots (array<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: array<Pivot>
  Parameters:
    pivots (array<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: array<Pivot>
  Parameters:
    pivots (array<Pivot>): array<Pivot> array of Pivot objects
  Returns: array<chart.point> array of pivot points

method getPoints(this)
  Gets the array of chart.point from Zigzag Object
  Namespace types: Zigzag
  Parameters:
    this (Zigzag): Zigzag object
  Returns: array<chart.point> array of pivot points

method calculate(this, ohlc, indicators, indicatorNames, ltfHighTime, ltfLowTime)
  Calculate zigzag based on input values and indicator values
  Namespace types: Zigzag
  Parameters:
    this (Zigzag): Zigzag object
    ohlc (array<float>): Array containing OHLC values. Can also have custom values for which zigzag to be calculated
    indicators (matrix<float>): Array of indicator values
    indicatorNames (array<string>): Array of indicator names for which values are present. Size of indicators array should be equal to that of indicatorNames
    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)
  Calculate Next Level Zigzag based on the current calculated zigzag object
  Namespace types: Zigzag
  Parameters:
    this (Zigzag): Zigzag object
  Returns: Next Level Zigzag object

method clear(this)
  Clear the drawings from ZigzagDrawing object
  Namespace types: ZigzagDrawing
  Parameters:
    this (ZigzagDrawing): ZigzagDrawing object
  Returns: ZigzagDrawing object

method clear(this)
  Clear the drawings from ZigzagDrawingPL object
  Namespace types: ZigzagDrawingPL
  Parameters:
    this (ZigzagDrawingPL): ZigzagDrawingPL object
  Returns: ZigzagDrawingPL object

method clear(this)
  Clears zigzag drawings array
  Namespace types: array<ZigzagDrawing>
  Parameters:
    this (array<ZigzagDrawing>): array<ZigzagDrawing>
  Returns: void

method clear(this)
  Clears zigzag drawings array
  Namespace types: array<ZigzagDrawingPL>
  Parameters:
    this (array<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, indicators, indicatorNames)
  draws fresh zigzag based on properties embedded in ZigzagDrawing object
  Namespace types: ZigzagDrawing
  Parameters:
    this (ZigzagDrawing): ZigzagDrawing object
    ohlc (array<float>): values on which the zigzag needs to be calculated and drawn. If not set will use regular OHLC
    indicators (matrix<float>): Array of indicator values
    indicatorNames (array<string>): Array of indicator names for which values are present. Size of indicators array should be equal to that of indicatorNames
  Returns: ZigzagDrawing object

method drawcontinuous(this, ohlc, indicators, indicatorNames)
  draws zigzag based on the zigzagmatrix input
  Namespace types: ZigzagDrawing
  Parameters:
    this (ZigzagDrawing): ZigzagDrawing object
    ohlc (array<float>): values on which the zigzag needs to be calculated and drawn. If not set will use regular OHLC
    indicators (matrix<float>): Array of indicator values
    indicatorNames (array<string>): Array of indicator names for which values are present. Size of indicators array should be equal to that of indicatorNames
  Returns: [array<line> zigzaglines, array<label> zigzaglabels]

Indicator
  Indicator is collection of indicator values applied on high, low and close
  Fields:
    indicatorHigh (series float): Indicator Value applied on High
    indicatorLow (series float): Indicator Value applied on Low

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
    indicators (array<Indicator>): Array of Indicators - allows to add multiple

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
    componentIndex (series int): is the lower level zigzag array index for given pivot. Used only in multi level Zigzag Pivots
    subComponents (series int): is the number of sub waves per each zigzag wave. Only applicable for multi level zigzags
    microComponents (series int): is the number of base zigzag components in a zigzag wave
    ratio (series float): Price Ratio based on previous two pivots
    sizeRatio (series float): Ratio of size beteen current zigzag wave and the last zigzag wave in the same direction.
    barRatio (series float): Bar Ratio based on previous two pivots
    subPivots (array<Pivot>): direct sub pivots of multi level zigzag
    micropivots (array<Pivot>): all micropivots of the the multi level zigzag
    indicatorNames (array<string>): Names of the indicators applied on zigzag
    indicatorValues (array<float>): Values of the indicators applied on zigzag
    indicatorRatios (array<float>): Ratios of the indicators applied on zigzag based on previous 2 pivots

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 (array<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
    showLevels (series bool)
    showSubcomponents (series bool)
    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)

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 (array<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 (array<label>)
    zigzagLine (series polyline): polyline object of zigzag lines

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน