sar

forge.tafunctionSince Forge API 1
Functionpython
forge.ta.sar(high: ArrayLike,low: ArrayLike,af_step: float = 0.02,af_max: float = 0.2) -> np.ndarray

Parabolic stop and reverse.

Parameters

NameTypeDefault
highArrayLike
lowArrayLike
af_stepfloat0.02
af_maxfloat0.2

Indicator: Parabolic SAR

SAR[i+1] = SAR[i] + AF * (EP - SAR[i]): EP is the extreme price of the current trend and AF starts at af_step, grows by af_step with each new extreme and stops at af_max. A reversal restarts both. The value is withheld until the first reversal the price itself causes, so a guessed starting direction never reaches the chart. NaN for a run of fewer than 3 bars.

Classpython
forge.ta.SAR(**inputs: Any) -> None

Trailing stop-and-reverse level that speeds up as the trend runs.

Inputs

NameTypeDefaultRange
af_stepfloat0.020.001 to 1
af_maxfloat0.20.01 to 1

SAR[i+1] = SAR[i] + AF * (EP - SAR[i]), EP = the extreme price of the trend

AF starts at the step, grows by the step with each new extreme and stops at the maximum.

A reversal restarts EP and AF. The first leg is seeded short and is left empty until the first reversal the price itself causes.