Retrieves the support and resistance levels for the specified period and assets.

The Support and Resistance Levels are price levels where the price tends to stop and reverse.

  • Support Levels: These are the valleys where the price tends to stop going down and may start to go up. Think of support levels as “floors” that the price has trouble falling below.
  • Resistance Levels: These are the peaks where the price tends to stop going up and may start to go down. Think of resistance levels as “ceilings” that the price has trouble breaking through.

It does so by:

  • Looking for Peaks and Valleys: The function looks at the stock prices and finds the high points (peaks) and low points (valleys) over time.
  • Grouping Similar Peaks and Valleys: Sometimes, prices will stop at similar points multiple times. The function groups these similar peaks and valleys together to identify key resistance and support levels.

Also known as: support levels, resistance levels, pivot points.

Support/Resistance Levels in Python

get_support_resistance_levels is part of the Technicals module of the open-source Finance Toolkit. Install it with:

pip install financetoolkit -U

Then call get_support_resistance_levels as shown below.

from financetoolkit import Toolkit

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

support_resistance_levels = toolkit.technicals.get_support_resistance_levels()

support_resistance_levels.xs("AAPL", level=1, axis="columns")

Which returns:

Date Resistance Support
2026-06-24 174.201 128.17
2026-06-25 174.201 128.17
2026-06-26 174.201 128.17
2026-06-29 174.201 128.17
2026-06-30 174.201 128.17
2026-07-01 174.201 128.17
2026-07-02 174.201 128.17

Parameters

get_support_resistance_levels accepts the following parameters:

  • sensitivity (float, optional): The sensitivity parameter to determine the significance of the peaks and valleys. A higher sensitivity value will result in fewer support and resistance levels being identified. Defaults to 0.05.
  • 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”.
  • window (int, optional): Number of periods for calculating support and resistance levels. The number of periods (time intervals) over which to calculate the support and resistance levels. Defaults to 14.
  • rounding (int | None, optional): The number of decimals to round the results to. If None, the rounding value specified during the initialization of the Toolkit instance will be used. Defaults to None.
  • growth (bool, optional): Whether to calculate the growth of the levels. Defaults to False.
  • lag (int | list[int], optional): The lag to use for the growth calculation. Defaults to 1.
  • 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.
Share