//======== stage3: 繪線段 ==========================================================================================
if plot_count = 0 then begin
x1 = K[KN] - offset;
y1 = min_price;
plot_count = plot_count + 1;
end
else begin
x2 = K[KN] - offset;
y2 = min_price;
//if(DEBUG) then Print("繪圖1 x1=",NumToStr(x1,0)," y1=",NumToStr(y1,2), "x2=",NumToStr(x2,0)," y2=",NumToStr(y2,2));
if x2 <> x1 then begin
Plotline(1, x1, y1, x2, y2,add:=1);
if(DEBUG) then Print("繪圖1 x1=",NumToStr(x1,0)," y1=",NumToStr(y1,2), "x2=",NumToStr(x2,0)," y2=",NumToStr(y2,2));
x1 = x2;
y1 = y2;
plot_count = plot_count + 1;
end
else begin //最高價與最低價相同 則不畫線
if (DEBUG) then Print("繪圖1:高低價同一根K: x1=",NumToStr(x1,0)," y1=",NumToStr(y1,2), "x2=",NumToStr(x2,0)," y2=",NumToStr(y2,2));
x1 = x2;
y1 = y2;
plot_count = plot_count + 1;
end;
end;
//========= end of stage3: 繪線段 ==========================================================================================
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
end
else begin //結束(右)邊界為跨入負價區, 則尋找區域內最高點(價)
pv_end = K[KN];
scope = pv_end-pv_start+1; //期數: 尾減投 加1
extremes(High, scope, 1, max_price, offset);
//if (DEBUG) then Print("KN=", NumToStr(K[KN]-offset,0)," 最高價=", NumToStr(max_price,2)," 期數=",NumToStr(scope,0)," offset=",NumToStr(offset,0));
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
20 評論