Websocket feed to candle conversion

I am getting data like this.. I want to convert tick data into OHLCV candle data.
How to get volume from the tick data. I am currently adding up all ltq. But it is not matching with observed values on the charts. What is the right approach ?

{

    "type": "live_feed",

    "feeds": {

        "MCX_FO|450134": {

        "fullFeed": {

            "marketFF": {

            "ltpc": {

                "ltp": 5641.0,

                "ltt": "1754572376000",

                "ltq": "100",

                "cp": 5713.0

            },

            "marketLevel": {

                "bidAskQuote": \\\[

                {

                    "bidQ": "42",

                    "bidP": 5640.0,

                    "askQ": "2",

                    "askP": 5641.0

                },

                {

                    "bidQ": "21",

                    "bidP": 5639.0,

                    "askQ": "45",

                    "askP": 5642.0

                },

                {

                    "bidQ": "15",

                    "bidP": 5638.0,

                    "askQ": "39",

                    "askP": 5643.0

                },

                {

                    "bidQ": "15",

                    "bidP": 5637.0,

                    "askQ": "32",

                    "askP": 5644.0

                },

                {

                    "bidQ": "17",

                    "bidP": 5636.0,

                    "askQ": "17",

                    "askP": 5645.0

                }

                \\\]

            },

            "optionGreeks": {},

            "marketOHLC": {

                "ohlc": \\\[

                {

                    "interval": "1d",

                    "open": 5715.0,

                    "high": 5724.0,

                    "low": 5633.0,

                    "close": 5641.0,

                    "vol": "14577",

                    "ts": "1754505000000"

                },

                {

                    "interval": "I1",

                    "open": 5644.0,

                    "high": 5645.0,

                    "low": 5641.0,

                    "close": 5641.0,

                    "vol": "27",

                    "ts": "1754572260000"

                }

                \\\]

            },

            "atp": 5674.58,

            "vtt": "14577",

            "oi": 10328.0,

            "tbq": 666.0,

            "tsq": 1003.0

            }

        },

        "requestMode": "full_d5"

        }

    },

    "currentTs": "1754572379558"

    } ..


Hi @Nagajjanav_46715614 , this might be helpful

1 Like

You people have good websocket protobuf implementation.. Another common issue is candle conversion which is done by developer traders.. if you people can give a implementation.. that will help lot of people. Also, it would reduce market ohlc calls onto your servers.. – A suggestion.

@Nagajjanav_46715614 Thanks for the feedback. I will share this information with the relevant team and update this thread once I have an update.