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.ndarrayParabolic stop and reverse.
Parameters
| Name | Type | Default |
|---|---|---|
| high | ArrayLike | |
| low | ArrayLike | |
| af_step | float | 0.02 |
| af_max | float | 0.2 |
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) -> NoneTrailing stop-and-reverse level that speeds up as the trend runs.
Inputs
| Name | Type | Default | Range |
|---|---|---|---|
| af_step | float | 0.02 | 0.001 to 1 |
| af_max | float | 0.2 | 0.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.