以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://www.weistock.com/bbs/index.asp)
--  高级功能研发区  (http://www.weistock.com/bbs/list.asp?boardid=5)
----  [求助] TradeDetalied2() 返回的 OrderType 不正确  (http://www.weistock.com/bbs/dispbbs.asp?boardid=5&id=144768)

--  作者:hinton
--  发布时间:2016/12/15 10:30:22
--  [求助] TradeDetalied2() 返回的 OrderType 不正确
/*取指定基于0索引序号的其他帐户(CTP,金仕达,恒生,股票等)帐户成交明细
Index        输入参数,基于0索引的成交明细
Date         输出参数,成交时间
Code         输出参数,该持仓品种代码的返回数组,该数组空间至少需要10个字节
Market       输出参数,品种市场
OrderType    输出参数,成交单类型,0限价 1市价 2停损 3限价停损
Action       输出参数,成交方向 0买入 1卖出
Price        输出参数,成交价格
Volume       输出参数,成交量
Kaiping      输出参数,开平仓类型,0开仓 1平仓
Account      输入参数,成交帐户,可省略,若省略则表示当前默认激活帐户
返回值:      成功返回1,失败返回0*/
virtual int TradeDetalied2(int Index, DATE &Date, char *szCode, WORD &Market, int &OrderType, int &Action, float &Price, int &Volume, int &Kaiping, char *szAccount) = 0;


返回的OrderType=255,
其他值返回都正确,
这是什么问题?

--  作者:王锋
--  发布时间:2016/12/15 14:25:41
--  

建议回帖详细告知你的金字塔版本,以及交易类别是模拟还是实盘,什么模拟什么实盘。以及你相关范例测试代码


--  作者:hinton
--  发布时间:2016/12/15 18:08:37
--  
版本:金字塔决策交易系统(x86) 2016 (v3.96)
金字塔股票模拟交易

下单代码:
通过网络向金字塔下单,格式为  "函数名,参数1,参数2,...."(以逗号分隔的字符串), 如下:
"PlaceOrder,0,26,0,100,0,SH600009,0,60003189,0,0,0"

TradeDetalied2() 调用代码如下:
void CMainWindowDlg::OnBnClickedButton4()
{
int Index = g_pMainFramework->GetTradeCount2("60003189") - 1; (Index 从0开始)
int OrderType, Action, Volume, Kaiping;
DATE Date;
char *szCode = new char[100]{ 0 };
WORD Market; 
float Price;
char *szAccount = "60003189";

int res = g_pMainFramework->TradeDetalied2(Index, Date, szCode, Market, OrderType, Action, Price, Volume, Kaiping, szAccount);
if (res)
{
CString dateTime;
COleDateTime odt(Date);
dateTime.Format("%d.%d.%d %d:%d:%d", odt.GetYear(), odt.GetMonth(), odt.GetDay(), odt.GetHour(), odt.GetMinute(), odt.GetSecond());
char dt[100];
memset(dt, 0, 100);
strcpy(dt, dateTime.GetBuffer(dateTime.GetLength()));

CString str;
str.Format("%d,%s,%s,%d,%d,%d,%f,%d,%d,%s", Index, dt, szCode, Market, OrderType, Action, Price, Volume, Kaiping, szAccount);
MessageBox(str);
}
}

输出参数中只有OrderType 不对,返回255,其他输出参数都是正确的


--  作者:FexTel
--  发布时间:2016/12/15 19:18:14
--  
明天测试后答复您这边
[此贴子已经被作者于2016-12-15 19:18:31编辑过]

--  作者:hinton
--  发布时间:2016/12/19 10:13:17
--  
今天返回的值还是255,你们测了吗?