如下程式碼,為何 B、S在指標的價格都一樣?
var: intrabarpersist _priceB(0) ,intrabarpersist _priceS(0);
if condition92 then begin
_priceB =GetField("Close","tick");
plot92(_priceB,"92");
value92=_priceB;
end;
if condition93 then begin
_priceS = GetField("Close","tick");
plot93( _priceS ,"93");
value93=_priceS;
end;
B腳本如下程式碼,為何 B、S在指標的說不出的怪?
input:length(30,"期數");
variable:up1(0),down1(0),mid1(0),bbandwidth(0);
variable:dayprofit(0),accprofit(0);
up1 = bollingerband(Close[1], Length, 2);
down1 = bollingerband(Close[1], Length, -2 );
var: intrabarpersist _priceB(0) ,intrabarpersist _priceS(0);
if open < down1*1.01 then begin
if _priceB=0 then _priceB=close
else if _priceB<>0 and open < down1*1.01 then
_priceB =close;
value1=_priceB;
plot1(value1,"B");
end;
if open*1.01 > up1 then begin
if _priceS=0 then _priceS =close
else if _priceS<>0 and open*1.01 > up1 then
_priceS =close;
value2=_priceS;
plot2(value2,"S");
end;
1 評論