ATP in kite API

What is the time frame of ATP provided by GetATP method in kitexl?

What it is different from average price provided by GETRTD method?
  • madhukar
    U missed above question but what I have found out that average price in kite API is nothing but vwap, right?
  • HowUTrade
    GetRTD(Exch,TrdSym,"AVGPRICE") and GetAtp(Exch,TrdSym) both returns same values.

    This is a excel UDF which wraps the complex Excel RTD function as mentioned here
    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.

    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.
    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.

    Just call the GetAtp method in your VBA.
    Like Dim AvgPrice = GetAtp(Exch,"NIFTY"). You no need to read any excel range.

  • madhukar
    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!

  • 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.
  • madhukar
    Yes! I did observe that in the morning session and changed it to GETRTD!
Sign In or Register to comment.