主图:
LB:=20; {定义回溯周期} LLV_LOW:=LLV(C, LB); {最低点} HHV_HIGH:=HHV(C, LB); {最高点} MID_POINT:= (HHV_HIGH + LLV_LOW) / 2; {杯底中点} LEFT_CUP:=CROSS(C, MID_POINT); {杯左边} RIGHT_CUP:=REF(CROSS(C, MID_POINT), -BARSLAST(LEFT_CUP)); {杯右边} HANDLE_HIGH:=REF(HHV(C, 10), -BARSLAST(RIGHT_CUP)); {把手最高点} HANDLE:=CROSS(C, HANDLE_HIGH); {把手} DRAWTEXT(LEFT_CUP, C, 'CUP'), COLORGREEN; DRAWTEXT(HANDLE, C, 'HANDLE'), COLORRED;
******************************************************************************************
选股公式:
最高:=REF(HHV(H,20),1); Q:=H<最高 AND H>=最高*0.9; AA:=V; BB:=FINANCE(7); HS:=AA*10000/BB; MM:=(HS-REF(HS,1))/REF(HS,1)>=0.5; NN:=DYNAINFO(17)>1.5; 杯子:Q AND C>O AND NN AND MM;