本帖最后由 流行云 于 2013-6-17 01:00 编辑
/ s9 `0 I5 i# b0 ~* P0 u# _, N
2 k. K3 l- q# Z$ {3 t' m8 } [: r9 `( e8 c
或许对某些同志会有帮助,继续贴上源码
4 ^* c1 V, ?2 C" C) C2 M* q; L/ x$ Q5 E
* G$ i' s% M7 a; c{苍狼MACD}3 ]5 s/ ^8 I1 D* i( I# Q2 b
INPUT:N1(3,1,100),N2(10,1,100),N3(10,1,100),N4(20,1,100),M(9,1,100);: a, x0 a% U7 F! @
{短波}2 E4 C& }* n c7 Q3 p, ~2 E: a
短波EMA(C,N1)-EMA(C,N2))*1000,LINETHICK0,COLORRED;
* z/ u, D, m. @% m短均线:EMA(短波,M),LINETHICK0,COLORCYAN;$ t0 p7 D. h ^9 `
MACD:=2*(短波-短均线);+ z6 m/ r3 X _* K, `
{中波}* R; u2 D( \' ]$ ^0 o/ g1 q% p
中波EMA(C,N3)-EMA(C,N4))*1000,COLORYELLOW;
) O4 f- h' D& w* R2 p1 \中均线:EMA(中波,M),COLORBLUE;
7 c. O# Q& _- L8 VMACD2:2*(中波-中均线),LINETHICK1;
% w0 Z# j+ |9 v2 ~& xSTICKLINE(MACD2>=0,MACD2,0,2,1),COLORMAGENTA;; m' {7 U: ]' f1 I& R
STICKLINE(MACD2<0,MACD2,0,2,1),COLORWHITE;
9 _) [# }" d% {% S- C; |{绘图}0 e& K* b' t* i2 n' [
FILLRGN(中波>=中均线,中波,中均线),COLORYELLOW;
/ r4 K3 `1 k' NFILLRGN(中波<中均线,中波,中均线),COLORBLUE;" ?" g9 F! C6 G6 ~) U+ e
{FILLRGN(短波>=短均线,短波,短均线),COLORRED;' ^1 I0 M/ }7 r& C9 v4 }
FILLRGN(短波<短均线,短波,短均线),COLORGREEN;}1 x1 E F/ N |( ?' J4 W
短均线,LINETHICK2,COLORCYAN;' Y. z" K$ P: d' @
PARTLINE(短波>=短均线,短波),COLORRED,LINETHICK2;# X$ \! m4 o4 ^4 |; V; F. k1 L
PARTLINE(短波<短均线,短波),COLORGREEN,LINETHICK2;! @- B# k3 T( B& |) ^( b0 n; b
{周金叉,死叉}
/ a: P- T3 }* a% y5 H& K& YAA:="MACD.DIFF#WEEK";& M3 A {2 D' T1 w W3 n
BB:="MACD.DEA#WEEK";
2 y8 \) Y5 a6 d3 iDRAWTEXT(CROSS(AA,BB),0,'▲周金叉'),ALIGN5,COLORRED;
- g& w8 ^$ [/ }- Z' p" gDRAWTEXT(CROSS(BB,AA),0,'◆周死叉'),ALIGN4,COLORBLUE;
7 e) @0 X1 R! N$ l, S6 C: r{月金叉,死叉}9 P {0 V6 N( c& A
CC:="MACD.DIFF#MONTH";
b) [# f6 n8 \( G$ i) X Y! \# O. bDD:="MACD.DEA#MONTH";) L! h) J" A. x' I4 t$ h
DRAWTEXT(CROSS(CC,DD),0,'●月金叉'),ALIGN5,COLORRED;
0 B3 S; ?7 N3 }/ I+ p" qDRAWTEXT(CROSS(DD,CC),0,'○月死叉'),ALIGN4,COLORBLUE;8 B" K" Z. `9 Z8 U F! }
{选股}) c+ p t4 b% A M" W$ E
EE:=CROSS(中波,中均线) AND MACD2>REF(MACD2,1) AND 短波>=REF(短波,1) AND 中均线>=REF(中均线,1);( o: m; d: R s: l4 J; Q
出来:FILTER(EE,10);0 j. l6 N* `" ?1 m: p. ~- U
DRAWICON(出来,中均线,1);
+ v! U4 P V. _- z
! [4 B( s, h& u6 ~- X2 y2 L
- [* b! s K1 p: _. ~7 I |