variable:flag=0;
myBbi:stkindi('','mybbisys.mybbi',0,6),LINETHICK2,COLORRED;
myMaD10:stkindi('','mybbisys.myMaD10',0,6),LINETHICK2,COLORBLUE;
5LowCloseP:=ref(llv(close,5),1);
5LowOpenP:=ref(llv(open,5),1);
5LowP:MIN(5LowCloseP,5LowOpenP),COLORBLUE;
if cross(5LowP,myBbi) then begin
flag:=1;
end
if cross(myBbi,5LowP) then begin
flag:=0;
end
以上代码全局变量flag是正常的,但如果改为:
if cross(5LowP,myBbi) and cross(5LowP,myMaD10) then begin
flag:=1;
end
if cross(myBbi,5LowP) and cross(myMaD10,5LowP) then begin
flag:=0;
end
全局变量,flag就一直是1,请教版主,这个是什么问题,非常感谢。
说明cross(myBbi,5LowP) and cross(myMaD10,5LowP) 这两个条件永远都没有同时成立的情况