以文本方式查看主题

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

--  作者:系统使用者
--  发布时间:2016/10/24 16:22:30
--  改模式问题
hld[n]:=0;
for i=n+1 to DATACOUNT do begin
IF FpC[i]>mhn[i-1] then hld[i]:=1; 
else 
IF FpC[i]<mln[i-1] then hld[i]:=-1;
else
hld[i]:=hld[i-1];
end;
转换为程序化交易,逐K模式。该如何改?

--  作者:系统使用者
--  发布时间:2016/10/24 16:28:42
--  
还有这个改:
fc:=c;fo:=o;cc:0*c,LINETHICK0;oo:0*c,LINETHICK0;t1:=0*c;t2:=0*c;
for i=1 to datacount do begin
  if i=1 and fc[i]>fo[i] then
    cc[i]:=fc[i];
    oo[i]:=fc[i];
  if i=1 and fc[i]<fo[i] then
    cc[i]:=fc[i];
    oo[i]:=fc[i];
  if i>1 then
    cc[i]:=cc[i-1];
    oo[i]:=oo[i-1];
  if i>1 and fc[i]>cc[i]*(1+n/100) then begin
    cc[i]:=cc[i-1]*(1+n/100);
    oo[i]:=cc[i-1];
end;
  if i>1 and fc[i]<oo[i]/(1+n/100) then begin
    oo[i]:=oo[i-1]/(1+n/100);
    cc[i]:=oo[i-1];
end;
  if oo[i]=oo[i-1] then
     t1[i]:=t1[i-1]+1;
  if cc[i]=cc[i-1] then
     t2[i]:=t2[i-1]+1;
end;
o1:=ref(oo,t1+1);
c1:=ref(cc,t2+1);

--  作者:jinzhe
--  发布时间:2016/10/24 16:46:18
--  
请帖全部代码
--  作者:系统使用者
--  发布时间:2016/10/24 16:58:10
--  
第2个就是全部代码
--  作者:jinzhe
--  发布时间:2016/10/24 17:10:17
--  

图片点击可在新窗口打开查看此主题相关图片如下:3.png
图片点击可在新窗口打开查看

--  作者:系统使用者
--  发布时间:2016/10/25 0:42:14
--  
10或者5都可以
--  作者:系统使用者
--  发布时间:2016/10/25 0:51:38
--  
N:=2;
fc:=c;fo:=o;cc:0*c,LINETHICK0;oo:0*c,LINETHICK0;t1:=0*c;t2:=0*c;
for i=1 to datacount do begin
  if i=1 and fc[i]>fo[i] then
    cc[i]:=fc[i];
    oo[i]:=fc[i];
  if i=1 and fc[i]<fo[i] then
    cc[i]:=fc[i];
    oo[i]:=fc[i];
  if i>1 then
    cc[i]:=cc[i-1];
    oo[i]:=oo[i-1];
  if i>1 and fc[i]>cc[i]*(1+n/100) then begin
    cc[i]:=cc[i-1]*(1+n/100);
    oo[i]:=cc[i-1];
end;
  if i>1 and fc[i]<oo[i]/(1+n/100) then begin
    oo[i]:=oo[i-1]/(1+n/100);
    cc[i]:=oo[i-1];
end;
  if oo[i]=oo[i-1] then
     t1[i]:=t1[i-1]+1;
  if cc[i]=cc[i-1] then
     t2[i]:=t2[i-1]+1;
end;
o1:=ref(oo,t1+1);
c1:=ref(cc,t2+1);

QDL:if(c1=oo,o1,c1);

--  作者:jinzhe
--  发布时间:2016/10/25 9:10:17
--  
这个改不了,太复杂了, 用户在序列模式下用
--  作者:系统使用者
--  发布时间:2016/10/25 12:00:21
--  
序列模式下不能使用
--  作者:jinzhe
--  发布时间:2016/10/25 13:22:59
--  
上述代码在序列模式下是可以的用,逐k线不行