Vars
Global Integer sendCount(0);
Events
OnBar(ArrayRef<Integer> indexs)
{
if(sendCount == 0)
{//发开仓单
Array<Integer> orders;
//指定账户指定合约开多头单
Bool ret = A_Sell(Symbol, A_BuyPosition(0), Q_BidPrice, orders, "", "");
if(ret)
{
sendCount = sendCount + 1;
}
}
}
以上代码对73个合约执行时产生27个平仓信号但有多仓的合约是29个,有2个多仓合约没产生平仓信号,而且已申报的全部申报失败。
我明白了是主力合约变了