日K線,公式最后全局變量歸0,請問老師下面2種表達(dá)有什么不同?
variable:N1=0;
variable:N2=0;
AA:=CURRENTTIME>closetime(0)or CURRENTTIME<opentime(1) ;
1 if (islastbar and currenttime =closetime(0))or (not(islastbar)) then begin
N1:=0;
N2:=0;
end
2 if (islastbar and dynainfo(207)=closetime(0))or( AA and islastbar)or (not(islastbar))then begin
N1:=0;
N2:=0;
end
currenttime是你本地的計(jì)算機(jī)時(shí)間,dynainfo(207)是交易所時(shí)間,當(dāng)這兩個(gè)時(shí)間一樣時(shí),這兩句就一樣了,
所以你用交易所時(shí)間來判斷比較好
那當(dāng)然不一樣了,還要如果AA成立了其他條件不成立,那么整個(gè)條件判斷也是成立的