Average Price

The Average Price is the average of the open, high, low and close of a period: the four prices of a bar weighted equally.

The formula for the Average Price is as follows:

\[\text{Average Price} = \frac{\text{Open} + \text{High} + \text{Low} + \text{Close}}{4}\]

Where Open, High, Low and Close are the opening, highest, lowest and closing price of the period. It is the only one of the four transforms that includes the open, so it also reflects a gap between the close of the period before and the open.

A price transform condenses the open, high, low and close of a period into one price. The close alone says where a period ended, not where it traded; averaging it with the high and low, or the open, gives a price that reflects the whole range of the period. Indicators that should reflect the whole bar rather than only the close are built on these prices, and a moving average or oscillator of one of them reacts less to a close at the edge of the range than one of the close.

Also known as: AVGPRICE, OHLC4.

In the Finance Toolkit this is get_price_transform with method="average", the same function as Price Transform.

Example · NVDA · 2021 to 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_price_transform:

from financetoolkit import Toolkit

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

toolkit.technicals.get_price_transform(method="average")

Which returns:

References

  • Library Referenced against TA-Lib’s AVGPRICE (Average Price)
  • Library Shares similar logic as pandas-ta-classic’s ohlc4 (Average Price)
  • Library Shares similar logic as Tulip Indicators’ avgprice (Average Price)
Share