午夜视频在线网站,日韩视频精品在线,中文字幕精品一区二区三区在线,在线播放精品,1024你懂我懂的旧版人,欧美日韩一级黄色片,一区二区三区在线观看视频

分享

公式,不知有用沒有

 冷蕊 2010-03-22

 

{MACD+KD}
DIFF : EMA(CLOSE,12) - EMA(CLOSE,26);
DEA  : EMA(DIFF,9);
MACD : 2*(DIFF-DEA), COLORSTICK;
D1:=EMA(C,3)-EMA(C,8);
D2:=EMA(O,3)-EMA(O,8);
D3:=EMA(H,3)-EMA(H,8);
D4:=EMA(L,3)-EMA(L,8);
DRAWICON(cross(d1,diff) and diff<-0.05 ,d4-0.1,10);
DRAWICON(cross(diff,d1) and diff>0.1 ,d3+0.1,12);
STICKLINE(D1>=D2,D1,D2,8,0),COLOR0055AA;
STICKLINE(D1<=D2,D1,D2,8,0),COLOR006600;
STICKLINE(D1>=D2,D1,D2,5,0),COLOR0077CC;
STICKLINE(D1>=D2,D1,D2,3,0),COLOR0099DD;
STICKLINE(D1>=D2,D3,D4,0,0),COLOR00BBFF;
STICKLINE(D1<=D2,D1,D2,5,0),COLOR009900;
STICKLINE(D1<=D2,D1,D2,3,0),COLOR00BB00;
STICKLINE(D1<=D2,D3,D4,0,0),COLOR00EE00;



{MACD+KD解盤}
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA :=EMA(DIFF,9);
MACD:2*(DIFF-DEA), COLORSTICK;
MAC := DIFF>ref(DIFF ,1);
DIF:2*DIFF;
Var1:=EMA(CLOSE,34)-EMA(CLOSE,5);
Var2:=EMA(Var1,5);
趨勢:=(-3)*(Var1-Var2);
趨勢,colorred;
長期趨勢:EMA(Var1,10)*(-1);
Jm:=CROSS(DIFF,DEA)*0.2;
JmCount:=COUNT(Jm=0.2,BARSLAST(DEA>0));

DRAWTEXT(DEA<0 AND Jm=0.2,Jm,'0軸下第'),colorgreen;
DRAWNUMBER(DEA<0 AND Jm=0.2,0,JmCount,0),coloryellow;
DRAWTEXT(DEA<0 AND Jm=0.2,0,'   次金叉'),coloryellow;
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
DRAWTEXT(CROSS(K,D)AND(COUNT(VOL>REF(VOL,1),30)>3AND(VOL/CAPITAL<=(10/100)))
        AND((K<=20 AND D<=20)) ,0.40,
        '短線KD金叉'),COLORYELLOW;
DRAWTEXT(CROSS(K,D)AND(COUNT(VOL>REF(VOL,1),30)>3AND
       (VOL/CAPITAL<=(10/100)))AND(BARSLAST(CROSS(K,D)AND(COUNT(VOL>REF(VOL,1),30)>3
        AND(VOL/CAPITAL<=(10/100)))AND((K<=20 AND D<=20)))>=1)AND(BARSLAST(CROSS(k,D)
        AND(COUNT(VOL>REF(VOL,1),30)>3AND(VOL/CAPITAL<=(10/100)))AND((K<=30 AND D<=20)))<=7) ,0.40,
       '短線KD二次金叉'),Color00FFFF,LINETHICK2,ALIGN2;
b:=CROSS(D,K) AND K>60 AND D>60;
b1:=COUNT(b,BARSLAST( D<60));
DRAWTEXT(b AND b1=1,0.50, '短線KD死叉'),ColorFFFFFF,LINETHICK2,ALIGN2;
DRAWTEXT(b AND b1=2,0.70, '短線KD二次死叉'),ColorFFFFFF,LINETHICK2,ALIGN2;

{MACD背離}

input.:n(1,0.1,100);
dif:=stkindi('','macd.diff',0,6);
fz1:=PEAKBARSA(dif*17,1,1);
fz2:=PEAKBARSA(dif*17,1,2);
v1:=fz1=1 and ref(dif,fz1)>ref(dif,fz2) and ref(c,fz1)<ref(c,fz2);
v2:=fz1=1 and ref(dif,fz1)<ref(dif,fz2) and ref(c,fz1)>ref(c,fz2);
頂背離:STICKLINE(v1 or v2,0,1,3,0.1),colorffff54;
dz1:=TROUGHBARSA(dif*17,1,1);
dz2:=TROUGHBARSA(dif*17,1,2);
v3:=dz1=1 and ref(dif,dz1)>ref(dif,dz2) and ref(c,dz1)<ref(c,dz2);
v4:=dz1=1 and ref(dif,dz1)<ref(dif,dz2) and ref(c,dz1)>ref(c,dz2);
底背離:STICKLINE(v3 or v4,0,1,3,0.1),color5454ff;



