The price returned by the API is not reflecting the actual buy price shown in the WEB Terminal.
In this case, you are calling Orderbook, which shows order details. In this case, you had a Stop Loss order with trigger price of 391.45 with limit price of 395.35. When this Stop Loss order got triggered, it got converted to limit order with price as 395.35.
This is being shown as the API response since it is the Order Book.
The value that we show on frontend is the actual traded price, which you can get as a response from Tradebook. Hope this clarifies!
Why show two different values, orders for both the API and Web have gone thru STOP LOSS order to Limit when triggered, so it should be same.
few solutions I can think of
- is to retain the price of executed in “trigger price”
- add another column executed price and pass that information
- similar to filled quantity, have another price of average executed price
In my experience with other brokers, 3rd one is the one they do.
Not providing the executed price thru API can create lot of challenges as the STOP LOSS orders are expected to execute at different price than the trigger price when big movement happens, we need to be aware of the actual price executed.
Willing to talk to you if you need more explanation
The response fields on API has been designed as per the endpoint of API here. In case of Orderbook, since the purpose is to show order details, the focus is on orders individually and show the order limit price here.
We can look into this suggestions too, but will have to do impact assessment here and possible delay in API response time as well before building this.
Ok I will wait for the update, as without the executed price, tough to know at what price order went in
You can still get information about the executed price on Tradebook API or Trades of an Order API.
ok for now I can use it, but it wouldn’t be efficient during the critical orders time