{K线上画成本\止损\跟进\突破的标记}
CHL:=(C+O+H+L)/4;{算术均价}
均价:=AMOUNT/VOL/100;
TEST:=((ABS(均价-CHL)/CHL) < 0.1);
{突破30天最高收盘价}
最高收盘价:=REF(HHV(C,30),1);
突破30:=REF(COUNT(C<最高收盘价,2)=2,1) AND C>最高收盘价 AND C>O;
STICKLINE(突破30,最高收盘价,C,1,0),COLORMAGENTA;
{成本位}
成本位:IF(TEST,均价,CHL),COLORWHITE,POINTDOT;{圆点};
{止损线}
止损位:=PEAK(1,3,1)*0.95;
止损条件:=RANGE(止损位,L,H) AND PEAKBARS(1,3,1)<=3;
STICKLINE(止损条件,止损位,止损位,1,0),COLORLIGREEN;
{跟进线}
跟进位:=TROUGH(2,3,1)*1.05;
跟进条件:=RANGE(跟进位,L,H) AND TROUGHBARS(2,3,1)<=3;
STICKLINE(跟进条件,跟进位,跟进位,1,0),COLORMAGENTA; |