Sub ORDER_OrderStatusEx2(OrderID, Status, Filled, Remaining, Price, Code, Market, OrderType, Aspect, Kaiping, Account, AccountType)
dim acfl1
acfl1="800007"'跟踪帐户
if Status="Tradeing" and filled>0 and Account=acfl1 and code="if09" then
if aspect=0 then
call Document.SetExtData("ACFL1_thold_if",document.GetExtData("ACFL1_thold_if")+filled)
end if
if aspect=1 then
call Document.SetExtData("ACFL1_thold_if",document.GetExtData("ACFL1_thold_if")-filled)
end if
end if
End Sub
=====================
买入N手外生全局变量就加上N手
卖出N手外生全局变量就减去N手~
但是无论我怎么操作那个ACFL1_thold_if还是等于0...
if aspect=0 then 你想表示的是买入开仓,可是买入平仓也会成立的,所以应该加上kaiping的判断吧
if aspect=0 and kaiping=0 then
if aspect=0 then 你想表示的是买入开仓,可是买入平仓也会成立的,所以应该加上kaiping的判断吧
if aspect=0 and kaiping=0 then
这个无所谓开平~
只要是买入1手那个全局变量就+1
卖出就-1
但是我这段代码ACFL1_thold_if一直等于0~
我有点不明白
if Status="Tradeing" and filled>0 then
测试了一下 总觉得你这句话有问题 你用这句话 替换你第一句if语句
我替换了一下 就可以了 主要的问题是 第一句if没执行