这个指标是MACD论坛A版的作品感觉还不错来给大家分享一下。
飞狐版
DRAWGBK((DATE > 0),COLORRGB(0,33,0),COLORRGB(0,33,0),1);
D_C:=INDEXC; D_H:=MA(INDEXH,3); D_L:=MA(INDEXL,3);
D_F:=if(INDEXC>ref(D_H,1),1,if(INDEXC<ref(D_L,1),-1,0));
for i=5+1 to datacount do begin
if D_C[i]>D_H[i-1] then
D_F[i]:=1
else if D_C[i]<D_L[i-1] then
D_F[i]:=-1
else
D_F[i]:=D_F[i-1];
end;
K1:=IF(D_F>0,-3,IF(D_F<0,1,0));
K2:=VALUEWHEN(K1<>0,K1);
G:=IF(K2<0,-30,0);
FILLRGN(K2<0,G,0),COLORBLUE;
FILLRGN(K2<0,-G,0),Color00B0A3;
{仿天狼剑2}
强:=FORCAST(IF((C-L=O-L),O,C),4);
弱:=(ref(c,1)+ref(c,2)+O)/3;
B_h1:=(O+C*3+L+H)/6;
B_h2:=REVERSE(B_h1)+2*WMA(B_h1,5);
B_h3:=3*B_h2-2*SMA(B_h2,2,1);
B_h4:=BARSLAST((强>弱)=1);
B_h5:=0-BARSLAST((强>弱)=0);
B_h6:=IF(B_h4>0,B_h4,B_h5);
B_h7:=(-1)*B_h6*10;
B_h8:=CROSS(强,弱)&&C>B_h3;
B_h9:=CROSS(弱,强)&&C<B_h3;
DRAWICON(CROSS(强,弱),B_h7,10),PXUP1;//进
STICKLINE(B_h8=0 and B_h7>0,0,B_h7,5,0),ColorFFA8FF,COLORMAGENTA;//持:
DRAWICON(B_h9,0,12),PXDN1;//减
STICKLINE(B_h9=0 and B_h7<=0,0,B_h7,5,0),Color009800;//空:
大盘强势区:IF(G,168,0),LINETHICK,Color00D9C5;
趋势:=4*SMA((C-LLV(L,5))/(HHV(H,5)-LLV(L,5))*10,5,1)-3*SMA(SMA((C-LLV(L,5))/(HHV(H,5)-LLV(L,5))*10,5,1),3.2,1);
N_2:=SMA(MAX(C-REF(C,4),0),2,1)/SMA(ABS(C-REF(C,4)),2,1)*100<10;//处女线
低位:=趋势<1.5 or N_2;
PARTLINE(1,0),COLORWHITE;
PARTLINE(低位,0),SHIFT1,LINETHICK2,COLORGREEN;
平滑:=sma(趋势,3,1);
有戏:if((平滑-ref(平滑,1))>=0,888,0),LINETHICK,COLORRED;
无戏:if((平滑-ref(平滑,1))<=0,666,0),LINETHICK,colorFFFF00;
//
(通达信版)
D_C:=INDEXC; D_H:=MA(INDEXH,3); D_L:=MA(INDEXL,3);
D_F:=IF(INDEXC>REF(D_H,1),1,IF(INDEXC<REF(D_L,1),-1,0));
K1:=IF(D_F>0,-3,IF(D_F<0,1,0));
KK:=IF(K1!=0,K1,DRAWNULL);
K2:=IF(K1!=0,K1,KK);
G:=IF(K2<0,-30,0);
STICKLINE(K2<0,G,0,5,0),COLOR666600;
STICKLINE(K2<0,-G,0,5,0),COLORRED;
{仿天狼剑2}
强:=FORCAST(IF((C-L=O-L),O,C),4);
弱:=(REF(C,1)+REF(C,2)+O)/3;
B_H1:=(O+C*3+L+H)/6;
WMA:=(5*B_H1+4*REF(B_H1,1)+3*REF(B_H1,2)+2*REF(B_H1,3)+1*REF(B_H1,4))/(5+4+3+2+1);
B_H2:=REVERSE(B_H1)+2*WMA;
B_H3:=3*B_H2-2*SMA(B_H2,2,1);
B_H4:=BARSLAST((强>弱)=1);
B_H5:=0-BARSLAST((强>弱)=0);
B_H6:=IF(B_H4>0,B_H4,B_H5);
B_H7:=(-1)*B_H6*10;
B_H8:=CROSS(强,弱)&&C>B_H3;
B_H9:=CROSS(弱,强)&&C<B_H3;
DRAWICON(CROSS(强,弱),B_H7,1);{进}
STICKLINE(B_H8=0 AND B_H7>0,0,B_H7,5,0),COLORFFA8FF,COLORMAGENTA;{持}
DRAWICON(B_H9,0,2);{减}
STICKLINE(B_H9=0 AND B_H7<=0,0,B_H7,5,0),COLOR009800;{空}
大盘强势区:IF(G,68,0),LINETHICK,COLOR00D9C5;
趋势:=4*SMA((C-LLV(L,5))/(HHV(H,5)-LLV(L,5))*10,5,1)-3*SMA(SMA((C-LLV(L,5))/(HHV(H,5)-LLV(L,5))*10,5,1),3.2,1);
N_2:=SMA(MAX(C-REF(C,4),0),2,1)/SMA(ABS(C-REF(C,4)),2,1)*100<10;{处女线}
低位:=趋势<1.5 OR N_2;
IF(低位,0,DRAWNULL),LINETHICK5,COLORGREEN;
平滑:=SMA(趋势,3,1);
有戏:IF((平滑-REF(平滑,1))>=0,88,0),LINETHICK,COLORRED;
无戏:IF((平滑-REF(平滑,1))<=0,66,0),LINETHICK,COLORFFFF00;
通达信版是由壹瓣杺埖改编。不过信号挺多的希望高手优化
|