// Parameter input untuk Parabolic SAR input acceleration_factor = 0.02 input acceleration_limit = 0.2
// Inisialisasi variabel untuk Parabolic SAR var float sar = na var float af = acceleration_factor var float ep = na var float hp = na var float lp = na var int trend = 1
// Fungsi Parabolic SAR sar_function() => if trend == 1 sar := sar[1] + af * (ep - sar[1]) sar := max(sar, lp[1], hp[1]) if close < sar trend := -1 sar := hp[1] ep := close af := acceleration_factor lp := low else sar := sar[1] + af * (ep - sar[1]) sar := min(sar, lp[1], hp[1]) if close > sar trend := 1 sar := lp[1] ep := close af := acceleration_factor hp := high
// Update variabel Parabolic SAR ep := if trend == 1 then max(ep, high) else min(ep, low) hp := if trend == 1 then max(high, hp[1]) else hp[1] lp := if trend == 1 then lp[1] else min(low, lp[1]) af := if trend == 1 and ep == high then min(af + acceleration_factor, acceleration_limit) else af af := if trend == -1 and ep == low then min(af + acceleration_factor, acceleration_limit) else af
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.