[問題] 求最低值
當在2012/12/24時,次畫面程式中的一個變數GREEN_P2_LOW 的值應是580 (2012/10/01),但卻顯示587 (2012/10/24),不知問題出在哪裡?
以下是次畫面程式的最後二行的程式碼
aalow:= llv(low,r2) colorwhite linethick0;
green_p2_low: ref(aalow,f2) colorwhite linethick0;
而於2012/12/24時,F2等於 43 , R2等於 25
故最低值應是580,而不是587才對
主畫面程式:
m5:=ma(c,5) colormagenta;
m10:=ma(c,10) colorcyan;
m21:=ma(c,21) colorred;
a1:=c>m5;
ff1:=m10<m21;
YY1:=a1 and not(ff1);
b1:=c<m5;
gg1:=m10>m21;
xx1:=b1 and not(gg1);
STICKLINE(c>=o,high, low, 0.1,1),colorGray;
STICKLINE(c>=o,close,open,8 ,1),colorGray;
STICKLINE(c< o,high, low, 0.1,1),colorGray;
STICKLINE(c< o,close,open,8 ,0),colorGray;
STICKLINE(c>=o AND YY1,high, low, 0.1,1),colorred;
STICKLINE(c>=o AND YY1,close,open,8 ,1),colorred;
STICKLINE(c< o AND YY1,high, low, 0.1,1),colorred;
STICKLINE(c< o AND YY1,close,open,8 ,0),colorred;
STICKLINE(c>=o AND xx1,high, low, 0.1,1),color009900;
STICKLINE(c>=o AND xx1,close,open,8 ,1),color009900;
STICKLINE(c< o AND xx1,high, low, 0.1,1),color009900;
STICKLINE(c< o AND xx1,close,open,8 ,0),color009900;
次畫面程式:
m5:=ma(c,5);
m10:=ma(c,10);
m21:=ma(c,21);
a1:=c>m5;
ff1:=m10<m21;
YY1:=a1 and not(ff1);
b1:=c<m5;
gg1:=m10>m21;
xx1:=b1 and not(gg1);
//
green_bar:=if(xx1,1,0);
red_bar:=if(not(xx1) and yy1,1,0);
red_cnt:=sumbars(red_bar,1) colorred linethick0;
green_cnt:=sumbars(green_bar,1) colorgreen linethick0;
ps1:=red_cnt>green_cnt and green_bar;
paint_green:backset(green_bar,red_cnt-1);
paint_red:=backset(red_bar,green_cnt-1);
green_end:=paint_green and not(refx(paint_green,1));
green_start:=paint_green and not(ref(paint_green,1));
//
green_1s:=sumbars(green_start,1) colorred linethick0;
green_1e:=sumbars(green_end,1) colorred linethick0;
green_2s:=sumbars(green_start,2) colorwhite linethick0;
green_2e:=sumbars(green_end,2) colorwhite linethick0;
green_3s:=sumbars(green_start,3) colorgreen linethick0;
green_3e:=sumbars(green_end,3) colorgreen linethick0;
//
green_u2s:=green_2s colorred linethick0;
green_u2e:=if(green_1s<green_1e,green_1e,green_2e) colorred linethick0;
green_u3s:=green_3s colorwhite linethick0;
green_u3e:=if(green_1s<green_1e,green_2e,green_3e) colorwhite linethick0;
f2: green_u2e-1 coloryellow linethick0;
r2: green_u2s-green_u2e+1 coloryellow linethick0;
aalow:= llv(low,r2) colorwhite linethick0;
green_p2_low: ref(aalow,f2) colorwhite linethick0;
|