以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  改交易模型  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=67722)

--  作者:系统使用者
--  发布时间:2014/7/23 11:59:16
--  改交易模型
hld[n]:=0;
for i=n+1 to DATACOUNT do begin
IF fkc[i]>mhn[i-1] then hld[i]:=1; 
else 
IF fkc[i]<mln[i-1] then hld[i]:=-1;
else
hld[i]:=hld[i-1];
end;

改序列模型为逐K


--  作者:jinzhe
--  发布时间:2014/7/23 13:22:15
--  
第一句改成variable:hld=0;
--  作者:系统使用者
--  发布时间:2014/7/23 13:42:50
--  
改了也没有用,不显示结果
--  作者:系统使用者
--  发布时间:2014/7/23 13:45:18
--  
variable:hld=0;
fkc:= c;
mhn:=h;
mln:=l;
for i=n+1 to DATACOUNT do begin
IF fkc[i]>mhn[i-1] then hld[i]:=1; 
else 
IF fkc[i]<mln[i-1] then hld[i]:=-1;
else
hld[i]:=hld[i-1];
end;
hilo:IF(hld=-1,mhn,mln);

--  作者:jinzhe
--  发布时间:2014/7/23 13:48:52
--  
n是多少?
--  作者:系统使用者
--  发布时间:2014/7/23 14:04:07
--  
5
--  作者:jinzhe
--  发布时间:2014/7/23 14:34:06
--  

variable:hld=0;
fkc:=c;
mhn:=h;
mln:=l;
r1:=ref(mhn,1);
r2:=ref(mln,1);


if barpos>=6 then begin
 if fkc>r1 then hld:=1;
 if fkc<r2 then hld:=-1;
end
hh:hld;


hilo:IF(hld=-1,mhn,mln);


--  作者:系统使用者
--  发布时间:2014/7/23 22:49:57
--  
结构错误,不一样
--  作者:系统使用者
--  发布时间:2014/7/23 22:50:28
--  
variable:hld=0;
fkc:= c;
mhn:=h;
mln:=l;
for i=6+1 to DATACOUNT do begin
IF fkc[i]>mhn[i-1] then hld[i]:=1; 
else 
IF fkc[i]<mln[i-1] then hld[i]:=-1;
else
hld[i]:=hld[i-1];
end;
hilo:IF(hld=-1,mhn,mln);

--  作者:jinzhe
--  发布时间:2014/7/24 8:43:02
--  
按照你的意思改了,不然你用逐k线循环实现不了