{MACD選股}
input.:n(5,2,1000);
diff:=stkindi('','macd.diff',0,6);
dea:=stkindi('','macd.dea',0,6);
MACD:=stkindi('','macd.MACD',0,6);
T1:=REF(C,2)<REF(O,2) AND REF(C,2)<REF(C,3) AND C>O AND C>REF(C,1);
T2:=DIFF>DEA AND REF(MACD,1)<REF(MACD,2) AND REF(MACD,2)<REF(MACD,3);
T3:=DIFF<REFX(DIFF,1) AND REFX(DIFF,1)<REFX(DIFF,2);

{超級疊加MACD}


DIFF : EMA(CLOSE,12) - EMA(CLOSE,26);
DEA : EMA(DIFF,9);
MACD : 2*(DIFF-DEA), COLORSTICK;
D1:=EMA(C,3)-EMA(C,8);
D2:=EMA(O,3)-EMA(O,8);
D3:=EMA(H,3)-EMA(H,8);
D4:=EMA(L,3)-EMA(L,8);
DRAWICON(cross(d1,diff) and diff<-0.05 ,d4-0.1,1);
DRAWICON(cross(diff,d1) and diff>0.1 ,d3+0.1,2);
STICKLINE(D1>=D2,D1,D2,8,0),COLOR0055AA;
STICKLINE(D1<=D2,D1,D2,8,0),COLOR006600;
STICKLINE(D1>=D2,D1,D2,5,0),COLOR0077CC;
STICKLINE(D1>=D2,D1,D2,3,0),COLOR0099DD;
STICKLINE(D1>=D2,D3,D4,0,0),COLOR00BBFF;
STICKLINE(D1<=D2,D1,D2,5,0),COLOR009900;
STICKLINE(D1<=D2,D1,D2,3,0),COLOR00BB00;
STICKLINE(D1<=D2,D3,D4,0,0),COLOR00EE00;


{超前MACD}
aaa:=(C-MA(CLOSE,13))*100;
j值A(chǔ):EMA(MA(aaa,7),1),COLOR00ffff,PRECISION1;
j值B:EMA(j值A(chǔ),7),COLORff33ff,PRECISION1;
macd:(j值A(chǔ)-j值B)*2,COLORSTICK;
tj:=(j值A(chǔ)>j值B);
tj1:=(j值A(chǔ)>0);
PARTLINE(tj,j值A(chǔ)),colormagenta,linethick2;

partline(tj1 and tj,j值A(chǔ)),colorred,linethick2;
tj2:=j值A(chǔ)<-1 and j值A(chǔ)<j值B and macd<-1;
partline(tj2,j值A(chǔ)),colorblue,linethick2;


{超前MACD1}
DIFF:=(C-MA(CLOSE,13))*100;
AA:EMA(MA(DIFF,7),1),COLOR00ffff;
BB:EMA(AA,7),COLORff33ff;
MACD: (AA-BB)*2,COLORSTICK;


DEA  : EMA(DIFF,9);
MACD : 2*(DIFF-DEA), COLORSTICK;
s1:=MACD<ref(MACD,1)and MACD>0;
s2:=MACD<ref(MACD,1)/2 and MACD<0;
STICKLINE(MACD>=0,MACD,ref(MACD,2),1,1),COLORRED;
STICKLINE(s1,ref(MACD,2),MACD,1,1),COLOR00ffff;
STICKLINE(s2,ref(MACD,2),MACD,1,0),ColorFF0091;
STICKLINE(MACD>ref(MACD,2)and MACD<0,ref(MACD,1),MACD,1,1),COLORffff00;
s3:=BARSLAST(cross(diff,dea));
s4:=ref(s3,s3+1);
s5:=dea>ref(dea,s4);
s6:=dea<ref(dea,s4);
上成立:=cross(diff,dea) and s5;
下成立:=cross(diff,dea) and s6;
L1:=(EMA(CLOSE,3) - EMA(CLOSE,13));
L2:=EMA(L1,9);
L3:=BARSLAST(cross(L1,L2));
L4:=ref(L3,L3+1);
L5:=L2<ref(L2,L4);
變盤:cross(L1,L2) and L5,LINETHICK0,ColorD6FF9C;
STICKLINE(變盤,0.1,-0.1,2,1),ColorD6FF9C;
成立距今:BARSLAST(cross(diff,dea)),LINETHICK0;
L6:=BARSCOUNT(CLOSE);
DRAWICON(CROSS(L1,L2),DIFF,4);
DRAWICON(CROSS(L2,L1),DIFF,5);
ref(dea,s3),POINTDOT,COLORGREEN;{時(shí)間之窗}
IF(L1>L2,ref(dea,s3),0),POINTDOT,ColorB078FF;
IF(MACD<0,ref(dea,s3),0),POINTDOT,COLORGREEN;
VERTLINE(上成立),Color9D60FF;
VERTLINE(下成立),ColorFF0043;
VERTLINE(變盤),ColorD6FF9C;


