Closing Price of stock

hello there,

I’m researching about closing price in fyers, but i am bit confused.

  • Quotes API : in the documentation it clearly mentioned that prev_close_price is the price which is previous day’s closing.

  • Market Depth API : in the documentation it says that c is Price at the of market closing.

  • In Market Depth API the closing Price is not getting changed when market get closed.

My concern is that i want the closing price of MCX and NSE stock’s of the current day after the market get close.

Please, Guide me with this.

@100234535276750750800, Days closing price is averaged for the last 30 mins, ie; from 3PM - 3:30PM.
Solutions:

  1. Technically you can calculate the closing price of the day by taking the average of last 30 mins before closing.
  2. At the end of the day, after 3:35PM get the price using historical API.

@immature_trader hey, thank you for responding.

Can you provide me a snippet or formula to get the closing of current day

  sum_prices = sum(closing_prices[-30:])
  # Calculate the SMA
  sma = sum_prices / 30

Just get the data from historical API, its simple.

I think it is not the average of 30 data-points.[

](http://data-points.It)It is calculated as the volume-weighted average price of trades happened during last 30 minutes, calculated per tick. For convenient approximation, we can calculate it upto per minute level.

Get lowest timeframe data as possible, say per minute data from History API for last 30 minutes.
Closing Price = Sum(Volume X Price) / Sum(Volume)

# Initiate last 30 entries of prices and volumes
last_prices = prices[-30:]
last_volumes = volumes[-30:]

# Calculate Summations
sum_price_volumes = 0
for i in range(30):
     sum_price_volumes += last_prices[i] * last_volumes[i]

sum_volumes = sum(last_volumes)

# Calculate the WAP
close_price = sum_price_volumes / sum_volumes

OR if you can wait for 10 minutes after market closes, History API will itself give daily settled close price on 1D timeframe request, so that you can avoid extra calculations.

Index options doesn’t have volumes to calculate VWAP.

The post in question here is referring to Closing Price of Stocks.

However, Index Options do have Volumes.

Regarding Index (Spot), Closing is calculated based on Closing of individual component stocks based on their weightage % in Index (which is slightly complex than waiting for 10 minutes when exchange itself will broadcast closing price on 1D History API request).

Refer NSE Guidelines - https://www.nseindia.com/products-services/indices-faqs#accordion-m6i13rqsn5-0