通达信红色闪电副图指标公式源码

以下是通达信红色闪电副图指标公式源码:

DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2;
初始信号:=MACD>=REF(MACD,1)AND REF(MA(C,7),2)>MA(C,13) AND MA(C,7)>MA(C,13) AND MA(C,13)>MA(C,21) AND C>=MA(C,4)AND L<=MA(C,6)AND REF(C,1)<REF(O,1)*0.972 AND V<HHV(V,55)*0.38 AND C>O*1.0052 AND IF(CODELIKE('638'),0,1);
选股:FILTER(初始信号,2);
买入:=REF(C,BARSLAST(选股)),COLORYELLOW,NODRAW;止赢:=REF(C,BARSLAST(选股))*1.01,COLORYELLOW,NODRAW;最高:REF(H,BARSLAST(选股)-1),COLORFF00FF,NODRAW;止损:=REF(C,BARSLAST(选股))*0.97,COLORGREEN,NODRAW;收盘:=REF(C,BARSLAST(选股)-1),COLORFF00FF,NODRAW;涨幅:=(REF(C,BARSLAST(选股)-1)/买入-1)*100;
信号周期:=BARSLAST(选股),COLORYELLOW,NODRAW;
成绩:=(最高/买入-1)*100,COLORRED,NODRAW;STICKLINE(REF(选股,1) ,0,0.50,2,0),COLORGREEN;STICKLINE(REF(选股,1) AND 最高/买入>=1.01,0,0.50,2,0),COLORRED;DRAWICON(REF(选股,1) AND 成绩>=1,0.68,5);DRAWICON(REF(选股,1) AND 成绩<1,0.68,4);
DRAWNUMBER(REF(选股,1),0.85,成绩),COLORYELLOW;DRAWTEXT(REF(选股,1),0.8,' %'),COLORYELLOW;区间涨幅:=ROUND2((C/买入-1)*100,2),COLORWHITE,NODRAW;
DRAWTEXT_FIX(C>0,0.12,0.1,0,'止赢:')COLORRED;
DRAWTEXT_FIX(C>0,0.16,0.1,0,STRCAT(VAR2STR(止赢,2),' ')),COLORRED,LINETHICK2;
DRAWTEXT_FIX(C>0,0.21,0.1,0,'止损:')COLORGREEN;
DRAWTEXT_FIX(C>0,0.25,0.1,0,STRCAT(VAR2STR(止损,2),' ')),COLORGREEN,LINETHICK2;
DRAWTEXT_FIX(C>0,0.30,0.1,0,'收盘:')COLORWHITE;
DRAWTEXT_FIX(C>0,0.34,0.1,0,STRCAT(VAR2STR(C,2),' ')),COLORWHITE,LINETHICK2;
DRAWTEXT_FIX(C>0,0.03,0.1,0,'买入:')COLORYELLOW;
DRAWTEXT_FIX(C>0,0.07,0.1,0,STRCAT(VAR2STR(买入,2),' ')),COLORYELLOW,LINETHICK2;
DRAWTEXT_FIX(C>0,0.03,0.3,0,'T+1成绩:')COLORRED;
DRAWTEXT_FIX(C>0,0.10,0.3,0,STRCAT(VAR2STR(成绩,2),'%')),COLORRED,LINETHICK2;
DRAWTEXT_FIX(C>0,0.17,0.3,0,'T+1涨幅:')COLORFFFF00;
DRAWTEXT_FIX(C>0,0.24,0.3,0,STRCAT(VAR2STR(涨幅,2),'%')),COLORFFFF00,LINETHICK2;
DRAWTEXT_FIX(C>0,0.30,0.3,0,'区间涨幅: ')COLORWHITE,LINETHICK2;
DRAWTEXT_FIX(C>0,0.37,0.3,0,STRCAT(VAR2STR(区间涨幅,2),'%')),COLORWHITE,LINETHICK2;