以文本方式查看主题

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

--  作者:qq代人发帖
--  发布时间:2013/10/14 14:05:20
--  怎样把序列模式改正逐K模式?
请教:
序列模式下 for j=1 to barpos do
begin
drawline(barpos=。。,H,BARPOS=。。,L);
end
然后再转回逐K模式下 就画不出来了。
怎样把序列模式改正逐K模式?

--  作者:jinzhe
--  发布时间:2013/10/14 14:15:47
--  
代码写全
--  作者:江平
--  发布时间:2013/10/14 14:34:47
--  
麻烦了 代码有点长。。
VARIABLE:aq1=0,aq2=0,aq3=0,a1=0,a2=0,a3=0,b1=0,b2=0,b3=0;
variable:j=1,h1[2]=0,h2[2]=0,l2[2]=0;
variable:qq1=0,qq2=0,qq3=0;
for j=1 to barpos do
begin
if h[j]<a3 and l[j]>b3  then 
begin
end
else
begin
if a1>0 and a2=0 then
begin
a2:=h[j];b2:=l[j];aq2:=j;
end
if a1=0 and a2=0 then
begin
a1:=h[j];b1:=l[j];aq1:=j;
end
else 
begin
a1:=a2;b1:=b2;aq1:=aq2;
a2:=a3;b2:=b3;aq2:=aq3;
a3:=h[j];b3:=l[j];aq3:=j;
end
if (a2>a1 and a2>a3) or (a2=a1 and a2>a3) then
BEGIN
if h2[1]=0 then
BEGIN
qq3:=a2;
h2[1]:=a2;h2[2]:=aq2;
qq1:=l2[2];qq2:=h2[2];
drawline(barpos=qq1,l2[1],barpos=qq2,h2[1],0),colorblue;
end 
if h2[2]>l2[2] and a2>h2[1] then
BEGIN
qq3:=a2;
h2[1]:=a2;h2[2]:=aq2;
qq1:=l2[2];qq2:=h2[2];
drawline(barpos=qq1,l2[1],barpos=qq2,h2[1],0),colorblue;
end 
if  h2[2]<l2[2] then
begin
qq3:=a2;
h2[1]:=a2;h2[2]:=aq2;
qq1:=l2[2];qq2:=h2[2];
drawline(barpos=qq1,l2[1],barpos=qq2,h2[1],0),colorblue;
end
end
if (b2<b1 and b2<b3) or (b2=b1 and b2<b3)then
BEGIN
if l2[1]=0 then
BEGIN
l2[1]:=b2;l2[2]:=aq2;
qq1:=l2[2];qq2:=h2[2];
drawline(barpos=qq2,h2[1],barpos=qq1,l2[1],0),colorblue;
end
if l2[2]>h2[2] and b2<l2[1] then
BEGIN
l2[1]:=b2;l2[2]:=aq2;
qq1:=l2[2];qq2:=h2[2];
drawline(barpos=qq2,h2[1],barpos=qq1,l2[1],0),colorblue;
end
if l2[2]<h2[2] then
BEGIN
l2[1]:=b2;l2[2]:=aq2;
qq1:=l2[2];qq2:=h2[2];
drawline(barpos=qq2,h2[1],barpos=qq1,l2[1],0),colorblue;
end
end
end
end 

--  作者:王锋
--  发布时间:2013/10/14 14:40:11
--  

没法改的,代码逻辑就是序列模式的。

你可以考虑在逐K线公式中来引用这个序列公式的计算结果