請問我想在當 highd(0)-lowd(0)>=50時,黑k棒為實體長度>(上影線+下影線)且k棒最低價為當時最低價,定義此黑k棒的最高價及最低價,
若後面產生的黑k棒收盤價低於前實體長度>(上影線+下影線)的黑k棒的最低價於,改為定義此更低價之實體長度>(上影線+下影線)黑k棒的最高價及最低價~一般是移動停損停利~這有點像移動進場條件~
下列程式碼有時符合條件有時不符合~請問要怎麼改才恰當?
謝謝~~
if date<>date[1] then begin value1=barnumber; end;
kbar=barnumber-value1+1;
if marketposition=0 and low<=lowest(low,kbar)[1] and c<o and open-close>(h-o)+(c-l) then begin kh=high; kl=low; end;
if marketposition=0 and low<=lowest(low,kbar)[1] and c<o and open-close>(h-o)+(c-l) and close cross under kl then begin kh=high; kl=low; end;
if kbar>1 and kbar<50 and highd(0)-lowd(0)>=50 and close cross over kh then begin buy next bar at kh or lower; end;