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.

Parabolic SAR in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_parabolic_sar as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(
    tickers=["CLUSD"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.technicals.get_parabolic_sar().tail(5)

Or, after setting up the Finance Toolkit MCP, ask:

Where did the Parabolic SAR place its trailing stop for crude oil from 26 to 31 December 2025?

Which returns:

Date CLUSD Benchmark
2025-12-26 55.5988 667.885
2025-12-28 55.8613 669.726
2025-12-29 56.1028 671.384
2025-12-30 56.325 672.875
2025-12-31 56.5294 674.218

Parameters

get_parabolic_sar accepts the following parameters.

ParameterTypeDescriptionExample
periodstrThe time period to consider for historical data. Can be “intraday”, “daily”, “weekly”, “monthly”, “quarterly” or “yearly”. Defaults to “daily”."weekly"
close_columnstrThe column name for closing prices in the historical data. Defaults to “Adj Close”."Close"
af_startfloatInitial acceleration factor. Defaults to 0.02.0.01
af_incrementfloatAmount by which the acceleration factor increases every time a new extreme point is reached. Defaults to 0.02.0.01
af_maxfloatMaximum value the acceleration factor can reach. Defaults to 0.2.0.1
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise).2
growthboolWhether to calculate the growth of the Parabolic SAR. Defaults to False.True
lagint | list[int]The lag to use for the growth calculation. Defaults to 1.4
standardizeboolWhether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.True
Share