通达信l2行情接口怎么用?

通达信L2行情接口, 包括了普通行情接口所有功能,并新增了十档行情,逐笔成交,买卖队列和深圳逐笔委托(上海证券交易所不对外提供逐笔委托数据)这四个新功能。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace TdxHqApiDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            //DLL是32位的,因此必须把C#工程生成的目标平台从Any CPU改为X86,才能调用DLL;
            //必须把TdxHqApi.dll复制到工程Debug或Release目录下;
            StringBuilder Result = new StringBuilder(1024 * 1024);
            StringBuilder ErrInfo = new StringBuilder(256);

            bool bool1 = TdxL2Hq_Connect("61.152.107.173", 7707, Result, ErrInfo);
            if (!bool1)
            {
                Console.WriteLine(ErrInfo.ToString());
                return;
            }
        Console.WriteLine(Result.ToString());


            byte[] Market = { 0, 1, 1, 0 };
            string[] Zqdm = { "000001", "600030", "600000", "000750" };
            short Count = 4;
            bool1 = TdxL2Hq_GetSecurityQuotes10(Market, Zqdm, ref Count, Result, ErrInfo);

            if (bool1)
            {
                Console.WriteLine(Result.ToString());
            }
            else
            {
                Console.WriteLine(ErrInfo.ToString());
            }

            TdxL2Hq_Disconnect();
        }

提供了一个命令行工具来实现简单的交互和功能演示,在安装之后,应该可以直接使用 hqget 命令调用, hqget分为交互模式和单命令模式, 可以随时使用 hqget --help 获取通达信l2行情接口的使用规则。通达信l2行情接口使用起来相对也是比较简单的,想要了解更多通达信l2行情接口的,可联系下方名片。

猜你喜欢

转载自blog.csdn.net/Q_2037696191/article/details/127968902
今日推荐