Hi @hardik__, The statement is wrong. If the last trade has happened on at 10042.3 then it doesn't mean the next best bid will be lesser than the LTP or next best offer is greater than LTP. It can be anywhere based on what is the price at which next buyer is ready to bid and next seller is ready to offer.
So if i retrieve the bid and ask from the same tick data then also what you mentioned above is valid? Also if api provides data for depth size of 5 the one at 0th index will be the best one right?
The statement is wrong.
If the last trade has happened on at 10042.3 then it doesn't mean the next best bid will be lesser than the LTP or next best offer is greater than LTP. It can be anywhere based on what is the price at which next buyer is ready to bid and next seller is ready to offer.
So if i retrieve the bid and ask from the same tick data then also what you mentioned above is valid? Also if api provides data for depth size of 5 the one at 0th index will be the best one right?
Thanks
Thanks. It seems i was wrong in this case.
Yes, ArrayList in java preserves the order. Hence the first element in the bid ArrayList is the best bid.