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
Pine kitaplığı
Gerçek TradingView ruhuyla, yazar bu Pine kodunu açık kaynaklı bir kütüphane olarak yayınladı, böylece topluluğumuzdaki diğer Pine programcıları onu yeniden kullanabilir. Yazarı tebrik ederiz! Bu kütüphaneyi özel olarak veya diğer açık kaynaklı yayınlarda kullanabilirsiniz, ancak bu kodun yayınlarda yeniden kullanılması Topluluk Kuralları tarafından yönetilir.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Pine kitaplığı
Gerçek TradingView ruhuyla, yazar bu Pine kodunu açık kaynaklı bir kütüphane olarak yayınladı, böylece topluluğumuzdaki diğer Pine programcıları onu yeniden kullanabilir. Yazarı tebrik ederiz! Bu kütüphaneyi özel olarak veya diğer açık kaynaklı yayınlarda kullanabilirsiniz, ancak bu kodun yayınlarda yeniden kullanılması Topluluk Kuralları tarafından yönetilir.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.