{芳香MACD}

DIFF : EMA(CLOSE,SHORT) - EMA(CLOSE,LONG);
DEA  : EMA(DIFF,M);
MACD1 : 3*DIFF-2*DEA;
MACD2 : 2*(DIFF-DEA), COLORSTICK


{好看的MACD}


DIFF : EMA(CLOSE,12) - EMA(CLOSE,26),LINETHICK0;
DEA  : EMA(DIFF,9);
MACD : 2*(DIFF-DEA),LINETHICK0;
PARTLINE(DIFF>REF(DIFF,1),DIFF),COLORRED;
PARTLINE(DIFF<REF(DIFF,1),DIFF),COLORGREEN;
STICKLINE(MACD>REF(MACD,1) AND MACD>0,MACD,0,8,0),COLOR0000AA;
STICKLINE(MACD>REF(MACD,1) AND MACD>0,MACD,0,5,0),COLOR0000CC;
STICKLINE(MACD>REF(MACD,1) AND MACD>0,MACD,0,2.5,0),COLOR0000DD;
STICKLINE(MACD<REF(MACD,1) AND MACD>0,MACD,0,8,0),COLOR0000AA;
STICKLINE(MACD<REF(MACD,1) AND MACD>0,MACD,0,5,0),COLOR0077FF;
STICKLINE(MACD<REF(MACD,1) AND MACD>0,MACD,0,3,0),COLOR00FFFF;

STICKLINE(MACD>REF(MACD,1) AND MACD<0,MACD,0,8,0),COLORFF9900;
STICKLINE(MACD>REF(MACD,1) AND MACD<0,MACD,0,5,0),COLORFFBB00;
STICKLINE(MACD>REF(MACD,1) AND MACD<0,MACD,0,3,0),COLORFFFF00;
STICKLINE(MACD<REF(MACD,1) AND MACD<0,MACD,0,8,0),COLORFF0000;
STICKLINE(MACD<REF(MACD,1) AND MACD<0,MACD,0,5,0),COLORFF4400;
STICKLINE(MACD<REF(MACD,1) AND MACD<0,MACD,0,3,0),COLORFF8800;


{量價(jià)MACD}
OBV:=MA(SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),0)/25000,1);
DIFF : EMA(obv,12) - EMA(obv,26),COLORYELLOW,LINETHICK2;
DEA : EMA(DIFF,9)COLORGREEN;
MACD : 2*(DIFF-DEA), ;
STICKLINE(MACD>0,0,MACD,8,1),COLORRED;
STICKLINE(MACD<0,0,MACD,8,1),COLORCYAN;

PARTLINE(DIFF>DEA,DIFF),COLORff11cc,LINETHICK2;
PARTLINE(DIFF>DEA AND DIFF<0,DIFF),COLORred,LINETHICK2;
DRAWICON(CROSS(DIFF,DEA),DIFF-0.01,6);
DRAWICON(CROSS(DEA,DIFF),DIFF,5);

