本帖最后由 流行云 于 2013-6-17 01:00 编辑 & ?( j, m4 B2 D0 N2 n, |2 M' |/ i. X
3 ]5 B1 b, [" Z0 b
3 q( I# r' o) d
或许对某些同志会有帮助,继续贴上源码 2 K1 R2 w7 v- V; ^* w; ^4 f
/ d: j, D1 u a( o! y5 ?
7 F* p- x" J* G7 W5 S" {, j{苍狼MACD}$ M6 c! m# t: K, K# }$ T
INPUT:N1(3,1,100),N2(10,1,100),N3(10,1,100),N4(20,1,100),M(9,1,100);; a: \) G; X0 H* g1 b
{短波}
' F9 O9 h3 R1 D$ B% ?( o短波EMA(C,N1)-EMA(C,N2))*1000,LINETHICK0,COLORRED;3 V0 E: J Y: u& ^% z
短均线:EMA(短波,M),LINETHICK0,COLORCYAN;! P$ c& S4 ~% R+ K
MACD:=2*(短波-短均线);
X# K& {! n+ Q7 F{中波}. D2 u1 |8 A$ O1 H* f4 q) \0 P
中波EMA(C,N3)-EMA(C,N4))*1000,COLORYELLOW;
2 h# A8 V# b. W2 P7 m- `! a( o中均线:EMA(中波,M),COLORBLUE;
# E1 C2 g8 a7 g% WMACD2:2*(中波-中均线),LINETHICK1;
6 {% U4 C$ b4 j: l2 N! }' ^STICKLINE(MACD2>=0,MACD2,0,2,1),COLORMAGENTA;
# q" m9 |( B i7 rSTICKLINE(MACD2<0,MACD2,0,2,1),COLORWHITE;- g" B: ]; X' q) c& J- p' B6 T2 q
{绘图}
: i5 K! K; _6 `7 F$ UFILLRGN(中波>=中均线,中波,中均线),COLORYELLOW;
p! X* z- c1 p. A1 ^( h$ N$ nFILLRGN(中波<中均线,中波,中均线),COLORBLUE;
; R3 Q2 A. d9 e* Q* Q$ |& q, q{FILLRGN(短波>=短均线,短波,短均线),COLORRED;* a3 U6 F' g, e& l0 N
FILLRGN(短波<短均线,短波,短均线),COLORGREEN;}
) D6 E& A4 i/ a5 h& f5 b短均线,LINETHICK2,COLORCYAN;
& B/ a; H5 S0 Q' { w$ p# r$ M- d- NPARTLINE(短波>=短均线,短波),COLORRED,LINETHICK2;. r0 r: Q. Y5 ~% P# R3 D
PARTLINE(短波<短均线,短波),COLORGREEN,LINETHICK2;
3 |1 [& @) w- E i' a8 R. H{周金叉,死叉}$ F3 I8 U9 w8 T7 F1 J. ^
AA:="MACD.DIFF#WEEK";
2 Q* J6 \$ R7 _+ o( d( fBB:="MACD.DEA#WEEK";
$ a) e" C% K7 {3 J# D! A2 [4 kDRAWTEXT(CROSS(AA,BB),0,'▲周金叉'),ALIGN5,COLORRED;1 g. C7 k) t V3 B
DRAWTEXT(CROSS(BB,AA),0,'◆周死叉'),ALIGN4,COLORBLUE;
7 b( C7 }' i# B7 G: x3 f{月金叉,死叉}
& a- g4 e/ U; F2 p0 ]* sCC:="MACD.DIFF#MONTH";
" Q% r. q7 B" hDD:="MACD.DEA#MONTH";/ I/ {- x' Z- b4 I' |. [
DRAWTEXT(CROSS(CC,DD),0,'●月金叉'),ALIGN5,COLORRED;$ f! y0 B; h' B8 j, q, T
DRAWTEXT(CROSS(DD,CC),0,'○月死叉'),ALIGN4,COLORBLUE;2 F$ J, h6 ^; @( r( a
{选股}% j7 s! k X1 X( Q% w! b' D7 R/ T
EE:=CROSS(中波,中均线) AND MACD2>REF(MACD2,1) AND 短波>=REF(短波,1) AND 中均线>=REF(中均线,1);# M/ p2 J' E) M* S
出来:FILTER(EE,10);
# G/ T0 ^: v& B" V8 b9 |DRAWICON(出来,中均线,1);) S2 a/ Q0 K& U# ?0 j
0 |6 Q/ S9 |" H$ y* k8 L* u/ \
8 ~, s' ~; c& a" r$ A
|