Quantitative Finance & Trading
Parabolic SAR Formula: Acceleration Factor Step & Prior Two-Bar Penetration Clamp
Implement J. Welles Wilder’s exact Parabolic Stop-and-Reverse (SAR) step SAR_next = SAR_curr + AF * (EP - SAR_curr) including the often-omitted prior two-lows non-penetration clamp.
Do not forget Wilder’s prior-two-bars penetration clamp in Parabolic SAR
In a long trade, J. Welles Wilder’s (1978) Parabolic SAR ratchets upward each bar toward the highest Extreme Point (EP, B4) reached during the trend: Raw_SARt+1 = SAR_t + AF * (EP - SAR_t), where the Acceleration Factor AF starts at 0.02 and increments by +0.02 on each new high up to a cap of 0.20.
Most simplified blog formulas omit Wilder’s mandatory non-penetration rule: in an uptrend, SARt+1 may NEVER be set higher than yesterday’s low (Lowt-1, B5) OR two bars ago’s low (Lowt-2, B6). Enforcing Clamped_Rising_SAR = MIN(SAR_t + AF * (EP - SAR_t), B5, B6) prevents premature stop-outs during brief consolidations.
| SAR Scenario (SAR_t = 96.00, AF = 0.06, EP = 106.00) | Raw Step (96 + 0.60) | Prior Two Lows (B5, B6) | Clamped Next SAR |
|---|---|---|---|
| Unconstrained Advance | 96.60 | 98.50, 97.20 | 96.60 (Raw step governs) |
| Pullback Consolidation Clamp | 96.60 | 96.20, 97.20 | 96.20 (Clamped at Lowt-1) |
Clamped Rising Parabolic SAR Step for Next Bar
Computes MIN(SAR_t + AF * (EP - SAR_t), Lowt-1, Lowt-2) while validating 0.02 <= AF <= 0.20 and EP > SAR_t.
=IF(OR(B3 < 0.02, B3 > 0.2, B4 <= B2), "Invalid AF or EP <= Current SAR", ROUND(MIN(B2 + B3 * (B4 - B2), B5, B6), 2))Updated Acceleration Factor AF Capped at 0.20 on New High (B7 > EP)
Increments AF by +0.02 up to 0.20 whenever current bar High B7 prints a new trend Extreme Point above B4.
=IF(B7 > B4, ROUND(MIN(0.2, B3 + 0.02), 2), B3)Try the example
Use the original values or change them to test your understanding.