投资者咨询:编写跟单程序化 (文华财经wh9)
来源:文华财经 日期:2019-7-29 14:44
Vars
String AccountID;//跟单主账号
String GetRspContract;//合约名称
Numeric GetRspNum;//成交回报个数
Numeric GetRspVol;//成交手数
Numeric GetRspPrice;//成交价格
Numeric GetBuyOrSell;//买卖方向
Numeric GetEntryOrExit;//开平方向
Begin
AccountID="1126602668"; //需要自己指定的主账户
GetRspNum=T_MatchRspNum(AccountID);
GetRspContract=T_GetFrontMatchRspContract(AccountID);
GetRspVol=T_GetFrontMatchRspVol(AccountID);
GetRspPrice=T_GetFrontMatchRspPrice(AccountID);
GetBuyOrSell=T_GetFrontMatchBuyOrSell(AccountID);
GetEntryOrExit=T_GetFrontMatchEntryOrExit(AccountID);
If(GetRspNum>0)//如果成交回报个数大于0
{
GetRspContract.A_SendOrder(IIF(GetBuyOrSell==Enum_Buy,Enum_Sell,Enum_Buy),GetEntryOrExit,GetRspVol,GetRspPrice);//跟单操作
T_PopMatchRsp(AccountID);//删除最早的一个成交回报
}
技术人员回复
日期:2019-7-29 14:59