A lot of money could be saved/earned if you are weekly option buyer/option seller out there especially if you trade the last 30minute of the trade when comes to Indian Markets.
So what is so special about the last 30 min of trade? The key lies in the Daily settlement price which is based on the last hour of the settlement close.
How is the settlement price in the Indian market decided?
Daily Settlement / Weekly Expiry Settlement is decided based on the basis of last half an hour Volume weighted average price of such contract and this rule is applicable for both index and stock futures
Last Traded Price – Refers to the closing price of the future contract at market close
Settlement Price – Refers to the last 30min – VWAP-based adjusted price after the market close.
What is VWAP?
VWAP, or volume-weighted average price, is a technical indicator that is used by traders to measure the average price of a security over a specific time period, typically a day. VWAP is calculated by adding up the total value of all trades in a given period and dividing by the total number of shares traded.

In finance terms, volume-weighted average price (VWAP) is defined as the ratio of the value traded to the total volume traded over a particular time horizon (usually one day). It is a measure of the average price at which a stock is traded over the trading horizon.

How to use Amibroker to Predict the VWAP based settlment close?
Since the last 30min VWAP based settlement is a bunch of calculations one can easily arrive at the estimation of settlement close easier before the exchange shows the settlement close. Consider last Friday’s price movement in the last 30 min.
Learn how to calculate VWAP here
Nifty Futures 1min Charts with last 30min VWAP Calculation

In the last 30min price fell faster from 11930 – 11875 levels. But just look into the VWAP levels around 15.25p.m or even 15.28p.m before the market close. Price is falling faster however VWAP is trading above 11900 levels that’s a 20-25 points difference likely difference between the closing price and settlement price.
And there are times if there is any faster fall or faster rise in the last 30min there will be a considerable difference in the Future Price & Settlement price. And especially on the expiry days, STT Transactions fees will be factored into the ITM options.
so if you have a fair idea about how the STT Transaction + VWAP settlement close will impact the option pricing as an option buyer/option seller can strategically choose their gameplay accordingly especially if you are trading in the last 30min of trading on the expiry day.
From an option, buyer perspective lot of money could be saved if they are trading the ATM Options or slightly ITM Options, especially in the last 30min of trading. And for Option settlers, it brings maximum advantage especially STT Transaction charges + VWAP settlement mostly works in their favor unless there is a dramatic fall in the last 15min of trading.
Here is the simple VWAP AFL to predict/estimate the settlement close before the market closes.
The following Amibroker AFL code works only in 1min, 2min, 5min timeframe
And also goto Amibroker Preferences -> Tools -> Intraday -> Select Start time of the Interval else VWAP plot will not be calculated.
//Coded by Rajandran R
//Founder of Marketcalls and Co-Founder of Algomojo
//Website : www.marketcalls.in
//Note : Code works only in 1min, 2min, 5min timeframe
//Amibroker Preferences -> Tools -> Intraday -> Select Start time of the Interval
_SECTION_BEGIN("How to Estimate the VWAP Settlement Close");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
Bars_so_far_today = 1 + BarsSince( TimeNum() == 150000);
StartBar = ValueWhen(TimeNum() == 150000, BarIndex());
TodayVolume = Sum(V,Bars_so_far_today);
average = (H+L+C+C)/4;
IIf (BarIndex() >= StartBar, VWAP = Sum (average * V, Bars_so_far_today ) / TodayVolume,0);
Plot(IIf(TimeNum() < 150000,null,VWAP),"VWAP",colorYellow,styleLine | styleThick);
_SECTION_END();
Sir how to calculate Spot closing specifically for Expiry days ?? This only calculates for futures.