Library "rzigzag"
Recursive Zigzag Using Matrix allows to create zigzags recursively on multiple levels. This is an old library converted to V6
zigzag(length, ohlc, numberOfPivots, offset)
calculates plain zigzag based on input
Parameters:
length (int): Zigzag Length
ohlc (array<float>): Array containing ohlc values. Can also contain custom series
numberOfPivots (simple int): Number of max pivots to be returned
offset (simple int): Offset from current bar. Can be used for calculations based on confirmed bars
Returns: [matrix<float> zigzagmatrix, bool[] flags]
iZigzag(length, h, l, numberOfPivots)
calculates plain zigzag based on input array
Parameters:
length (int): Zigzag Length
h (array<float>): array containing high values of a series
l (array<float>): array containing low values of a series
numberOfPivots (simple int): Number of max pivots to be returned
Returns: matrix<float> zigzagmatrix
nextlevel(zigzagmatrix, numberOfPivots)
calculates next level zigzag based on present zigzag coordinates
Parameters:
zigzagmatrix (matrix<float>): Matrix containing zigzag pivots, bars, bar time, direction and level
numberOfPivots (simple int): Number of max pivots to be returned
Returns: matrix<float> zigzagmatrix
draw(zigzagmatrix, flags, lineColor, lineWidth, lineStyle, showLabel, xloc)
draws zigzag based on the zigzagmatrix input
Parameters:
zigzagmatrix (matrix<float>): Matrix containing zigzag pivots, bars, bar time, direction and level
flags (array<bool>): Zigzag pivot flags
lineColor (color): Zigzag line color
lineWidth (int): Zigzag line width
lineStyle (string): Zigzag line style
showLabel (bool): Flag to indicate display pivot labels
xloc (string): xloc preference for drawing lines/labels
Returns: [array<line> zigzaglines, array<label> zigzaglabels]
draw(length, ohlc, numberOfPivots, offset, lineColor, lineWidth, lineStyle, showLabel, xloc)
calculates and draws zigzag based on zigzag length and source input
Parameters:
length (int): Zigzag Length
ohlc (array<float>): Array containing ohlc values. Can also contain custom series
numberOfPivots (simple int): Number of max pivots to be returned
offset (simple int): Offset from current bar. Can be used for calculations based on confirmed bars
lineColor (color): Zigzag line color
lineWidth (int): Zigzag line width
lineStyle (string): Zigzag line style
showLabel (bool): Flag to indicate display pivot labels
xloc (string): xloc preference for drawing lines/labels
Returns: [matrix<float> zigzagmatrix, array<line> zigzaglines, array<label> zigzaglabels, bool[] flags]
drawfresh(zigzagmatrix, zigzaglines, zigzaglabels, lineColor, lineWidth, lineStyle, showLabel, xloc)
draws fresh zigzag for all pivots in the input matrix.
Parameters:
zigzagmatrix (matrix<float>): Matrix containing zigzag pivots, bars, bar time, direction and level
zigzaglines (array<line>): array to which all newly created lines will be added
zigzaglabels (array<label>): array to which all newly created lables will be added
lineColor (color): Zigzag line color
lineWidth (int): Zigzag line width
lineStyle (string): Zigzag line style
showLabel (bool): Flag to indicate display pivot labels
xloc (string): xloc preference for drawing lines/labels
Returns: [array<line> zigzaglines, array<label> zigzaglabels]