咨詢內容:
請教: 序列模式下 for j=1 to barpos do begin drawline(barpos=。。,H,BARPOS=。。,L); end 然后再轉回逐K模式下 就畫不出來了。 怎樣把序列模式改正逐K模式?
金字塔客服:
代碼寫全
用戶回復:麻煩了 代碼有點長。。VARIABLE:aq1=0,aq2=0,aq3=0,a1=0,a2=0,a3=0,b1=0,b2=0,b3=0;variable:j=1,h1[2]=0,h2[2]=0,l2[2]=0;variable:qq1=0,qq2=0,qq3=0;for j=1 to barpos dobeginif h[j]<a3 and l[j]>b3 then beginendelsebeginif a1>0 and a2=0 thenbegina2:=h[j];b2:=l[j];aq2:=j;endif a1=0 and a2=0 thenbegina1:=h[j];b1:=l[j];aq1:=j;endelse begina1:=a2;b1:=b2;aq1:=aq2;a2:=a3;b2:=b3;aq2:=aq3;a3:=h[j];b3:=l[j];aq3:=j;endif (a2>a1 and a2>a3) or (a2=a1 and a2>a3) thenBEGINif h2[1]=0 thenBEGINqq3:=a2;h2[1]:=a2;h2[2]:=aq2;qq1:=l2[2];qq2:=h2[2];drawline(barpos=qq1,l2[1],barpos=qq2,h2[1],0),colorblue;end if h2[2]>l2[2] and a2>h2[1] thenBEGINqq3:=a2;h2[1]:=a2;h2[2]:=aq2;qq1:=l2[2];qq2:=h2[2];drawline(barpos=qq1,l2[1],barpos=qq2,h2[1],0),colorblue;end if h2[2]<l2[2] thenbeginqq3:=a2;h2[1]:=a2;h2[2]:=aq2;qq1:=l2[2];qq2:=h2[2];drawline(barpos=qq1,l2[1],barpos=qq2,h2[1],0),colorblue;endendif (b2<b1 and b2<b3) or (b2=b1 and b2<b3)thenBEGINif l2[1]=0 thenBEGINl2[1]:=b2;l2[2]:=aq2;qq1:=l2[2];qq2:=h2[2];drawline(barpos=qq2,h2[1],barpos=qq1,l2[1],0),colorblue;endif l2[2]>h2[2] and b2<l2[1] thenBEGINl2[1]:=b2;l2[2]:=aq2;qq1:=l2[2];qq2:=h2[2];drawline(barpos=qq2,h2[1],barpos=qq1,l2[1],0),colorblue;endif l2[2]<h2[2] thenBEGINl2[1]:=b2;l2[2]:=aq2;qq1:=l2[2];qq2:=h2[2];drawline(barpos=qq2,h2[1],barpos=qq1,l2[1],0),colorblue;endendendend