if barpos=1 then
begin
xiangbao:=0;
mark:=0;
end
Bi:0;
Shi:=BARPOS;
if(Shi>3 and mark=0) then
begin
j:=0;
x:=HHVbars(high,Shi);
y:=llvbars(low,Shi);
if(x-y>=4 and high[Shi-y]<low[Shi-x]) then
begin
Bi[Shi-x]:=high[Shi-x];
end
end
dd:Bi,CIRCLEDOT;
想编个公式,才起个头,结果出现莫名其妙的错误:
if(x-y>=4 and high[Shi-y]<low[Shi-x]) then
这一句完全不起作用,无论x-y>=4 还是x-y<=4,显示的完全一样,让人哭笑不得。
莫名其妙的问题,没看说明书吧
x:=HHVbars(high,Shi);
y:=llvbars(low,Shi);
这两句是不能放在 if ....then 语句内部的
其次 if.... then 的正确结构是 if (cond1 and cond2) then if 和 cond1 之间有空格存在的
而非:
if(x-y>=4 and high[Shi-y]<low[Shi-x]) then
不过 if(x-y>=4) then 编译的时候可以通过测试,也可以加载运行,只是运行的结算结果错误。
可见,金字塔的语法检测不够严格吧,2.7版以上可能有改进
只是在逐K线模式下统计函数不能放在IF语句中,并不表示所有函数都不能在IF语句中,如果你非要在IF语句里使用统计函数,那么请使用序列模式.
此外逐K线模式下IF语句的统计函数,只要放在IF之外就可以了,根本不影响程序的编写和功能,只要注意一点就行了
http://www.weistock.com/bbs/dispbbs.asp?boardid=4&Id=332 问题8