通达信主升副图/选股预警公式源码少而精有参考价值
XA_1:=150;
XA_2:=3;
XA_3:=REF(HHV(HIGH,XA_1),XA_2);
XA_4:=REF(LLV(LOW,XA_1),XA_2);
XA_5:=XA_3-(XA_3-XA_4)*0.618;
XA_6:=REFDATE(XA_5,DATE);
XA_7:=BARSLASTCOUNT(CLOSE XA_6);
XA_8:=CROSS(CLOSE,XA_6);
XA_9:=XA_7
XA_10:=REF(XA_9,1);
买入:=XA_10 AND XA_8;
STICKLINE(买入,0,22,2,0),COLORYELLOW;
STICKLINE(买入,0,5,5,0),COLORFF7700;
STICKLINE(买入,0,5,4.5,0),COLORFF8800;
STICKLINE(买入,0,5,4,0),COLORFF9900;
STICKLINE(买入,0,5,3.5,0),COLORFFAA00;
STICKLINE(买入,0,5,3,0),COLORFFBB00;
STICKLINE(买入,0,5,2.5,0),COLORFFCC00;
STICKLINE(买入,0,5,2,0),COLORFFDD00;
DRAWTEXT_FIX(C O,0.01,0.01,0,'
STICKLINE(买入,0,5,1,0),COLORFFEE00;
STICKLINE(买入,0,15,4.5,0),COLOR102099;
STICKLINE(买入,0,15,4,0),COLOR1020AA;
STICKLINE(买入,0,15,3.5,0),COLOR1020BB;
STICKLINE(买入,0,15,3,0),COLOR1020CC;
STICKLINE(买入,0,15,2.5,0),COLOR1020DD;
STICKLINE(买入,0,15,2,0),COLOR1020EE;
STICKLINE(买入,0,15,1,0),COLORYELLOW;
DRAWTEXT(买入,25,14),COLORYELLOW;
DRAWTEXT_FIX(1,0.21,0.12,1,19),COLORYELLOW;
DRAWTEXT_FIX(1,0.41,0.12,1,18),COLORYELLOW;
DRAWTEXT(买入,20,'★主升'),COLORMAGENTA;