請教高手, 找不到程式碼錯在哪? 正確的跟有問題的截圖如附件
Input: Length(12,"天數");
Input: Multiplier(3,"ATR倍數");
var:v1(99999),v2(0);
var:UpDn(true); //true = Up; false = Dn
//
if currentBar = 1 then begin
updn = true;
end;
if currentBar <> 1 then begin
if updn = true then
begin
if close > v1 then begin
updn = false;
v1 = 99999;
plot4(close-atr(length)*Multiplier);
end;
end
else
begin
if close < v2 then
begin
updn = true;
v2 = 0;
plot3(close+atr(length)*Multiplier);
end;
end;
end;
//
if updn = true then begin
value1 = close + atr(length)*Multiplier;
if v1 > value1 then v1 = value1;
plot1(v1);
end;
if updn = false then begin
value2 = close - atr(length)*Multiplier;
if v2 < value2 then v2 = value2;
plot2(v2);
end;
5 評論