Rajandran R Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, USDINR and High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in)

How to Estimate the VWAP based settlement Close like a Pro using Amibroker?

2 min read

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.

vwap

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();

Rajandran R Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, USDINR and High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in)

[Live Coding Webinar] Build Your First Trading Bridge for…

In this course, you will be learning to build your own trading bridge using Python. This 60-minute session is perfect for traders, Python enthusiasts,...
Rajandran R
1 min read

[Webinar] Understanding and Mitigating Curve Fitting in System Trading

"Understanding and Mitigating Curve Fitting in System Trading"! This dynamic session aims to equip novice to intermediate traders, quantitative analysts, and financial engineers with...
Rajandran R
1 min read

P-Signal Strategy Long Only Strategy – Amibroker AFL Code

This tutorial provides an overview of the P-Signal reversal strategy, a quantitative trading strategy that utilizes statistical parameters and error functions to generate probabilistic...
Rajandran R
2 min read

One Reply to “How to Estimate the VWAP based settlement Close like…”

  1. Sir how to calculate Spot closing specifically for Expiry days ?? This only calculates for futures.

Leave a Reply

Get Notifications, Alerts on Market Updates, Trading Tools, Automation & More