Calculate the Parabolic Stop and Reverse (SAR) for a given price series.

The Parabolic SAR is a trend-following indicator that trails price action, flipping from below to above price (and vice versa) whenever the trend reverses. The acceleration factor increases as the trend extends, causing the SAR to converge towards price over time.

The formula is as follows:

\[\text{Uptrend SAR} = \text{Prior SAR} + \text{AF} \cdot (\text{Extreme Point} - \text{Prior SAR})\] \[\text{Downtrend SAR} = \text{Prior SAR} - \text{AF} \cdot (\text{Prior SAR} - \text{Extreme Point})\]

Also known as: Parabolic SAR, stop and reverse, PSAR.

No programming experience? With the Finance Toolkit MCP server, AI assistants such as Claude and ChatGPT can calculate the Parabolic SAR for you. Just ask in plain English.

Calculate the Parabolic SAR in Python

The Parabolic SAR is available in the Technicals module of the open-source Finance Toolkit. Install it with:

pip install financetoolkit -U

Then call get_parabolic_sar as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(tickers=["AAPL", "MSFT"])

toolkit.technicals.get_parabolic_sar()

Which returns:

Date AAPL MSFT Benchmark
2026-06-18 300.742 408.527 745.79
2026-06-22 300.078 401.871 744.779
2026-06-23 298.585 397.059 742.923
2026-06-24 297.358 392.639 741.423
2026-06-25 294.781 387.266 739.795
2026-06-26 293.098 384.145 739.184
2026-06-29 291.684 381.061 739.311
2026-06-30 291.599 378.891 740.005
2026-07-01 291.799 377.956 741.457
2026-07-02 292.727 377.967 741.959

Parameters

get_parabolic_sar accepts the following parameters:

  • period (str, optional): The time period to consider for historical data. Can be “daily”, “weekly”, “quarterly”, or “yearly”. Defaults to “daily”.
  • close_column (str, optional): The column name for closing prices in the historical data. Defaults to “Adj Close”.
  • af_start (float, optional): Initial acceleration factor. Defaults to 0.02.
  • af_increment (float, optional): Amount by which the acceleration factor increases every time a new extreme point is reached. Defaults to 0.02.
  • af_max (float, optional): Maximum value the acceleration factor can reach. Defaults to 0.2.
  • rounding (int | None, optional): The number of decimals to round the results to. Defaults to 4.
  • growth (bool, optional): Whether to calculate the growth of the Parabolic SAR. Defaults to False.
  • lag (int | list[int], optional): The lag to use for the growth calculation.
  • standardize (bool, optional): Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False. Defaults to 1.

The Technicals module page introduces the module, and the sidebar lists all of its functions.

Share