Rss & SiteMap

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

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

标题:请教一段代码

1楼
leonxu 发表于:2017/8/7 15:19:48

if TIME>225955 then begin

 if 5mfx=1 then begin
  if tholding2+TREMAINQTY(3,"" ,"" )<-e then tcancel(1,3);
  if tholding2+TREMAINQTY(2,"" ,"" )<-3*e then tcancel(1,2);
  if tholding2+TREMAINQTY(1,"" ,"" )>4*e then tcancel(1,1);
  if tholding2+TREMAINQTY(4,"" ,"" )>3*e then tcancel(1,4);
 end
 
 if 5mfx=-1 then begin
  if tholding2+TREMAINQTY(1,"" ,"" )>e then  tcancel(1,1);
  if tholding2+TREMAINQTY(4,"" ,"" )>3*e then tcancel(1,4);
  if tholding2+TREMAINQTY(3,"" ,"" )<-4*e then tcancel(1,3);
  if tholding2+TREMAINQTY(2,"" ,"" )<-3*e then tcancel(1,2);
 end
 
end 

 

 

这段代码编译时总说end语句前缺少begin,但看来看去没找着在哪缺,如果新建一个新的交易系统文件,单纯贴这段代码进去,编译时依然是说end语句前缺少begin,而不是先说e没有定义,不知问题出在什么地方。

2楼
FireScript 发表于:2017/8/7 15:51:46
是这样的,你的begin-end 没错。是你的TREMAINQTY(4,"" ,"" )错了。TREMAINQTY(1,'' ,'' )就行了。另外e和5mfx代码里的定义也补下。
3楼
leonxu 发表于:2017/8/9 23:59:38

那这个时间的写法对吗,好象实际中,到时间并没反应

4楼
wenarm 发表于:2017/8/10 8:20:03

没有问题,建议你用debugfile 跟踪输出自己的条件,进而分析定位问题所在。

 

5楼
leonxu 发表于:2017/8/18 16:36:28

这里面的time的写法是应该写time()还是直接time就可以?

 

6楼
FireScript 发表于:2017/8/18 16:46:49
以下是引用leonxu在2017/8/18 16:36:28的发言:

这里面的time的写法是应该写time()还是直接time就可以?

 

都行。有时候不确定的时候,可以新建个公式,单独测试下。我们平时就这样干的。

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


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