PINE LIBRARY
已更新 Pivots

Library "Pivots"
This Library focuses in functions related to pivot highs and lows and some of their applications (i.e. divergences, zigzag, harmonics, support and resistance...)
pivots(srcH, srcL, length) Delivers series of pivot highs, lows and zigzag.
Parameters:
srcH: Source series to look for pivot highs. Stricter applications might source from 'close' prices. Oscillators are also another possible source to look for pivot highs and lows. By default 'high'
srcL: Source series to look for pivot lows. By default 'low'
length: This value represents the minimum number of candles between pivots. The lower the number, the more detailed the pivot profile. The higher the number, the more relevant the pivots. By default 10
Returns: [pivotHigh, pivotLow]
zigzagArray(pivotHigh, pivotLow) Delivers a Zigzag series based on alternating pivots. Ocasionally this line could paint a few consecutive lows or highs without alternating. That happens because it's finding a few consecutive Higher Highs or Lower Lows. If to use lines entities instead of series, that could be easily avoided. But in this one, I'm more interested outputting series rather than painting/deleting line entities.
Parameters:
pivotHigh: Pivot high series
pivotLow: Pivot low series
Returns: [zigzagSeries, zigzagValues, zigzagIndex, zigzagPivot]
zigzagLine(srcH, srcL, colorLine, widthLine) Delivers a Zigzag based on line entities.
Parameters:
srcH: Source series to look for pivot highs. Stricter applications might source from 'close' prices. Oscillators are also another possible source to look for pivot highs and lows. By default 'high'
srcL: Source series to look for pivot lows. By default 'low'
colorLine: Color of the Zigzag Line. By default Fuchsia
widthLine: Width of the Zigzag Line. By default 4
Returns: Zigzag printed on screen
divergence(h2, l2, h1, l1, length) Calculates divergences between 2 series
Parameters:
h2: Series in which to locate divs: Highs
l2: Series in which to locate divs: Lows
h1: Series in which to locate pivots: Highs. By default high
l1: Series in which to locate pivots: Lows. By default low
length: Length used to calculate Pivots: By default 10
Returns: [actualH2, actualL2, actualH1, actualL1, bullRegDiv, bearRegDiv, bullHidDiv, bearHidDiv, bullRegDivRT, bearRegDivRT, bullHidDivRT, bearHidDivRT]
This Library focuses in functions related to pivot highs and lows and some of their applications (i.e. divergences, zigzag, harmonics, support and resistance...)
pivots(srcH, srcL, length) Delivers series of pivot highs, lows and zigzag.
Parameters:
srcH: Source series to look for pivot highs. Stricter applications might source from 'close' prices. Oscillators are also another possible source to look for pivot highs and lows. By default 'high'
srcL: Source series to look for pivot lows. By default 'low'
length: This value represents the minimum number of candles between pivots. The lower the number, the more detailed the pivot profile. The higher the number, the more relevant the pivots. By default 10
Returns: [pivotHigh, pivotLow]
zigzagArray(pivotHigh, pivotLow) Delivers a Zigzag series based on alternating pivots. Ocasionally this line could paint a few consecutive lows or highs without alternating. That happens because it's finding a few consecutive Higher Highs or Lower Lows. If to use lines entities instead of series, that could be easily avoided. But in this one, I'm more interested outputting series rather than painting/deleting line entities.
Parameters:
pivotHigh: Pivot high series
pivotLow: Pivot low series
Returns: [zigzagSeries, zigzagValues, zigzagIndex, zigzagPivot]
zigzagLine(srcH, srcL, colorLine, widthLine) Delivers a Zigzag based on line entities.
Parameters:
srcH: Source series to look for pivot highs. Stricter applications might source from 'close' prices. Oscillators are also another possible source to look for pivot highs and lows. By default 'high'
srcL: Source series to look for pivot lows. By default 'low'
colorLine: Color of the Zigzag Line. By default Fuchsia
widthLine: Width of the Zigzag Line. By default 4
Returns: Zigzag printed on screen
divergence(h2, l2, h1, l1, length) Calculates divergences between 2 series
Parameters:
h2: Series in which to locate divs: Highs
l2: Series in which to locate divs: Lows
h1: Series in which to locate pivots: Highs. By default high
l1: Series in which to locate pivots: Lows. By default low
length: Length used to calculate Pivots: By default 10
Returns: [actualH2, actualL2, actualH1, actualL1, bullRegDiv, bearRegDiv, bullHidDiv, bearHidDiv, bullRegDivRT, bearRegDivRT, bullHidDivRT, bearHidDivRT]
發行說明
v2Updated:
divergence(hLead, lLead, hFollow, lFollow, length)
Calculates divergences between 2 series
Parameters:
hLead (float): Highs of Leading Series in which to locate the Pivots
lLead (float): Lows of Leading Series in which to locate the Pivots
hFollow (float): Highs of Following Series to compare against
lFollow (float): Lows of Following Series to compare against
length (int): Length used to calculate Pivots
Returns: [rBull, rBear, hBull, hBear, isPivHigh, isPivLow]
發行說明
v3Pine腳本庫
秉持 TradingView 一貫的共享精神,作者將此 Pine 程式碼發佈為開源庫,讓社群中的其他 Pine 程式設計師能夠重複使用。向作者致敬!您可以在私人專案或其他開源發佈中使用此庫,但在公開發佈中重複使用該程式碼需遵守社群規範。
I develop indicators meant to be useful, profitable and good looking.
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
Pine腳本庫
秉持 TradingView 一貫的共享精神,作者將此 Pine 程式碼發佈為開源庫,讓社群中的其他 Pine 程式設計師能夠重複使用。向作者致敬!您可以在私人專案或其他開源發佈中使用此庫,但在公開發佈中重複使用該程式碼需遵守社群規範。
I develop indicators meant to be useful, profitable and good looking.
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。