parent
5964b6e757
commit
c5180edb1b
|
@ -0,0 +1 @@
|
|||
/CoreLog/
|
|
@ -1,12 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/1.18.1.0/include/DADataType.h" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/1.18.1.0/include/DAFutureApi.h" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/1.18.1.0/include/DAFutureStruct.h" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/1.18.1.0/include/DAMarketApi.h" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/1.18.1.0/include/DAMarketStruct.h" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/1.18.1.0/include/DAStockApi.h" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/1.18.1.0/include/DAStockStruct.h" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/SDK/1.18.1.0/include/DADataType.h" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/SDK/1.18.1.0/include/DAFutureApi.h" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/SDK/1.18.1.0/include/DAFutureStruct.h" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/SDK/1.18.1.0/include/DAMarketApi.h" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/SDK/1.18.1.0/include/DAMarketStruct.h" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/SDK/1.18.1.0/include/DAStockApi.h" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/SDK/1.18.1.0/include/DAStockStruct.h" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
|
@ -1,28 +0,0 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
directaccess "git.yhrjkj.com/YuanHong/go_DAAPI/1.18.1.0/demo/swig"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
mk := directaccess.NewCMarketReqMarketDataField()
|
||||
defer directaccess.DeleteCMarketReqMarketDataField(mk)
|
||||
|
||||
marketData := directaccess.NewTDAStringTypeArray(directaccess.MAX_SUB_COUNT)
|
||||
defer directaccess.DeleteTDAStringTypeArray(marketData)
|
||||
|
||||
for i := 0; i < directaccess.MAX_SUB_COUNT; i++ {
|
||||
str := directaccess.NewTDAStringTypeArray(directaccess.DA_STR_SIZE)
|
||||
k := "hello"
|
||||
for _i, i2 := range k {
|
||||
str.Setitem(_i, byte(i2))
|
||||
}
|
||||
marketData.Setitem(i, str.Cast()[0])
|
||||
|
||||
}
|
||||
|
||||
mk.SetMarketTrcode((*string)(unsafe.Pointer(marketData.Swigcptr())))
|
||||
|
||||
}
|
|
@ -1,156 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////
|
||||
/// DriectAccess Trade Engine
|
||||
/// Copyright (C) Shanghai DirectAccess Technology Co., Ltd.
|
||||
/// Last Modify 2019/3/18
|
||||
/// Define Market Struct
|
||||
/// Author (c) Wang Jian Quan (Franklin)
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DADataType.h"
|
||||
|
||||
namespace Directaccess {
|
||||
// 错误描述
|
||||
struct CMarketRspInfoField
|
||||
{
|
||||
TDAIntType ErrorID; // 错误码
|
||||
TDAStringType ErrorMsg; // 错误描述
|
||||
};
|
||||
|
||||
|
||||
// 用户登录请求
|
||||
struct CMarketReqUserLoginField
|
||||
{
|
||||
TDAStringType UserId; // 用户标识
|
||||
TDAStringType UserPwd; // 用户密码
|
||||
TDAStringType UserType; // 用户类型
|
||||
TDAStringType MacAddress; // MAC地址
|
||||
TDAStringType ComputerName; // 计算机名
|
||||
TDAStringType SoftwareName; // 软件名称
|
||||
TDAStringType SoftwareVersion; // 软件版本号
|
||||
TDAStringType AuthorCode; // 授权码
|
||||
TDAStringType ErrorDescription; // 错误信息
|
||||
TDAStringType BrokerIDForMarketPrice; // 行情专用的经纪商识别号,与交易无关
|
||||
};
|
||||
|
||||
// 用户登录返回
|
||||
struct CMarketRspUserLoginField
|
||||
{
|
||||
TDAStringType UserName; // 用户名
|
||||
TDAStringType UserPwd; // 登录密码
|
||||
TDAStringType UserType; // 用户类型
|
||||
};
|
||||
|
||||
// 用户登出请求
|
||||
struct CMarketReqUserLogoutField
|
||||
{
|
||||
TDAStringType BrokerID; // 经纪公司代码
|
||||
TDAStringType UserId; // 用户代码
|
||||
TDAStringType ErrorDescription; // 错误信息
|
||||
};
|
||||
|
||||
// 订阅行情请求
|
||||
struct CMarketReqMarketDataField
|
||||
{
|
||||
TDACharType MarketType; // 金融类型
|
||||
TDACharType SubscMode; // 行情种类
|
||||
TDAIntType MarketCount; // 单次最大订阅数
|
||||
TDAStringType MarketTrcode[MAX_SUB_COUNT]; // 单次最大订阅合约
|
||||
TDAStringType ErrorDescription; // 错误信息
|
||||
};
|
||||
|
||||
// 返回行情数据
|
||||
struct CMarketRspMarketDataField
|
||||
{
|
||||
TDAStringType ExchangeCode; // 交易所代码
|
||||
TDAStringType TreatyCode; // 合约代码
|
||||
TDAStringType BuyPrice; // 买价
|
||||
TDAStringType BuyNumber; // 买量
|
||||
TDAStringType SalePrice; // 卖价
|
||||
TDAStringType SaleNumber; // 卖量
|
||||
TDAStringType CurrPrice; // 最新价
|
||||
TDAStringType CurrNumber; // 最新量
|
||||
TDAStringType High; // 当天最高价
|
||||
TDAStringType Low; // 当天最低价
|
||||
TDAStringType Open; // 开盘价
|
||||
TDAStringType IntradaySettlePrice; // 当日盘中结算价(股票:收盘价)
|
||||
TDAStringType Close; // 当天结算价
|
||||
TDAStringType Time; // 行情时间
|
||||
TDAStringType FilledNum; // 成交量
|
||||
TDAStringType HoldNum; // 持仓量
|
||||
TDAStringType BuyPrice2; // 买价2
|
||||
TDAStringType BuyPrice3; // 买价3
|
||||
TDAStringType BuyPrice4; // 买价4
|
||||
TDAStringType BuyPrice5; // 买价5
|
||||
TDAStringType BuyNumber2; // 买量2
|
||||
TDAStringType BuyNumber3; // 买量3
|
||||
TDAStringType BuyNumber4; // 买量4
|
||||
TDAStringType BuyNumber5; // 买量5
|
||||
TDAStringType SalePrice2; // 卖价2
|
||||
TDAStringType SalePrice3; // 卖价3
|
||||
TDAStringType SalePrice4; // 卖价4
|
||||
TDAStringType SalePrice5; // 卖价5
|
||||
TDAStringType SaleNumber2; // 卖量2
|
||||
TDAStringType SaleNumber3; // 卖量3
|
||||
TDAStringType SaleNumber4; // 卖量4
|
||||
TDAStringType SaleNumber5; // 卖量5
|
||||
TDAStringType HideBuyPrice; // 隐藏买价
|
||||
TDAStringType HideBuyNumber; // 隐藏买量
|
||||
TDAStringType HideSalePrice; // 隐藏卖价
|
||||
TDAStringType HideSaleNumber; // 隐藏卖量
|
||||
TDAStringType LimitDownPrice; // 跌停价
|
||||
TDAStringType LimitUpPrice; // 涨停价
|
||||
TDAStringType TradeDay; // 交易日
|
||||
TDAStringType BuyPrice6; // 买价6
|
||||
TDAStringType BuyPrice7; // 买价7
|
||||
TDAStringType BuyPrice8; // 买价8
|
||||
TDAStringType BuyPrice9; // 买价9
|
||||
TDAStringType BuyPrice10; // 买价10
|
||||
TDAStringType BuyNumber6; // 买量6
|
||||
TDAStringType BuyNumber7; // 买量7
|
||||
TDAStringType BuyNumber8; // 买量8
|
||||
TDAStringType BuyNumber9; // 买量9
|
||||
TDAStringType BuyNumber10; // 买量10
|
||||
TDAStringType SalePrice6; // 卖价6
|
||||
TDAStringType SalePrice7; // 卖价7
|
||||
TDAStringType SalePrice8; // 卖价8
|
||||
TDAStringType SalePrice9; // 卖价9
|
||||
TDAStringType SalePrice10; // 卖价10
|
||||
TDAStringType SaleNumber6; // 卖量6
|
||||
TDAStringType SaleNumber7; // 卖量7
|
||||
TDAStringType SaleNumber8; // 卖量8
|
||||
TDAStringType SaleNumber9; // 卖量9
|
||||
TDAStringType SaleNumber10; // 卖量10
|
||||
TDAStringType TradeFlag; // 港交所股票行情:成交类型
|
||||
TDAStringType DataTimestamp; // 交易所数据时间戳
|
||||
TDAStringType DataSourceId; // 数据来源
|
||||
TDAStringType CanSellVol; // 可卖空股数(美股行情用)
|
||||
TDAStringType QuoteType; // 行情区分
|
||||
TDAStringType AggressorSide; // 主动买或主动卖
|
||||
TDAStringType PreSettlementPrice; // 昨结算(股票:昨收盘价)
|
||||
};
|
||||
|
||||
// 订阅经济商请求
|
||||
struct CMarketReqBrokerDataField
|
||||
{
|
||||
TDAStringType ContCode; // 合约代码
|
||||
TDAStringType ErrorDescription; // 错误信息
|
||||
};
|
||||
|
||||
// 返回经济商数据
|
||||
struct CMarketRspBrokerDataField
|
||||
{
|
||||
TDABrokerType BrokerData; // 经济商数据
|
||||
};
|
||||
|
||||
// 推送交易日结构体
|
||||
struct CMarketRspTradeDateField
|
||||
{
|
||||
TDAStringType TradeDate; // 交易日期
|
||||
TDAStringType TradeProduct; // 交易产品
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/sh
|
||||
swig -includeall -c++ -go -intgosize 64 -cgo *.i
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
%module directaccess
|
||||
%{
|
||||
#include "DAMarketStruct.h"
|
||||
%}
|
||||
|
||||
//%include "typemaps.i"
|
||||
//%apply char** INPUT{TDAStringType MarketTrcode[MAX_SUB_COUNT]}
|
||||
|
||||
//%ignore MarketTrcode;
|
||||
|
||||
%include "carrays.i"
|
||||
%array_class(char, TDAStringTypeArray);
|
||||
|
||||
typemap(gotype) (const char * const *) "[]string";
|
||||
|
||||
%include "DAMarketStruct.h"
|
||||
|
||||
%inline %{
|
||||
// go -> C++ -> go
|
||||
// 如何实现:
|
||||
// 1. 定义callbacks 用于回调
|
||||
// 2. 使用director指导swig将 callbacks
|
||||
bool check1(char *c, int v, const char * const *strarray) {
|
||||
return true;
|
||||
}
|
||||
%}
|
|
@ -1,284 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////
|
||||
/// DriectAccess Trade Engine
|
||||
/// Copyright (C) Shanghai DirectAccess Technology Co., Ltd.
|
||||
/// Last Modify 2019/3/18
|
||||
/// Define DataType For API
|
||||
/// Author (c) Wang Jian Quan (Franklin)
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace Directaccess{
|
||||
|
||||
#define DA_STR_SIZE 256
|
||||
#define TRADE_MAX_NUM_ONE_PAGE (5000) //update 2020.04.30 ywh
|
||||
#define MAX_BROKER 4096
|
||||
|
||||
#define DAAPI_VERSION "1.18.1.0"
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef LIB_DA_API_EXPORT
|
||||
#define DA_API_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define DA_API_EXPORT __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
#define DA_API_EXPORT
|
||||
#endif
|
||||
|
||||
typedef char TDACharType;
|
||||
typedef char TDAStringType[DA_STR_SIZE];
|
||||
typedef char TDABrokerType[MAX_BROKER];
|
||||
|
||||
typedef int TDAIntType;
|
||||
typedef int TDAVolumeType;
|
||||
|
||||
typedef double TDADoubleType;
|
||||
typedef double TDAPriceType;
|
||||
typedef double TDAMoneyType;
|
||||
|
||||
/// 单次最大订阅退订数
|
||||
#define MAX_SUB_COUNT 20
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
/// 订阅行情种类
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/// 股票
|
||||
#define DAF_TYPE_Stock 'S'
|
||||
/// 期货
|
||||
#define DAF_TYPE_Future 'D'
|
||||
/// 未知
|
||||
#define DAF_TYPE_Unknown 0
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
/// 订阅类型
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/// 追加订阅
|
||||
#define DAF_SUB_Append '1'
|
||||
/// 替换订阅
|
||||
#define DAF_SUB_Replace '2'
|
||||
/// 退订
|
||||
#define DAF_SUB_Unsubcribe '3'
|
||||
/// 退订所有
|
||||
#define DAF_SUB_UnsubcribeAll '4'
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
/// 行情数据类型
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/// 完整行情数据
|
||||
#define DAF_Market_Full 'Z'
|
||||
/// 成交行情数据
|
||||
#define DAF_Market_Fill 'Y'
|
||||
|
||||
|
||||
/// 空字符串 empty std::string
|
||||
#define EMPTY_STRING ""
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//// Derivative define start
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
/// 买还是卖: DERIVATIVE_BID=买, DERIVATIVE_ASK=卖
|
||||
/// Bid or ask: DERIVATIVE_BID=bid, DERIVATIVE_ASK=ask
|
||||
#define DERIVATIVE_BID "1"
|
||||
#define DERIVATIVE_ASK "2"
|
||||
|
||||
///开仓还是平仓
|
||||
///open/close position flag
|
||||
|
||||
#define DERIVATIVE_OPEN_POS_FLAG "1"
|
||||
#define DERIVATIVE_CLOSE_POS_FLAG "2"
|
||||
|
||||
///订单类型
|
||||
///order type
|
||||
// 定单类型:
|
||||
// DERIVATIVE_LIMIT_ORDER=限价单, DERIVATIVE_MARKET_ORDER=市价单
|
||||
// DERIVATIVE_LIMIT_STOP_ORDER=限价止损,DERIVATIVE_STOP_LOSS_ORDER=止损
|
||||
// Order type:
|
||||
// DERIVATIVE_LIMIT_ORDER=limit order, DERIVATIVE_MARKET_ORDER=market order
|
||||
// DERIVATIVE_LIMIT_STOP_ORDER=limit stop order ,DERIVATIVE_STOP_LOSS_ORDER=stop loss order
|
||||
#define DERIVATIVE_LIMIT_ORDER "1"
|
||||
#define DERIVATIVE_MARKET_ORDER "2"
|
||||
#define DERIVATIVE_LIMIT_STOP_ORDER "3"
|
||||
#define DERIVATIVE_STOP_LOSS_ORDER "4"
|
||||
|
||||
///有效日期
|
||||
///order time in force
|
||||
// 有效日期:
|
||||
// DERIVATIVE_TDY_TIF=当日有效, DERIVATIVE_GTC_TIF=永久有效(GTC),DERIVATIVE_OPG_TIF=OPG,DERIVATIVE_IOC_TIF4=IOC
|
||||
// DERIVATIVE_FOK_TIF=FOK,DERIVATIVE_GTD_TIF=GTD,DERIVATIVE_ATC_TIF=ATC,DERIVATIVE_FAK_TIF=FAK
|
||||
// Order time in force:
|
||||
// DERIVATIVE_TDY_TIF=the day only,DERIVATIVE_GTC_TIF=GTC,DERIVATIVE_OPG_TIF=OPG,DERIVATIVE_IOC_TIF=IOC
|
||||
// DERIVATIVE_FOK_TIF=FOK,DERIVATIVE_GTD_TIF=GTD,DERIVATIVE_ATC_TIF=ATC,DERIVATIVE_FAK_TIF=FAK
|
||||
#define DERIVATIVE_TDY_TIF "1"
|
||||
#define DERIVATIVE_GTC_TIF "2"
|
||||
#define DERIVATIVE_OPG_TIF "3"
|
||||
#define DERIVATIVE_IOC_TIF "4"
|
||||
#define DERIVATIVE_FOK_TIF "5"
|
||||
#define DERIVATIVE_GTD_TIF "6"
|
||||
#define DERIVATIVE_ATC_TIF "7"
|
||||
#define DERIVATIVE_FAK_TIF "8"
|
||||
|
||||
|
||||
///订单状态
|
||||
///Order state
|
||||
// 订单状态:
|
||||
// DERIVATIVE_ORDER_STATE1=已请求; DERIVATIVE_ORDER_STATE2=已排队; DERIVATIVE_ORDER_STATE3=部分成交
|
||||
// DERIVATIVE_ORDER_STATE4=完全成交;DERIVATIVE_ORDER_STATE5=已撤余单;DERIVATIVE_ORDER_STATE6=已撤单
|
||||
// DERIVATIVE_ORDER_STATE7=指令失败;DERIVATIVE_ORDER_STATE8=待送出; DERIVATIVE_ORDER_STATE9=待更改;
|
||||
// DERIVATIVE_ORDER_STATEA=待撤单
|
||||
// Order state:
|
||||
// DERIVATIVE_ORDER_STATE1=requested
|
||||
// DERIVATIVE_ORDER_STATE2=be queuing
|
||||
// DERIVATIVE_ORDER_STATE3=some orders were closed
|
||||
// DERIVATIVE_ORDER_STATE4=full order
|
||||
// DERIVATIVE_ORDER_STATE5=the remaining order has been cancelled
|
||||
// DERIVATIVE_ORDER_STATE6=order has been cancelled
|
||||
// DERIVATIVE_ORDER_STATE7=command failure
|
||||
// DERIVATIVE_ORDER_STATE8=the command is waiting to be sent
|
||||
// DERIVATIVE_ORDER_STATE9=the command is waiting to be changed
|
||||
// DERIVATIVE_ORDER_STATEA=the command is waiting to be cancelled
|
||||
#define DERIVATIVE_ORDER_STATE1 "1"
|
||||
#define DERIVATIVE_ORDER_STATE2 "2"
|
||||
#define DERIVATIVE_ORDER_STATE3 "3"
|
||||
#define DERIVATIVE_ORDER_STATE4 "4"
|
||||
#define DERIVATIVE_ORDER_STATE5 "5"
|
||||
#define DERIVATIVE_ORDER_STATE6 "6"
|
||||
#define DERIVATIVE_ORDER_STATE7 "7"
|
||||
#define DERIVATIVE_ORDER_STATE8 "8"
|
||||
#define DERIVATIVE_ORDER_STATE9 "9"
|
||||
#define DERIVATIVE_ORDER_STATEA "A"
|
||||
|
||||
// 是否模拟用户:DERIVATIVE_IS_SIMULATED_USER=是;DERIVATIVE_IS_NOT_SIMULATED_USER or other:不是
|
||||
//Simulated user:
|
||||
// DERIVATIVE_IS_SIMULATED_USER=is a simulated user
|
||||
// DERIVATIVE_IS_NOT_SIMULATED_USER or other = is not a simulated user
|
||||
#define DERIVATIVE_IS_SIMULATED_USER "1"
|
||||
#define DERIVATIVE_IS_NOT_SIMULATED_USER "0"
|
||||
|
||||
// Order is cancelled:
|
||||
// DERIVATIVE_ORDER_IS_NOT_CANCELLED=order is not cancelled
|
||||
// DERIVATIVE_ORDER_IS_CANCELLED=order is cancelled
|
||||
#define DERIVATIVE_ORDER_IS_NOT_CANCELLED "0"
|
||||
#define DERIVATIVE_ORDER_IS_CANCELLED "1"
|
||||
|
||||
//持仓类型:
|
||||
// DERIVATIVE_POSITION_TYPE_Y=昨仓,DERIVATIVE_POSITION_TYPE_T=今仓
|
||||
//Position type:
|
||||
// DERIVATIVE_POSITION_TYPE_Y=yesterday position, DERIVATIVE_POSITION_TYPE_T=today position
|
||||
#define DERIVATIVE_POSITION_TYPE_Y "0"
|
||||
#define DERIVATIVE_POSITION_TYPE_T "1"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//// End of derivative define
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//// Stock define start
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// 持仓方向:
|
||||
// STOCK_POSITION_FLAG_LONG=买方向,STOCK_POSITION_FLAG_SHORT=卖方向
|
||||
// The position direction flag:
|
||||
// STOCK_POSITION_FLAG_LONG=long position,STOCK_POSITION_FLAG_SHORT=short position
|
||||
#define STOCK_POSITION_FLAG_LONG "1"
|
||||
#define STOCK_POSITION_FLAG_SHORT "2"
|
||||
|
||||
// 买还是卖: STOCK_BID=买, STOCK_ASK=卖
|
||||
// Bid or ask: STOCK_BID=bid, STOCK_ASK=ask
|
||||
#define STOCK_BID "1"
|
||||
#define STOCK_ASK "2"
|
||||
|
||||
// 开仓还是平仓:
|
||||
// STOCK_OPEN_POS_FLAG=开仓,STOCK_OPEN_POS_FLAG=平仓
|
||||
// open/close position flag:
|
||||
// STOCK_OPEN_POS_FLAG=open position,STOCK_CLOSE_POS_FLAG=close position
|
||||
#define STOCK_OPEN_POS_FLAG "1"
|
||||
#define STOCK_CLOSE_POS_FLAG "2"
|
||||
|
||||
|
||||
///订单类型
|
||||
///order type
|
||||
// 定单类型:
|
||||
// STOCK_LIMIT_ORDER=限价单, STOCK_MARKET_ORDER=市价单
|
||||
// STOCK_LIMIT_STOP_ORDER=限价止损,STOCK_STOP_LOSS_ORDER=止损
|
||||
// Order type:
|
||||
// STOCK_LIMIT_ORDER=limit order, STOCK_MARKET_ORDER=market order
|
||||
// STOCK_LIMIT_STOP_ORDER=limit stop order ,STOCK_STOP_LOSS_ORDER=stop loss order
|
||||
|
||||
#define STOCK_LIMIT_ORDER "1"
|
||||
#define STOCK_MARKET_ORDER "2"
|
||||
#define STOCK_LIMIT_STOP_ORDER "3"
|
||||
#define STOCK_STOP_LOSS_ORDER "4"
|
||||
|
||||
///有效日期
|
||||
///order time in force
|
||||
// 有效日期:
|
||||
// STOCKE_TDY_TIF=当日有效, STOCK_GTC_TIF=永久有效(GTC),STOCK_OPG_TIF=OPG,STOCK_IOC_TIF4=IOC
|
||||
// STOCK_FOK_TIF=FOK,STOCK_GTD_TIF=GTD,STOCK_ATC_TIF=ATC,STOCK_FAK_TIF=FAK
|
||||
// Order time in force:
|
||||
// STOCK_TDY_TIF=the day only,STOCK_GTC_TIF=GTC,STOCK_OPG_TIF=OPG,STOCK_IOC_TIF=IOC
|
||||
// STOCK_FOK_TIF=FOK,STOCK_GTD_TIF=GTD,STOCK_ATC_TIF=ATC,STOCK_FAK_TIF=FAK
|
||||
#define STOCK_TDY_TIF "1"
|
||||
#define STOCK_GTC_TIF "2"
|
||||
#define STOCK_OPG_TIF "3"
|
||||
#define STOCK_IOC_TIF "4"
|
||||
#define STOCK_FOK_TIF "5"
|
||||
#define STOCK_GTD_TIF "6"
|
||||
#define STOCK_ATC_TIF "7"
|
||||
#define STOCK_FAK_TIF "8"
|
||||
|
||||
|
||||
///订单状态
|
||||
///Order state
|
||||
// 订单状态:
|
||||
// STOCK_ORDER_STATE1=已请求; STOCK_ORDER_STATE2=已排队; STOCK_ORDER_STATE3=部分成交
|
||||
// STOCK_ORDER_STATE4=完全成交;STOCK_ORDER_STATE5=已撤余单;STOCK_ORDER_STATE6=已撤单
|
||||
// STOCK_ORDER_STATE7=指令失败;STOCK_ORDER_STATE8=待送出; STOCK_ORDER_STATE9=待更改;
|
||||
// STOCK_ORDER_STATEA=待撤单
|
||||
// Order state:
|
||||
// STOCK_ORDER_STATE1=requested
|
||||
// STOCK_ORDER_STATE2=be queuing
|
||||
// STOCK_ORDER_STATE3=some orders were closed
|
||||
// STOCK_ORDER_STATE4=full order
|
||||
// STOCK_ORDER_STATE5=the remaining order has been cancelled
|
||||
// STOCK_ORDER_STATE6=order has been cancelled
|
||||
// STOCK_ORDER_STATE7=command failure
|
||||
// STOCK_ORDER_STATE8=the command is waiting to be sent
|
||||
// STOCK_ORDER_STATE9=the command is waiting to be changed
|
||||
// STOCK_ORDER_STATEA=the command is waiting to be cancelled
|
||||
#define STOCK_ORDER_STATE1 "1"
|
||||
#define STOCK_ORDER_STATE2 "2"
|
||||
#define STOCK_ORDER_STATE3 "3"
|
||||
#define STOCK_ORDER_STATE4 "4"
|
||||
#define STOCK_ORDER_STATE5 "5"
|
||||
#define STOCK_ORDER_STATE6 "6"
|
||||
#define STOCK_ORDER_STATE7 "7"
|
||||
#define STOCK_ORDER_STATE8 "8"
|
||||
#define STOCK_ORDER_STATE9 "9"
|
||||
#define STOCK_ORDER_STATEA "A"
|
||||
|
||||
|
||||
// 是否模拟用户:STOCK_IS_SIMULATED_USER=是;STOCK_IS_NOT_SIMULATED_USER or other:不是
|
||||
//Simulated user:
|
||||
// STOCK_IS_SIMULATED_USER=is a simulated user
|
||||
// STOCK_IS_NOT_SIMULATED_USER or other = is not a simulated user
|
||||
#define STOCK_IS_SIMULATED_USER "1"
|
||||
#define STOCK_IS_NOT_SIMULATED_USER "0"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//// End of Stock define
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package main
|
||||
|
||||
import "git.yhrjkj.com/YuanHong/go_DAAPI/1.18.1.0/market"
|
||||
|
||||
func main() {
|
||||
req := market.NewCMarketReqMarketDataField()
|
||||
defer market.DeleteCMarketReqMarketDataField(req)
|
||||
|
||||
req.SetMarketCount(market.TDAIntType(8))
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,16 +0,0 @@
|
|||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (https://www.swig.org).
|
||||
* Version 4.1.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing - modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
// source: swig.i
|
||||
|
||||
#ifndef SWIG_market_WRAP_H_
|
||||
#define SWIG_market_WRAP_H_
|
||||
|
||||
class Swig_memory;
|
||||
|
||||
#endif
|
|
@ -39,7 +39,7 @@ namespace Directaccess {
|
|||
//推送函数
|
||||
public:
|
||||
virtual void OnRtnTrade(CFutureRtnTradeField *pRtnTrade, CFutureRspInfoField *pRspInfo, int iRequestID, bool bIsLast) {}
|
||||
virtual void OnRtnOrder(CFutureRtnOrderField *pRtnOrder, CFutureRspInfoField *pRspInfo, int iRequestID, bool bIsLast) {}
|
||||
virtual void OnRtnOrder(CFutureRtnOrderField *pRtnOrder, CFutureRspInfoField *pRspInfo, int iRequestID, bool bIsLast) {}
|
||||
virtual void OnRtnCapital(CFutureRtnCapitalField *pRtnCapital, CFutureRspInfoField *pRspInfo, int iRequestID, bool bIsLast) {}
|
||||
virtual void OnRtnPosition(CFutureRtnPositionField *pRtnPosition, CFutureRspInfoField *pRspInfo, int iRequestID, bool bIsLast) {}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"git.yhrjkj.com/YuanHong/go_DAAPI/SDK/1.18.1.0/market"
|
||||
"log"
|
||||
"time"
|
||||
)
|
||||
|
||||
var api market.CMarketApi
|
||||
var notify market.IMarketEvent
|
||||
|
||||
func init() {
|
||||
api = market.CMarketApiCreateMarketApi(true)
|
||||
if api.Swigcptr() == 0 {
|
||||
log.Fatalln("CMarketApiCreateMarketApi failed")
|
||||
}
|
||||
notify = market.NewDirectorIMarketEvent(&MarketEvent{})
|
||||
api.RegisterSpi(notify)
|
||||
|
||||
api.RegisterNameServer("tcp://222.73.119.230:9016")
|
||||
api.SetHeartBeatTimeout(5)
|
||||
|
||||
}
|
||||
|
||||
func main() {
|
||||
api.Init()
|
||||
log.Println("init success")
|
||||
|
||||
time.Sleep(time.Hour * 10)
|
||||
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"git.yhrjkj.com/YuanHong/go_DAAPI/SDK/1.18.1.0/market"
|
||||
"log"
|
||||
"time"
|
||||
)
|
||||
|
||||
type MarketEvent struct {
|
||||
}
|
||||
|
||||
func (m MarketEvent) OnFrontConnected() {
|
||||
|
||||
log.Println("OnFrontConnected ")
|
||||
|
||||
time.Sleep(time.Second)
|
||||
req := market.NewCMarketReqUserLoginField()
|
||||
defer market.DeleteCMarketReqUserLoginField(req)
|
||||
|
||||
req.SetUserId("AF00000003")
|
||||
req.SetUserPwd("888888")
|
||||
req.SetAuthorCode("porl99bbo/jrfib5xxgagza5giggzr/u")
|
||||
req.SetMacAddress("song_123")
|
||||
req.SetComputerName("WJQ-PC")
|
||||
req.SetSoftwareName("yuanhong")
|
||||
req.SetSoftwareVersion("2.0.0")
|
||||
req.SetBrokerIDForMarketPrice("porl99bbo")
|
||||
reqId := 0
|
||||
if api.ReqUserLogin(req, reqId) {
|
||||
log.Println("开始登录....")
|
||||
} else {
|
||||
log.Println("登录失败....")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (m MarketEvent) OnFrontDisconnected(arg2 int) {
|
||||
//TODO implement me
|
||||
log.Println("OnFrontDisconnected implement me")
|
||||
}
|
||||
|
||||
func (m MarketEvent) OnHeartBeatWarning(arg2 int) {
|
||||
//TODO implement me
|
||||
//log.Println("OnHeartBeatWarning implement me")
|
||||
}
|
||||
|
||||
func (m MarketEvent) OnRspRawData(arg2 string) {
|
||||
//TODO implement me
|
||||
log.Println("OnRspRawData implement me")
|
||||
}
|
||||
|
||||
func (m MarketEvent) OnRspUserLogin(arg2 market.CMarketRspInfoField, arg3 int, arg4 bool) {
|
||||
if arg2.GetErrorID() != 0 {
|
||||
log.Println("OnRspUserLogin error", arg2.GetErrorMsg())
|
||||
return
|
||||
}
|
||||
log.Println("OnRspUserLogin success")
|
||||
|
||||
req := market.NewCMarketReqMarketDataField()
|
||||
defer market.DeleteCMarketReqMarketDataField(req)
|
||||
req.SetSubscMode(market.DAF_SUB_Append)
|
||||
req.SetMarketType(market.DAF_TYPE_Future)
|
||||
req.SetMarketTrcode([]string{"CME,CL2405"})
|
||||
req.SetMarketCount(1)
|
||||
reqId := 0
|
||||
if api.ReqMarketData(req, reqId) {
|
||||
log.Println("开始订阅....")
|
||||
} else {
|
||||
log.Println("订阅失败....")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (m MarketEvent) OnRspTradeDate(arg2 market.CMarketRspTradeDateField, arg3 market.CMarketRspInfoField, arg4 int, arg5 bool) {
|
||||
//TODO implement me
|
||||
log.Println("OnRspTradeDate implement me")
|
||||
}
|
||||
|
||||
func (m MarketEvent) OnRspBrokerData(arg2 market.CMarketRspBrokerDataField, arg3 market.CMarketRspInfoField, arg4 int, arg5 bool) {
|
||||
//TODO implement me
|
||||
log.Println("OnRspBrokerData implement me")
|
||||
}
|
||||
|
||||
func (m MarketEvent) OnRspMarketData(arg2 market.CMarketRspMarketDataField, arg3 market.CMarketRspInfoField, arg4 int, arg5 bool) {
|
||||
//TODO implement me
|
||||
log.Println("OnRspMarketData implement me")
|
||||
}
|
||||
|
||||
func (m MarketEvent) OnRspUserLogout(arg2 market.CMarketRspInfoField, arg3 int, arg4 bool) {
|
||||
//TODO implement me
|
||||
log.Println("OnRspUserLogout implement me")
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -2,18 +2,17 @@
|
|||
%header%{
|
||||
#include "../include/DADataType.h"
|
||||
#include "../include/DAMarketStruct.h"
|
||||
#include "../include/DAMarketApi.h"
|
||||
using namespace Directaccess;
|
||||
%}
|
||||
|
||||
%include "std_string.i"
|
||||
%include "carrays.i"
|
||||
|
||||
%header%{
|
||||
#include "../include/DADataType.h"
|
||||
#include "../include/DAMarketStruct.h"
|
||||
%}
|
||||
|
||||
//%feature("director") IMarketEvent;
|
||||
%feature("director") IMarketEvent;
|
||||
|
||||
%include "../include/DADataType.h"
|
||||
%include "../include/DAMarketStruct.h"
|
||||
%include "../include/DAMarketApi.h"
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,61 @@
|
|||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (https://www.swig.org).
|
||||
* Version 4.2.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing - modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
// source: swig.i
|
||||
|
||||
#ifndef SWIG_market_WRAP_H_
|
||||
#define SWIG_market_WRAP_H_
|
||||
|
||||
class Swig_memory;
|
||||
|
||||
class SwigDirector_IMarketEvent : public Directaccess::IMarketEvent
|
||||
{
|
||||
public:
|
||||
SwigDirector_IMarketEvent(int swig_p);
|
||||
void _swig_upcall_OnFrontConnected() {
|
||||
Directaccess::IMarketEvent::OnFrontConnected();
|
||||
}
|
||||
virtual void OnFrontConnected();
|
||||
void _swig_upcall_OnFrontDisconnected(int iReason) {
|
||||
Directaccess::IMarketEvent::OnFrontDisconnected(iReason);
|
||||
}
|
||||
virtual void OnFrontDisconnected(int iReason);
|
||||
void _swig_upcall_OnHeartBeatWarning(int iTimeLapse) {
|
||||
Directaccess::IMarketEvent::OnHeartBeatWarning(iTimeLapse);
|
||||
}
|
||||
virtual void OnHeartBeatWarning(int iTimeLapse);
|
||||
void _swig_upcall_OnRspRawData(char const *rawData) {
|
||||
Directaccess::IMarketEvent::OnRspRawData(rawData);
|
||||
}
|
||||
virtual void OnRspRawData(char const *rawData);
|
||||
void _swig_upcall_OnRspUserLogin(Directaccess::CMarketRspInfoField *pRspInfo,int iRequestID,bool bIsLast) {
|
||||
Directaccess::IMarketEvent::OnRspUserLogin(pRspInfo,iRequestID,bIsLast);
|
||||
}
|
||||
virtual void OnRspUserLogin(Directaccess::CMarketRspInfoField *pRspInfo,int iRequestID,bool bIsLast);
|
||||
void _swig_upcall_OnRspTradeDate(Directaccess::CMarketRspTradeDateField *pRspTradeDate,Directaccess::CMarketRspInfoField *pRspInfo,int iRequestID,bool bIsLast) {
|
||||
Directaccess::IMarketEvent::OnRspTradeDate(pRspTradeDate,pRspInfo,iRequestID,bIsLast);
|
||||
}
|
||||
virtual void OnRspTradeDate(Directaccess::CMarketRspTradeDateField *pRspTradeDate,Directaccess::CMarketRspInfoField *pRspInfo,int iRequestID,bool bIsLast);
|
||||
void _swig_upcall_OnRspBrokerData(Directaccess::CMarketRspBrokerDataField *pRspBrokerData,Directaccess::CMarketRspInfoField *pRspInfo,int iRequestID,bool bIsLast) {
|
||||
Directaccess::IMarketEvent::OnRspBrokerData(pRspBrokerData,pRspInfo,iRequestID,bIsLast);
|
||||
}
|
||||
virtual void OnRspBrokerData(Directaccess::CMarketRspBrokerDataField *pRspBrokerData,Directaccess::CMarketRspInfoField *pRspInfo,int iRequestID,bool bIsLast);
|
||||
void _swig_upcall_OnRspMarketData(Directaccess::CMarketRspMarketDataField *pRspMarketData,Directaccess::CMarketRspInfoField *pRspInfo,int iRequestID,bool bIsLast) {
|
||||
Directaccess::IMarketEvent::OnRspMarketData(pRspMarketData,pRspInfo,iRequestID,bIsLast);
|
||||
}
|
||||
virtual void OnRspMarketData(Directaccess::CMarketRspMarketDataField *pRspMarketData,Directaccess::CMarketRspInfoField *pRspInfo,int iRequestID,bool bIsLast);
|
||||
void _swig_upcall_OnRspUserLogout(Directaccess::CMarketRspInfoField *pRspInfo,int iRequestID,bool bIsLast) {
|
||||
Directaccess::IMarketEvent::OnRspUserLogout(pRspInfo,iRequestID,bIsLast);
|
||||
}
|
||||
virtual void OnRspUserLogout(Directaccess::CMarketRspInfoField *pRspInfo,int iRequestID,bool bIsLast);
|
||||
private:
|
||||
intgo go_val;
|
||||
Swig_memory *swig_mem;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -11,9 +11,9 @@
|
|||
package trade
|
||||
|
||||
/*
|
||||
#define intgo swig_intgo
|
||||
#define intgo swig_intgoCFutureRspTradeField
|
||||
typedef void *swig_voidp;
|
||||
|
||||
OnRspQryTotalPosition
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
@ -5059,6 +5059,8 @@ type CFutureReqOrderModifyField interface {
|
|||
GetOrgOrderLocationID() (_swig_ret string)
|
||||
}
|
||||
|
||||
type CFutureRspOrderModifyField CFutureReqOrderModifyField
|
||||
|
||||
type SwigcptrCFutureReqOrderCancelField uintptr
|
||||
|
||||
func (p SwigcptrCFutureReqOrderCancelField) Swigcptr() uintptr {
|
||||
|
@ -7317,6 +7319,8 @@ type CFutureRspTradeField interface {
|
|||
GetErrorDescription() (_swig_ret string)
|
||||
}
|
||||
|
||||
type CFutureRtnTradeField CFutureRspTradeField
|
||||
|
||||
type SwigcptrCFutureQryInstrumentField uintptr
|
||||
|
||||
func (p SwigcptrCFutureQryInstrumentField) Swigcptr() uintptr {
|
||||
|
@ -11295,6 +11299,10 @@ type CFutureRtnOrderField interface {
|
|||
GetProfitLoss() (_swig_ret float64)
|
||||
}
|
||||
|
||||
type CFutureRspTotalPositionField CFutureRtnOrderField
|
||||
|
||||
type CFutureRtnPositionField CFutureRtnOrderField
|
||||
|
||||
type SwigcptrCFutureRtnCapitalField uintptr
|
||||
|
||||
func (p SwigcptrCFutureRtnCapitalField) Swigcptr() uintptr {
|
|
@ -0,0 +1,51 @@
|
|||
package go_DAAPI
|
||||
|
||||
import "git.yhrjkj.com/YuanHong/go_DAAPI/SDK/1.18.1.0/trade"
|
||||
|
||||
type IFutureEvent interface {
|
||||
//状态函数
|
||||
OnFrontConnected()
|
||||
OnFrontDisconnected(nReason int)
|
||||
OnHeartBeatWarning(nTimeLapse int)
|
||||
|
||||
//请求函数
|
||||
OnRspNeedVerify(bFirstLogin bool, bHasSetQA bool)
|
||||
OnRspUserLogin(pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
OnRspUserLogout(pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
OnRspVerifyCode(pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
OnRspSafeVerify(pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
OnRspSetVerifyQA(pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
|
||||
OnRspAccountRegister(pRspAccount trade.CFutureRspAccountField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
OnRspQuestionAnswer(pRspVersion trade.CFutureRspQuestionField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
OnRspOrderInsert(pRspOrderInsert trade.CFutureRspOrderInsertField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
OnRspOrderModify(pRspOrderModify trade.CFutureRspOrderModifyField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
OnRspOrderCancel(pRspOrderCancel trade.CFutureRspOrderCancelField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
OnRspPasswordUpdate(pRspPasswordUpdate trade.CFutureRspPasswordUpdateField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
|
||||
//推送函数
|
||||
|
||||
OnRtnTrade(pRtnTrade trade.CFutureRtnTradeField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
|
||||
OnRtnOrder(pRtnOrder trade.CFutureRtnOrderField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
|
||||
OnRtnCapital(pRtnCapital trade.CFutureRtnCapitalField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
|
||||
OnRtnPosition(pRtnPosition trade.CFutureRtnPositionField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
|
||||
//查询函数
|
||||
OnRspQryOrder(pRspQryOrder trade.CFutureRspOrderField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
OnRspQryTrade(pRspQryTrade trade.CFutureRspTradeField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
OnRspQryCapital(pRspCapital trade.CFutureRspCapitalField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
OnRspQryVersion(pRspVersion trade.CFutureRspVersionField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
OnRspQryPosition(pRspPosition trade.CFutureRspPositionField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
OnRspQryCurrency(pRspCurrency trade.CFutureRspCurrencyField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
OnRspQryExchange(pRspExchange trade.CFutureRspExchangeField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
OnRspQryStrategy(pRspStrategy trade.CFutureRspStrategyField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
OnRspQryCommodity(pRspCommodity trade.CFutureRspCommodityField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
OnRspQryInstrument(pRspInstrument trade.CFutureRspInstrumentField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
OnRspQryExchangeTime(OnRspQryExchangeTimeField trade.CFutureRspExchangeTimeField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
OnRspQryCommodityTime(pRspCommodityTime trade.CFutureRspCommodityTimeField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
OnRspQryTotalPosition(pRspTotalPosition trade.CFutureRspTotalPositionField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
OnRspQryStrategyDetail(pRspStrategyDetail trade.CFutureRspStrategyDetailField, pRspInfo trade.CFutureRspInfoField, nRequestID int, bIsLast bool)
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package go_DAAPI
|
||||
|
||||
import "git.yhrjkj.com/YuanHong/go_DAAPI/SDK/1.18.1.0/market"
|
||||
|
||||
type IMarketEvent interface {
|
||||
OnFrontConnected()
|
||||
OnFrontDisconnected(iReason int)
|
||||
OnHeartBeatWarning(iTimeLapse int)
|
||||
|
||||
OnRspRawData(rawData []byte)
|
||||
|
||||
OnRspUserLogin(pRspInfo market.CMarketRspInfoField, requestId int, isLast bool)
|
||||
OnRspUserLogout(pRspInfo market.CMarketRspInfoField, requestId int, isLast bool)
|
||||
OnRspTradeDate(pRspTradeDate market.CMarketRspTradeDateField, pRspInfo market.CMarketRspInfoField, requestId int, isLast bool)
|
||||
OnRspBrokerData(pRspBrokerData market.CMarketRspBrokerDataField, pRspInfo market.CMarketRspInfoField, requestId int, isLast bool)
|
||||
OnRspMarketData(pRspMarketData market.CMarketRspMarketDataField, pRspInfo market.CMarketRspInfoField, requestId int, isLast bool)
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package go_DAAPI
|
||||
|
||||
import "git.yhrjkj.com/YuanHong/go_DAAPI/SDK/1.18.1.0/market"
|
||||
|
||||
type MarketApi struct {
|
||||
api market.CMarketApi
|
||||
}
|
Loading…
Reference in New Issue