How are prices calculated?

So, I am trying to create a feed that uses an initial input of candle data, and streams ticker data for a live chart on a project I am developing.

I assumed that the closing price of a candle displays the price shown on the advanced trade charting, but even the OHLC values differ from those received from the API.

How are the prices cacluated?

Hi @AdamAvix! Thank you for reaching out to us. Apologies for the delay. Please be informed that the prices shown on the Advanced Trade charting are calculated using the best bid and best ask prices from the order book. The OHLC values are calculated using the trade data from the market_trades channel. We hope this answers your question. Do let us know in case you have any more questions, concerns or feedbacks.