Binance.API.Csharp.Client icon indicating copy to clipboard operation
Binance.API.Csharp.Client copied to clipboard

How can i get the Depth

Open Elfarrar opened this issue 7 years ago • 2 comments

Hello, i wanna know how to use the ListenDepthEndpoint?

Elfarrar avatar Feb 01 '18 22:02 Elfarrar

Hi, here is what I put together, hope this helps....

    public void TestDepthEndpoint()
    {
        var apiClient = new ApiClient(tbox_apikey.Text, tbox_apisecret.Text);
        var binanceClient = new BinanceClient(apiClient);

        Task.Run(() => binanceClient.ListenDepthEndpoint("ethbtc", DepthHandler));
        Thread.Sleep(50000);
    }
    private void DepthHandler(DepthMessage messageData)
    {
        var depthData = messageData;
        //    richTextBox1.AppendText(text: Environment.NewLine + "depth " + depthData);
        foreach(var item in depthData.Asks)
        {
            System.Diagnostics.Debug.WriteLine(item.Price);
        //    richTextBox1.AppendText(text: Environment.NewLine + item.Price);
        }
        System.Diagnostics.Debug.WriteLine(depthData.EventType);
    }

mdobson8 avatar Feb 02 '18 14:02 mdobson8

thank you

Elfarrar avatar Feb 03 '18 00:02 Elfarrar