@madhukar Yes, VWAP == AVGPRICE GetRTD(Exch,TrdSym,"AVGPRICE") and GetAtp(Exch,TrdSym) both returns same values.
GetRTD: This is a excel UDF which wraps the complex Excel RTD function as mentioned here https://howutrade.in/docs/kitenet/html/Introduction.htm#Section12 Here you are getting data through RTD server which works on the mechanism of Push-Pull. So whenever there is a new value, it will be automatically pushed to excel cell where the RTD function is there. So GetRTD is meant to use within Excel cell.
GetAtp: It is a function, so you need to call it every time when you need value. Example usage: Suppose you need avg price of NIFTY in VBA for some calculation. Option1: Get the AvgPrice of Nifty in a Excel cell using the RTD and refer that cell in your VBA. Like Dim AvgPrice = Range("A1").Value. The drawback is the cell address should be precise, if you cut pasted any row/column, the cell address will change and your VBA will fail.
Option2: Just call the GetAtp method in your VBA. Like Dim AvgPrice = GetAtp(Exch,"NIFTY"). You no need to read any excel range.
Okey! But if I use getATP in a cell or in a formula , every time the excel recalculates itself we should get latest value?
Or we need to force excel to recalculate that pertucular cell every time LTP is updated?
Why I am asking is using GETRTD for many values is not good idea, as I have learned through this forum only that rtd uses udp, and has got limits for data packets it can send and receive!
GetAtp will not be recalculated automatically by Excel as the parameters are static. You have to make this GetAtp UDF as Volatile or Add dynamic dummy parameter to UDF to force excel to re-calculate.
U missed above question but what I have found out that average price in kite API is nothing but vwap, right?
Yes, VWAP == AVGPRICE
GetRTD(Exch,TrdSym,"AVGPRICE") and GetAtp(Exch,TrdSym) both returns same values.
GetRTD:
This is a excel UDF which wraps the complex Excel RTD function as mentioned here https://howutrade.in/docs/kitenet/html/Introduction.htm#Section12
Here you are getting data through RTD server which works on the mechanism of Push-Pull. So whenever there is a new value, it will be automatically pushed to excel cell where the RTD function is there. So GetRTD is meant to use within Excel cell.
GetAtp:
It is a function, so you need to call it every time when you need value.
Example usage: Suppose you need avg price of NIFTY in VBA for some calculation.
Option1:
Get the AvgPrice of Nifty in a Excel cell using the RTD and refer that cell in your VBA.
Like Dim AvgPrice = Range("A1").Value. The drawback is the cell address should be precise, if you cut pasted any row/column, the cell address will change and your VBA will fail.
Option2:
Just call the GetAtp method in your VBA.
Like Dim AvgPrice = GetAtp(Exch,"NIFTY"). You no need to read any excel range.
Or we need to force excel to recalculate that pertucular cell every time LTP is updated?
Why I am asking is using GETRTD for many values is not good idea, as I have learned through this forum only that rtd uses udp, and has got limits for data packets it can send and receive!
@HowUTrade
GetAtp will not be recalculated automatically by Excel as the parameters are static.
You have to
make this GetAtp UDF as Volatile
or Add dynamic dummy parameter to UDF to force excel to re-calculate.