MA10:MA(C,10)coloryellow;
POLYLINE(C,MA(C,20)) color999999;
MA30:MA(C,30)colorgreen;
POLYLINE(C,MA(C,45)) color999999;
MA60:MA(C,60)colormagenta;
POLYLINE(C,MA(C,90)) color999999;
MA120:MA(C,120)colorcyan;
POLYLINE(C,MA(C,150)) color999999;
POLYLINE(C,MA(C,180)) color999999;
POLYLINE(C,MA(C,210)) color999999;
MA250:MA(C,250)colorred;
VK:=SQRT(VOL/CAPITAL*100*5);
STICKLINE(C>=O,H,L,0,0) COLORred;
STICKLINE(C>=O,C,O,VK+3.8,0) COLORred;
STICKLINE(C< O,H,L,0,0) COLORgreen;
STICKLINE(C< O,C,O,VK+3.8,0) COLORgreen;
EXPLAIN((MA5>MA10 and MA10>MA30 and MA5>MA30),'解:短期均線排列:多頭')COLORred;
EXPLAIN((MA5<MA10 and MA10<MA30 and MA5<MA30),'解:短期均線排列:空頭');
EXPLAIN((MA30>MA60 and MA30>MA120 and MA60>MA120),'解:中期均線排列:多頭');
EXPLAIN((MA30<MA60 and MA30<MA120 and MA60<MA120),'解:中期均線排列:空頭');
EXPLAIN((MA60>MA120 and MA120>MA250 and MA60>MA250),'解:長期均線排列:多頭');
EXPLAIN((MA60<MA120 and MA120<MA250 and MA60<MA250),'解:長期均線排列:空頭');
EXPLAIN((CROSS(MA5,MA10)),'解:短期均線5x10:金叉')COLORred;
EXPLAIN((CROSS(MA10,MA5)),'解:短期均線5x10:死叉');
EXPLAIN((CROSS(C,MA120)),'解:今日股價(jià)上穿半年線');
EXPLAIN((CROSS(MA120,C)),'解:今日股價(jià)跌破半年線');
EXPLAIN((CROSS(C,MA250)),'解:今日股價(jià)上穿一年線');
EXPLAIN((CROSS(MA250,C)),'解:今日股價(jià)跌破一年線');
EXPLAIN((CROSS(C,MA60) and CROSS(C,MA120) and CROSS(C,MA250)),'解:股價(jià)一陽上穿三線');
EXPLAIN((MA30>REF(MA30,1)),'解:30日均線趨勢:向上');
EXPLAIN((MA30>REF(MA30,1) AND MA30<REF(MA30,1)*1.001),'解:30日均線趨勢:走平');
EXPLAIN((MA30<REF(MA30,1)),'解:30日均線趨勢:向下');
EXPLAIN((MA5>REF(MA5,1)*1.015),'解:5日均線:強(qiáng)勁向上');
EXPLAIN((MA5>REF(MA5,1) AND MA5<REF(MA5,1)*1.005),'解:5日均線:方向不明');
EXPLAIN((MA5<REF(MA5,1)*0.985),'解:5日均線:快速向下');
DIFF:=EMA(C,5)-EMA(C,20);
DEA:=EMA(DIFF,10);
MACD:=2*(DIFF-DEA);
JC:=CROSS(DIFF,DEA);
SC:=CROSS(DEA,DIFF);
DCJC:=JC AND DEA>0;
EXPLAIN((JC AND DEA>0),'解:MACD在0軸上金叉')COLORred;
EXPLAIN((JC AND DEA<0),'解:MACD在0軸下金叉');
EXPLAIN((SC AND DEA>0),'解:MACD在0軸上死叉');
EXPLAIN((SC AND DEA<0),'解:MACD在0軸下死叉');
EXPLAIN((MACD>0 AND MACD>REF(MACD,1)),'解:MACD的紅柱:增長');
EXPLAIN((MACD>0 AND MACD<REF(MACD,1)),'解:MACD的紅柱:縮短');
EXPLAIN((MACD<0 AND ABS(MACD)>REF(ABS(MACD),1)),'解:MACD的綠柱:增長');
EXPLAIN((MACD<0 AND ABS(MACD)<REF(ABS(MACD),1)),'解:MACD的綠柱:縮短');
EXPLAIN((COUNT(DCJC,20)=2 AND JC AND DEA>0),'解:0軸上金叉次數(shù):2')COLORredCOLORred;
EXPLAIN((COUNT(DCJC,20)=3 AND JC AND DEA>0),'解:0軸上金叉次數(shù):3');
EXPLAIN((COUNT(DCJC,20)=4 AND JC AND DEA>0),'解:0軸上金叉次數(shù):4');
EXPLAINICON(HIGH>=HHV(HIGH,20), 'MyBMP');
EM5:EMA(C,5) colorwhite;
EM10:EMA(C,10)coloryellow;
POLYLINE(C,EMA(C,20)) color999999;
EM30:EMA(C,30)colorgreen;
POLYLINE(C,EMA(C,45)) color999999;
EM60:EMA(C,60)colormagenta;
POLYLINE(C,EMA(C,90)) color999999;
EM120:EMA(C,120)colorcyan;
POLYLINE(C,EMA(C,150)) color999999;
POLYLINE(C,EMA(C,180)) color999999;
POLYLINE(C,EMA(C,210)) color999999;
EM250:EMA(C,250)colorred;
FILLRGN(EMA(C,5)>EMA(C,10),EMA(C,5),EMA(C,10))COLOR6699FF;
FILLRGN(EMA(C,5)<EMA(C,10),EMA(C,5),EMA(C,10))COLORFF6666;
{VK:=SQRT(VOL/CAPITAL*100*5);}
STICKLINE(C>=O,H,L,0,0) COLORred;
STICKLINE(C>=O,C,O,VK+3.8,0) COLORred;
STICKLINE(C< O,H,L,0,0) COLORgreen;
STICKLINE(C< O,C,O,VK+3.8,0) COLORgreen;
EXPLAIN((EM5>EM10 and EM10>EM30 and EM5>EM30),'解:短期均線排列:多頭');
EXPLAIN((EM5<EM10 and EM10<EM30 and EM5<EM30),'解:短期均線排列:空頭');
EXPLAIN((EM30>EM60 and EM30>EM120 and EM60>EM120),'解:中期均線排列:多頭');
EXPLAIN((EM30<EM60 and EM30<EM120 and EM60<EM120),'解:中期均線排列:空頭');
EXPLAIN((EM60>EM120 and EM120>EM250 and EM60>EM250),'解:長期均線排列:多頭');
EXPLAIN((EM60<EM120 and EM120<EM250 and EM60<EM250),'解:長期均線排列:空頭');
EXPLAIN((CROSS(EM5,EM10)),'解:短期均線5x10:金叉');
EXPLAIN((CROSS(EM10,EM5)),'解:短期均線5x10:死叉');
EXPLAIN((CROSS(C,EM120)),'解:今日股價(jià)上穿半年線');
EXPLAIN((CROSS(EM120,C)),'解:今日股價(jià)跌破半年線');
EXPLAIN((CROSS(C,EM250)),'解:今日股價(jià)上穿一年線');
EXPLAIN((CROSS(EM250,C)),'解:今日股價(jià)跌破一年線');
EXPLAIN((CROSS(C,EM60) and CROSS(C,EM120) and CROSS(C,EM250)),'解:股價(jià)一陽上穿三線');
EXPLAIN((EM30>REF(EM30,1)),'解:30日均線趨勢:向上');
EXPLAIN((EM30>REF(EM30,1) AND EM30<REF(EM30,1)*1.001),'解:30日均線趨勢:走平');
EXPLAIN((EM30<REF(EM30,1)),'解:30日均線趨勢:向下');
EXPLAIN((EM5>REF(EM5,1)*1.015),'解:5日均線:強(qiáng)勁向上');
EXPLAIN((EM5>REF(EM5,1) AND EM5<REF(EM5,1)*1.005),'解:5日均線:方向不明');
EXPLAIN((EM5<REF(EM5,1)*0.985),'解:5日均線:快速向下');
EXPLAIN((JC AND DEA>0),'解:MACD在0軸上金叉');
EXPLAIN((JC AND DEA<0),'解:MACD在0軸下金叉');
EXPLAIN((SC AND DEA>0),'解:MACD在0軸上死叉');
EXPLAIN((SC AND DEA<0),'解:MACD在0軸下死叉');
EXPLAIN((MACD>0 AND MACD>REF(MACD,1)),'解:MACD的紅柱:增長');
EXPLAIN((MACD>0 AND MACD<REF(MACD,1)),'解:MACD的紅柱:縮短');
EXPLAIN((MACD<0 AND ABS(MACD)>REF(ABS(MACD),1)),'解:MACD的綠柱:增長');
EXPLAIN((MACD<0 AND ABS(MACD)<REF(ABS(MACD),1)),'解:MACD的綠柱:縮短');
EXPLAIN((COUNT(DCJC,20)=2 AND JC AND DEA>0),'解:0軸上金叉次數(shù):2');
EXPLAIN((COUNT(DCJC,20)=3 AND JC AND DEA>0),'解:0軸上金叉次數(shù):3');
EXPLAIN((COUNT(DCJC,20)=4 AND JC AND DEA>0),'解:0軸上金叉次數(shù):4');


