{N:=20;T:=10;}
M1:MA(C,N);
HPB:=REF(HHV(H,N),1);
LPB:=REF(LLV(L,T),1);
{多头交易}
BUYIN:=H>HPB AND C>M1;
BUYEXIT:=L<LPB;
SINGAL:=IF(BUYIN,1,IF(BUYEXIT,-1,0));
CURRSIGN:=REF(SINGAL,BARSLAST(SINGAL));
UPTREND:=CURRSIGN= 1;
DWTREND:=CURRSIGN=-1;
{跟踪止损}{股海网提供:www.guhai.com.cn}
空平:IF(DWTREND,HPB,DRAWNULL),COLORBLUE,LINETHICK2;
多止:IF(UPTREND,LPB,DRAWNULL),COLORRED,LINETHICK2;
信号持续:IF(DWTREND,BARSLAST(UPTREND),BARSLAST(DWTREND)),NODRAW,COLORMAGENTA;
DRAWICON(BARSLAST(DWTREND)=1,多止,7);
DRAWICON(BARSLAST(UPTREND)=1,空平,8);
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
{原文链接:http://www.guhai.com.cn/html/GS/tong-da-xin/13260.html} |