Mismatch in trade placement data

BalajiTn
Today I executed a trade with kite api python client. I see that there is a quite a bit difference in values of kite web, api and as well as the order placement - avg price. Please check out the below table for the data discripencies
Time Trade Type Kite web price Python historical price Order price (Avg Price)
12:05 Buy 25,186.20 25,186.20 25,189.90
15:25 Sell 25,249.50 25,249.90 25,249.30
I would like to understand why this difference has happened? As per my profit for a single lot, it should be 4,777.5 (i.e 63.70 points x 75 qty) but zerodha has provided only 4,455.0 (59.4 points x 75 qty) which is a huge difference (4.3 points). I have a difference of Rs.322.5 in one trade lesser than what I should have received.

My doubts are as follows
1. What is the reason for the mismatched data from kite web and api?
2. Why is that my market order has a different pricing compared to the closing candle even if the trade is place at the exact moment?
3. How can I get the market order price from api so that I can calculate the profit and loss as per the zerodha positions page?
4. How do you calculate the Avg.Price as in your order book? This is needed to ascertain the time stamp of this specific data

Please provide the details so that I can validate and try to match the zerodha profit numbers in realtime to my calculation.
  • Nivas
    1. What is the reason for the mismatched data from kite web and api?
    The Kite web and historical API responses should match. If you encounter any instances where the details do not align, please share the raw API response and a screenshot of Kite web so we can assist you further.
    2. Why is that my market order has a different pricing compared to the closing candle even if the trade is place at the exact moment?
    Candle close may not match the order executed in the last second because we are not displaying TBT data on the chart.
    3. How can I get the market order price from api so that I can calculate the profit and loss as per the zerodha positions page?
    If you want to fetch the price at which the order was executed, then you may fetch the order history and check the average price field.
    4. How do you calculate the Avg.Price as in your order book? This is needed to ascertain the time stamp of this specific data
    You don't have to calculate the average price; you can fetch the average price data from the order history.
  • BalajiTn
    Regarding the first question. Please refer to the screenshots attached

    1. In the first image the closing of the 15:05 candle is different from the second image. Also, the volume is different. I have the time stamp in UTC in the second line. Both the images are logs from the python client. I am taking the data from the historical data api



    The first image data is collected exactly at 15:05 and the next image data is collected at 15:06. Why the data is different when I hit the api after 1 min?


    2. In the last image, I have the data from the kite web downloaded as a file from the table view. In this data, the open, and volume are different from the python client. Why is this mismatch happening?

Sign In or Register to comment.