PINE LIBRARY
업데이트됨 DoppelLib

Library "DoppelLib"
getDailyClose(offset)
Returns the daily close for a specific offset.
For each offset value (from 1 to 21), the function uses a static request.security() call
to retrieve the daily close from the previous day at the specified offset.
Parameters:
offset (int): (int) The offset value (from 1 to 21) representing the desired close value.
Returns: (float) The daily close for the specified offset or na if offset is out of range.
isVolumeAboveThreshold(vol, mediaPeriod, thresholdPercent)
Checks if the current volume is above the threshold based on its moving average.
The threshold is calculated as the average volume plus a percentage increment.
Parameters:
vol (float): (series float) The volume series (e.g. the chart volume).
mediaPeriod (int): (int) The period for calculating the moving average.
thresholdPercent (float): (float) The percentage to add to the average for the threshold.
Returns: (bool) True if the volume exceeds the threshold, false otherwise.
calcPvsra(pvsraVolume, pvsraHigh, pvsraLow, pvsraClose, pvsraOpen, redVectorColor, greenVectorColor, violetVectorColor, blueVectorColor, darkGreyCandleColor, lightGrayCandleColor)
Calculates the PVSRA candle color, determines if a vector candle has appeared,
and returns additional support parameters (average volume, volume spread, highest volume spread).
- "High" (Climax): volume >= 200% of the average OR (volume * candle spread) >= highest spread over the previous 10 bars.
-> Bull candle: green; Bear candle: red.
- "Medium": volume >= 150% of the average.
-> Bull candle: blue; Bear candle: violet.
- Otherwise, default (non-vector) candle colors are used.
Parameters:
pvsraVolume (float): (series float) Volume series.
pvsraHigh (float): (series float) High price series.
pvsraLow (float): (series float) Low price series.
pvsraClose (float): (series float) Close price series.
pvsraOpen (float): (series float) Open price series.
redVectorColor (simple color): (simple color) Color for bearish candle in high scenario.
greenVectorColor (simple color): (simple color) Color for bullish candle in high scenario.
violetVectorColor (simple color): (simple color) Color for bearish candle in medium scenario.
blueVectorColor (simple color): (simple color) Color for bullish candle in medium scenario.
darkGreyCandleColor (simple color): (simple color) Color for bearish candle in non-vector situation.
lightGrayCandleColor (simple color): (simple color) Color for bullish candle in non-vector situation.
Returns: (tuple) A tuple containing: [pvsraColor (color), alertFlag (bool), averageVolume (float),
volumeSpread (float), highestVolumeSpread (float)].
getDailyClose(offset)
Returns the daily close for a specific offset.
For each offset value (from 1 to 21), the function uses a static request.security() call
to retrieve the daily close from the previous day at the specified offset.
Parameters:
offset (int): (int) The offset value (from 1 to 21) representing the desired close value.
Returns: (float) The daily close for the specified offset or na if offset is out of range.
isVolumeAboveThreshold(vol, mediaPeriod, thresholdPercent)
Checks if the current volume is above the threshold based on its moving average.
The threshold is calculated as the average volume plus a percentage increment.
Parameters:
vol (float): (series float) The volume series (e.g. the chart volume).
mediaPeriod (int): (int) The period for calculating the moving average.
thresholdPercent (float): (float) The percentage to add to the average for the threshold.
Returns: (bool) True if the volume exceeds the threshold, false otherwise.
calcPvsra(pvsraVolume, pvsraHigh, pvsraLow, pvsraClose, pvsraOpen, redVectorColor, greenVectorColor, violetVectorColor, blueVectorColor, darkGreyCandleColor, lightGrayCandleColor)
Calculates the PVSRA candle color, determines if a vector candle has appeared,
and returns additional support parameters (average volume, volume spread, highest volume spread).
- "High" (Climax): volume >= 200% of the average OR (volume * candle spread) >= highest spread over the previous 10 bars.
-> Bull candle: green; Bear candle: red.
- "Medium": volume >= 150% of the average.
-> Bull candle: blue; Bear candle: violet.
- Otherwise, default (non-vector) candle colors are used.
Parameters:
pvsraVolume (float): (series float) Volume series.
pvsraHigh (float): (series float) High price series.
pvsraLow (float): (series float) Low price series.
pvsraClose (float): (series float) Close price series.
pvsraOpen (float): (series float) Open price series.
redVectorColor (simple color): (simple color) Color for bearish candle in high scenario.
greenVectorColor (simple color): (simple color) Color for bullish candle in high scenario.
violetVectorColor (simple color): (simple color) Color for bearish candle in medium scenario.
blueVectorColor (simple color): (simple color) Color for bullish candle in medium scenario.
darkGreyCandleColor (simple color): (simple color) Color for bearish candle in non-vector situation.
lightGrayCandleColor (simple color): (simple color) Color for bullish candle in non-vector situation.
Returns: (tuple) A tuple containing: [pvsraColor (color), alertFlag (bool), averageVolume (float),
volumeSpread (float), highestVolumeSpread (float)].
릴리즈 노트
v2Adicionado:
initLineArrays()
createLine(validLines, linePrices, isBullish, lineDates, lineIndices, compra, venda, bullishColor, bearishColor, showLastLines)
Parameters:
validLines (array<line>)
linePrices (array<float>)
isBullish (array<bool>)
lineDates (array<int>)
lineIndices (array<int>)
compra (bool)
venda (bool)
bullishColor (color)
bearishColor (color)
showLastLines (int)
checkLineBreaks(validLines, linePrices, isBullishLine, lineDates, lineIndices, brokenLines, brokenPrices, brokenIsBullish, brokenDates, breakWithClose, setBreakLabel, setBreakLine, currentTime, currentBarIndex)
Parameters:
validLines (array<line>)
linePrices (array<float>)
isBullishLine (array<bool>)
lineDates (array<int>)
lineIndices (array<int>)
brokenLines (array<line>)
brokenPrices (array<float>)
brokenIsBullish (array<bool>)
brokenDates (array<int>)
breakWithClose (bool)
setBreakLabel (bool)
setBreakLine (bool)
currentTime (int)
currentBarIndex (int)
파인 라이브러리
진정한 트레이딩뷰 정신에 따라 작성자는 이 파인 코드를 오픈 소스 라이브러리로 공개하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 건배! 이 라이브러리는 개인적으로 또는 다른 오픈 소스 출판물에서 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰의 적용을 받습니다.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
파인 라이브러리
진정한 트레이딩뷰 정신에 따라 작성자는 이 파인 코드를 오픈 소스 라이브러리로 공개하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 건배! 이 라이브러리는 개인적으로 또는 다른 오픈 소스 출판물에서 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰의 적용을 받습니다.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.