PINE LIBRARY
reversal

Library "reversals"
psar(af_start, af_increment, af_max)
Calculates Parabolic Stop And Reverse (SAR)
Parameters:
af_start (simple float): Initial acceleration factor (Wilder's original: 0.02)
af_increment (simple float): Acceleration factor increment per new extreme (Wilder's original: 0.02)
af_max (simple float): Maximum acceleration factor (Wilder's original: 0.20)
Returns: SAR value (stop level for current trend)
fractals()
Detects Williams Fractal patterns (5-bar pattern)
Returns: Tuple [up_fractal, down_fractal] with fractal values (na if no fractal)
swings(lookback, source_high, source_low)
Detects swing highs and swing lows using lookback period
Parameters:
lookback (simple int): Number of bars on each side to confirm swing point
source_high (float): Price series for swing high detection (typically high)
source_low (float): Price series for swing low detection (typically low)
Returns: Tuple [swing_high, swing_low] with swing point values (na if no swing)
pivot(tf)
Calculates classic/standard/floor pivot points
Parameters:
tf (simple string): Timeframe for pivot calculation ("D", "W", "M")
Returns: Tuple [pp, r1, r2, r3, s1, s2, s3] with pivot levels
pivotcam(tf)
Calculates Camarilla pivot points with 8 levels for short-term trading
Parameters:
tf (simple string): Timeframe for pivot calculation ("D", "W", "M")
Returns: Tuple [pp, r1, r2, r3, r4, s1, s2, s3, s4] with pivot levels
pivotdem(tf)
Calculates d-mark pivot points with conditional open/close logic
Parameters:
tf (simple string): Timeframe for pivot calculation ("D", "W", "M")
Returns: Tuple [pp, r1, s1] with pivot levels (only 3 levels)
pivotext(tf)
Calculates extended traditional pivot points with R4-R5 and S4-S5 levels
Parameters:
tf (simple string): Timeframe for pivot calculation ("D", "W", "M")
Returns: Tuple [pp, r1, r2, r3, r4, r5, s1, s2, s3, s4, s5] with pivot levels
pivotfib(tf)
Calculates Fibonacci pivot points using Fibonacci ratios
Parameters:
tf (simple string): Timeframe for pivot calculation ("D", "W", "M")
Returns: Tuple [pp, r1, r2, r3, s1, s2, s3] with pivot levels
pivotwood(tf)
Calculates Woodie's pivot points with weighted closing price
Parameters:
tf (simple string): Timeframe for pivot calculation ("D", "W", "M")
Returns: Tuple [pp, r1, r2, r3, s1, s2, s3] with pivot levels
psar(af_start, af_increment, af_max)
Calculates Parabolic Stop And Reverse (SAR)
Parameters:
af_start (simple float): Initial acceleration factor (Wilder's original: 0.02)
af_increment (simple float): Acceleration factor increment per new extreme (Wilder's original: 0.02)
af_max (simple float): Maximum acceleration factor (Wilder's original: 0.20)
Returns: SAR value (stop level for current trend)
fractals()
Detects Williams Fractal patterns (5-bar pattern)
Returns: Tuple [up_fractal, down_fractal] with fractal values (na if no fractal)
swings(lookback, source_high, source_low)
Detects swing highs and swing lows using lookback period
Parameters:
lookback (simple int): Number of bars on each side to confirm swing point
source_high (float): Price series for swing high detection (typically high)
source_low (float): Price series for swing low detection (typically low)
Returns: Tuple [swing_high, swing_low] with swing point values (na if no swing)
pivot(tf)
Calculates classic/standard/floor pivot points
Parameters:
tf (simple string): Timeframe for pivot calculation ("D", "W", "M")
Returns: Tuple [pp, r1, r2, r3, s1, s2, s3] with pivot levels
pivotcam(tf)
Calculates Camarilla pivot points with 8 levels for short-term trading
Parameters:
tf (simple string): Timeframe for pivot calculation ("D", "W", "M")
Returns: Tuple [pp, r1, r2, r3, r4, s1, s2, s3, s4] with pivot levels
pivotdem(tf)
Calculates d-mark pivot points with conditional open/close logic
Parameters:
tf (simple string): Timeframe for pivot calculation ("D", "W", "M")
Returns: Tuple [pp, r1, s1] with pivot levels (only 3 levels)
pivotext(tf)
Calculates extended traditional pivot points with R4-R5 and S4-S5 levels
Parameters:
tf (simple string): Timeframe for pivot calculation ("D", "W", "M")
Returns: Tuple [pp, r1, r2, r3, r4, r5, s1, s2, s3, s4, s5] with pivot levels
pivotfib(tf)
Calculates Fibonacci pivot points using Fibonacci ratios
Parameters:
tf (simple string): Timeframe for pivot calculation ("D", "W", "M")
Returns: Tuple [pp, r1, r2, r3, s1, s2, s3] with pivot levels
pivotwood(tf)
Calculates Woodie's pivot points with weighted closing price
Parameters:
tf (simple string): Timeframe for pivot calculation ("D", "W", "M")
Returns: Tuple [pp, r1, r2, r3, s1, s2, s3] with pivot levels
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.