Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共5 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[求助]帮我看下这段代码有什么毛病...

1楼
bbking 发表于:2012/9/3 13:12:58

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...

[此贴子已经被作者于2012-9-3 13:21:17编辑过]
2楼
guotx2010 发表于:2012/9/3 15:05:33

if aspect=0 then 你想表示的是买入开仓,可是买入平仓也会成立的,所以应该加上kaiping的判断吧

if aspect=0 and kaiping=0 then

 

3楼
bbking 发表于:2012/9/3 15:54:09
以下是引用guotx2010在2012-9-3 15:05:33的发言:

if aspect=0 then 你想表示的是买入开仓,可是买入平仓也会成立的,所以应该加上kaiping的判断吧

if aspect=0 and kaiping=0 then

 

这个无所谓开平~

只要是买入1手那个全局变量就+1

卖出就-1

但是我这段代码ACFL1_thold_if一直等于0~

我有点不明白

4楼
guotx2010 发表于:2012/9/3 17:01:16
那你使用application.msgout输出信息,看看代码走到了没有?
5楼
rushtaotao 发表于:2012/9/4 10:28:38

if Status="Tradeing" and filled>0 then
测试了一下  总觉得你这句话有问题 你用这句话 替换你第一句if语句

我替换了一下 就可以了  主要的问题是 第一句if没执行

共5 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.03125 s, 2 queries.