{世志MACD}
{M:1 100 26 M1:1 100 3  M2: 1 100 3}
Var1:=(CLOSE-LLV(LOW,m))/(HHV(HIGH,m)-LLV(LOW,m))*100-50,LINETHICK3;
K:SMA(Var1,m1,1),LINETHICK2,COLORFFFFAA;
D:SMA(K,m2,1),LINETHICK2,COLORBLUE;
MACD: 2*(K-D),LINETHICK3, COLORSTICK;
VAR2:=(CLOSE-LLV(LOW,85))/(HHV(HIGH,85)-LLV(LOW,85))*100-50,LINETHICK3;
底: SMA(Var2,5,1),COLOR9900FF,LINETHICK3;
45;
上:40,POINTDOT,COLORRED,LINETHICK3;
中:0,LINETHICK2,POINTDOT;
下:-40,LINETHICK3,POINTDOT,COLORGREEN;
-45;



DEA:EMA(DIFF,M),COLORYELLOW;
MACD: 2*(DIFF-DEA),COLORSTICK;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,2,0),COLORYELLOW;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,2,0),COLORwhite;
PARTLINE(DIFF<DEA,DIFF),COLORGREEN;




{MACD疊加K線}


DIFF : EMA(CLOSE,12) - EMA(CLOSE,26);
DEA  : EMA(DIFF,9),colorred;
MACD : 2*(DIFF-DEA), COLORSTICK;
D1:=EMA(C,3)-EMA(C,8);
D2:=EMA(O,3)-EMA(O,8);
D3:=EMA(H,3)-EMA(H,8);
D4:=EMA(L,3)-EMA(L,8);
DRAWICON(cross(d1,diff) and diff<-0.05 ,d4-0.1,1);
DRAWICON(cross(diff,d1) and diff>0.1 ,d3+0.1,2);
STICKLINE(D1>=D2,D1,D2,7,0),COLORMAGENTA;
STICKLINE(D1<=D2,D1,D2,7,0),COLORGREEN;

