程序化交易接口→// 查询当日成交 ↲ MetaTrade.QueryData(clientId, (int)QueryType.QueryDayEntrustDeals, result, errorInfo);↲↲ errorInfoStr = errorInfo.ToString(); ↲ if (string.IsNullOrEmpty(errorInfoStr)) ↲ { ↲ Console.WriteLine("查询当日成交成功:"); ↲ Console.WriteLine(result.ToString()); ↲ } →// #region + QueryHistoryData / QueryDatas / SendOrders / CancelOrders / GetQuotes →// 查询股份 ↲ MetaTrade.QueryData(clientId, (int)QueryType.QueryHoldings, result, errorInfo); ↲ errorInfoStr = errorInfo.ToString(); ↲ if (string.IsNullOrEmpty(errorInfoStr)) ↲ { ↲ Console.WriteLine("查询股份成功:"); ↲ Console.WriteLine(result.ToString()); ↲ } →// ↲ 委托撤单 ↲ ↲客户端 Id↲交易所 Id:A1 上海,A0 深圳(部分券商是 ↲委托编号↲撤单数量, 即参数数组的长度↲返回信息,一般要分配 1024*1024 字节的空间,出错时为空字符串。↲错误信息,一般要分配 256 字节的空间,出错时为非空字符串 ↲ [DllImport("MetaTrade.dll", CharSet = CharSet.Ansi)] ↲ public static extern void CancelOrders(int clientId, string[] exchangeId, string[] entrustId, int count, IntPtr[] result, IntPtr[] errorInfo); →// ↲ 跨账户查询各种交易数据 ↲ ↲客户端 Id↲信息种类:0 资金,1 股份,2 当日委托,3 当日成交,4 可撤单,5 股东代码,6 融↲资余额,7 融券余额,8 可融证券↲操作数量↲返回信息,一般要分配 1024*1024 字节的空间,出错时为空字符串。↲错误信息,一般要分配 256 字节的空间,出错时为非空字符串 ↲ [DllImport("MetaTrade.dll", CharSet = CharSet.Ansi)] ↲ public static extern void QueryMultiAccountsDatas(int[] clientId, int[] category, int count, IntPtr[] result, IntPtr[] errorInfo);