以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- 老师,看一下 (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=86841) |
-- 作者:么么 -- 发布时间:2015/11/2 9:10:36 -- 老师,看一下 time>tt1+15 这个是一天的周期吗,老师??
|
-- 作者:jinzhe -- 发布时间:2015/11/2 9:14:24 -- 请结合一下实际情况说明问题, 这样的问题细节太少无法回答 |
-- 作者:么么 -- 发布时间:2015/11/2 9:17:25 -- if c<oo-80*DYNAINFO(208) and n3=0 and time>tt3+15 then begin tbuy(1,44,mkt); n3:=1; tt3>time; end 源码就是这样的
|
-- 作者:jinzhe -- 发布时间:2015/11/2 9:20:05 -- 那么就请咨询下写这代码的人,实在是看不出time>tt3+15 和 一天周期之间有什么相关性 |
-- 作者:么么 -- 发布时间:2015/11/2 9:22:25 -- 低于开盘价80跳,买入44手,并且这一天内只成交这一次 |
-- 作者:jinzhe -- 发布时间:2015/11/2 9:40:31 -- 这个需要全局变量来控制,一天一次 GLOBALVARIABLE:n=0,tt=0; if l<open-80*mindiff and n=0 and time<>tt then begin tbuy(1,1,mkt); n:=1; tt:=time; end
然后代码最后要写上这个,重置变量 if time=closetime(0) then begin n:=0; tt:=0; end [此贴子已经被作者于2015/11/2 9:40:39编辑过]
|
-- 作者:么么 -- 发布时间:2015/11/2 9:56:03 -- GLOBALVARIABLE:n1=0,n2=0,n3=0; GLOBALVARIABLE:tt1=0,tt2=0,tt3=0; oo:=VALUEWHEN(todaybar=1,o); if l<open-20*mindiff and n1=0 and time<>tt1 then begin tbuy(1,11,mkt); n1:=1; tt1:=time; end if c<oo-60*mindiff and n2=0 and time<>tt2 then begin tbuy(1,22,mkt); n2:=1; tt2:=TIME; END if c<oo-80*mindiff and n3=0 and time<>tt3 then begin tbuy(1,44,mkt); n3:=1; tt3:=time; end if time=closetime(0) then begin n:=0; tt:=0; end 是这样的是吗,老师?、
|
-- 作者:jinzhe -- 发布时间:2015/11/2 10:12:52 -- if time=closetime(0) then begin
n1:=0;
n2:=0;
n3:=0; tt1:=0;
tt2:=0;
tt3:=0; end
|
-- 作者:么么 -- 发布时间:2015/11/2 10:57:09 -- 老师,比如一个策略上面有三个平多条件,第一个写成PD,第二个写成PD2,滴三个写成PD3,可以吗?? |
-- 作者:jinzhe -- 发布时间:2015/11/2 10:58:13 -- 可以,这个没有强制性的写法,自己理解就行 |