{MACD多空趨勢}
A:EMA((CLOSE-ref(c,1))/ref(c,1)*10-(INDEXC-ref(INDEXC,1))/ref(INDEXC,1)*10,5)LINETHICK0;
STICKLINE(A>0,0,A,1,2),LINETHICK3,COLORred;
STICKLINE(A<0,0,A,1,2),LINETHICK2,COLORyellow;
HSNP1:=CLOSE-REF(CLOSE,1);
HSNP2:=IF(CLOSE-REF(CLOSE,1)>=0,HSNP1,0);
HSNP3:=REF(CLOSE,1)-CLOSE;
HSNP4:=IF(CLOSE-REF(CLOSE,1)<=0,HSNP3,0);
HSNP5:=SUM(HSNP2,90)/SUM(HSNP4,90);
HSNP6:=100-100/(1+HSNP5);
HSNP7:=EMA(HSNP6,21);
HSNP8:=EMA(HSNP7,5);
HSNP:=EMA(HSNP7,3);
np:= (HSNP7-HSNP);
nl:=(HSNP-HSNP7);
STICKLINE(np>0,0,np,1,2),COLORff00ff;  
STICKLINE(np<0,0,np,1,2),COLORcyan;  
JJ :=(C*2+H+L)/4;
SK := EMA(JJ,13) - EMA(JJ,21);
SD := EMA(SK,3);
SP := EMA(SK,10);
長線1:IF(SD>=SP,SD,SP),LINETHICK2;
長線2:IF(SP-SD,SP,SD),LINETHICK2;
A1:=EMA(CLOSE,7)-EMA(CLOSE,21);
B1:=EMA((0.668*REF(A1,1)+0.333*A1),1);
做多:IF(A1>=B1,A1,B1),LINETHICK2,colorred;
做空:IF(B1-A1,B1,A1),LINETHICK2;

DEA  : EMA(DIFF,9);
MACD : 2*(DIFF-DEA), COLORSTICK;
D1:=EMA(C,3)-EMA(C,8);
D2:=EMA(O,3)-EMA(O,8);
D3:=EMA(H,3)-EMA(H,8);
D4:=EMA(L,3)-EMA(L,8);
DRAWICON(cross(d1,diff) and diff<0 ,d4-0.1,10);
STICKLINE(D1>=D2,D1,D2,8,0),COLOR0055AA;
STICKLINE(D1<=D2,D1,D2,8,0),COLOR006600;
STICKLINE(D1>=D2,D1,D2,5,0),COLOR0077CC;
STICKLINE(D1>=D2,D1,D2,3,0),COLOR0099DD;
STICKLINE(D1>=D2,D3,D4,0,0),COLOR00BBFF;
STICKLINE(D1<=D2,D1,D2,5,0),COLOR009900;
STICKLINE(D1<=D2,D1,D2,3,0),COLOR00BB00;
STICKLINE(D1<=D2,D3,D4,0,0),COLOR00EE00;




{MACD交易}
DIFF: EMA(CLOSE,12) - EMA(CLOSE,26),COLORYELLOW,LINETHICK2;
DEA1:=EMA(DIFF,9);0.10;
MACD: 2*(DIFF-DEA1),LINETHICK0;
STICKLINE(MACD>0,0,MACD,8,1),COLORRED;
STICKLINE(MACD<0,0,MACD,8,1),COLORCYAN;
DEA: EMA(DIFF,9),COLORGREEN;
PARTLINE(DIFF>DEA,DIFF),COLORff11cc,LINETHICK2;
PARTLINE(DIFF>DEA AND DIFF<0,DIFF),COLORred,LINETHICK2;
DRAWICON(CROSS(DIFF,DEA),DIFF-0.01,6);
DRAWICON(CROSS(DEA,DIFF),DIFF,11);
V1:=EMA(EMA(CLOSE,n),n);
V2:=100*WINNER(CLOSE*0.95);
控盤力度:(V1-REF(V1,1))/REF(V1,1)*10,colorwhite,LINETHICK1;
無莊控盤:IF(控盤力度<0,控盤力度,0),LINETHICK2,COLOR00ff00,STICK;
有莊控盤:IF(控盤力度>REF(控盤力度,1) AND 控盤力度>0,控盤力度,0),LINETHICK2,COLORff00ff,STICK;
主力減倉:IF(控盤力度< REF(控盤力度,1) AND 控盤力度>0,控盤力度,0),LINETHICK2,COLOrBLUE,STICK;
高度控盤:IF(V2>50 AND COST(85)< CLOSE AND 控盤力度>0,控盤力度,0),LINETHICK2,COLORRED,STICK;
開始控盤:IF(CROSS(控盤力度,0),0.2,0),LINETHICK2,COLORFF00FF;
Var1:=EMA(CLOSE,34)-EMA(CLOSE,5);
Var2:=EMA(Var1,5);
趨勢:=(-3)*(Var1-Var2), COLORSTICK;
趨勢,colorred;
長期趨勢:EMA(Var1,10)*(-1);
EXPLAIN(趨勢>0,'Z線趨勢上升中\(zhòng)\\\');
EXPLAIN(趨勢<0,'Z線趨勢下降中\(zhòng)\\\');
EXPLAIN(cross(趨勢,0),'Z線考慮買入\\\\');
EXPLAIN(cross(0,趨勢),'Z線考慮賣出\\\\');
Var11:=ma((v/(h-l)),4);
Var33:=abs(c-o);
Var44:=v/(h-l);
EXPLAIN(Var44<var11 AND Var33<ma(Var33,4),'資金無入場意愿,萎縮中\(zhòng)\\\');
EXPLAIN(Var44<var11 AND Var33>ma(Var33,4),'場內(nèi)資金運(yùn)作行為\\\\');
EXPLAIN(Var44>var11 AND Var33<ma(Var33,4),'多空雙方激烈爭奪中\(zhòng)\\\');
EXPLAIN(Var44>var11 AND Var33>ma(Var33,4),'場外資金介入(或出局)意愿強(qiáng)烈\\\\');
TR := SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),14);
HD := HIGH-REF(HIGH,1);
LD := REF(LOW,1)-LOW;
DMP:= SUM(IF(HD>0 AND HD>LD,HD,0),14);
DMM:= SUM(IF(LD>0 AND LD>HD,LD,0),14);
PDI:= DMP*100/TR;
MDI:= DMM*100/TR;
ADX:= MA(ABS(MDI-PDI)/(MDI+PDI)*100,6);
ADXR:=(ADX+REF(ADX,6))/2;
EXPLAIN(cross(pdi,mdi),'PDI線從下向上突破MDI線,顯示有新多頭進(jìn)場,為買進(jìn)信號\\\\');
EXPLAIN(cross(mdi,pdi),'PDI線從上向下跌破MDI線,顯示有新空頭進(jìn)場,為賣出信號\\\\');
EXPLAIN(adx>ref(adx,1),'ADX值持續(xù)高于前一日,行情將維持原趨勢\\\\');
EXPLAIN(adx<ref(adx,1) and adx<20,'ADX值遞減,降到20以下,且橫向行進(jìn)時(shí),市場氣氛為盤整\\\\');
EXPLAIN(adx<ref(adx,1) and ref(adx,1)<ref(adx,2) and ref(adx,2)>ref(adx,3) and ref(adx,3)>ref(adx,4),'ADX值從上升傾向轉(zhuǎn)為下降時(shí),表明行情即將反轉(zhuǎn)\\\\');
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
EXPLAIN(1=1,'下面為:macd,KDJ,CCI,W&R,RSI,MTM等指標(biāo)的判斷:');
EXPLAINEX(1=1,'(中標(biāo))macd=',macd,2,1);
EXPLAIN(macd>0 and diff>0,'大勢屬多頭市場\\\\');
EXPLAIN(macd>0.35,'超買中,隨時(shí)有可能見頂回落\\\\');
EXPLAIN(macd<0 and diff<0,'大勢屬空頭市場\\\\');
EXPLAIN(macd<-0.35,'超賣中,隨時(shí)有可能反彈\\\\');
EXPLAIN(cross(diff,dea) and cross(macd,0),'上穿o軸,可考慮買入\\\\');
EXPLAIN(cross(j,k) and k<50,'KDJ金叉\\\\');
EXPLAIN(cross(k,d) and k>70,'KDJ死叉\\\\');
EXPLAIN(j>84,'KDJ指標(biāo)高位');EXPLAIN(j<16,'KDJ指標(biāo)低位\\\\');
TYP := (HIGH + LOW + CLOSE)/3;
cci:=(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14));
EXPLAIN(cci<-180,'CCI指標(biāo)底位,買入機(jī)會(huì)\\\\');
EXPLAIN(cci>180,'CCI指標(biāo)高位,賣出機(jī)會(huì)\\\\');
EXPLAINEX(1=1,'(短標(biāo))cci=',cci,2,1);
EXPLAINEX(1=1,'換手率=',vol/CAPITAl*100,2,1);
explain((vol/CAPITAl)>0.075,'換手過大,小心主力出逃,短期頭部\\\\');
wr:=-100*(HHV(HIGH,14)-CLOSE)/(HHV(HIGH,14)-LLV(LOW,14));
EXPLAINEX(1=1,'威廉指標(biāo)(短標(biāo))=',wr,2,1);
explain(wr>-20,'W&R超買,短線即將見頂,應(yīng)及時(shí)賣出\\\\');
explain(wr<-80,'W&R超賣,短線即將見底,應(yīng)伺機(jī)買進(jìn)\\\\');
MTM := CLOSE-REF(CLOSE,6);
MTMMA := MA(MTM,6);
EXPLAIN(CROSS(MTM,MTMMA) and MTMMA<-0.8,'MTM從下向上突破MTMMA,買入信號\\\\');
EXPLAIN(CROSS(MTMMA,MTM) and MTMMA>0.8,'MTM從上向下跌破MTMMA,賣出信號\\\\');

LC := REF(CLOSE,1);
RSI1:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;
RSI2:=SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100;
EXPLAINEX(1=1,'相對強(qiáng)弱RSI1=',RSI1,2,1);
EXPLAIN(RSI1>85,'6日RSI超買,防止回?fù)鮘\\\');
EXPLAIN(RSI1>80,'6日RSI向上突破85,超買,考慮賣出\\\\');
EXPLAIN(RSI1<15,'6日RSI超賣,隨時(shí)有可能反彈\\\\');
EXPLAIN(RSI1<15,'6日RSI向下跌破15,超賣,考慮買入\\\\');
EXPLAIN(CROSS(RSI1,15),'6日RSI向上突破15,買進(jìn)信號\\\\');
EXPLAIN(CROSS(RSI1,85),'6日RSI向下跌破85,賣出信號\\\\');
psy:=COUNT(CLOSE>REF(CLOSE,1),12)/12*100;
EXPLAINEX(1=1,'12天心理線,PSY=',psy,2,1);
EXPLAINEX(1=1,'獲利盤比例=',WINNER(c)*100,2,1);
EXPLAINEX(1=1,'套牢盤比例=',100-WINNER(c)*100,2,1);
Aa:=(EMA(C,30)*2+MA(C,60))/3;
Ra:=(VOL*CLOSE);
VL1a:=EMA(Ra,13)/EMA(VOL,13);
VL2a:=EMA(Ra,60)/EMA(VOL,60);
VLa:=EMA((VL1a+VL2a)/2,3);
分水嶺:=ma((Aa+VLa)/2,1);
EXPLAINEX(1=1,'分水嶺(中長標(biāo))=',分水嶺,2,1);
EXPLAIN(close>分水嶺,'股價(jià)在分水嶺之上,大勢屬多頭,可積極做多\\\\');
EXPLAIN(close<分水嶺,'股價(jià)在分水嶺之下,大勢屬空頭,超跌只能搶反彈\\\\');
BBI:=(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4;
UPR:=BBI+3*STD(BBI,10);
DWN:=BBI-3*STD(BBI,10);
var55:=(UPR-DWN)/UPR<0.03;
var56:=(UPR-DWN)/UPR>0.18;
var57:=(ma(c,60)-ma(c,5))/ma(c,60)>0.15;
var58:=(ma(c,5)-ma(c,60))/ma(c,5)>0.15;
EXPLAIN(var55,'多空布林收斂中,有變盤的可能,上下自己分析\\\\');
EXPLAIN(var57 and var56 and c>o ,'布林上下乖離太大,有反彈的可能\\\\');
EXPLAIN(var58 and var56 and c<o ,'布林上下乖離太大,有回落的可能\\\\');

    本站是提供個(gè)人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約