本帖最后由 流行云 于 2013-6-17 01:00 编辑
& a: g, v- C1 s( B( t0 R! a8 f& H7 e3 ` ~% |
5 p# J; n. `, ~) A% z+ r
或许对某些同志会有帮助,继续贴上源码
8 {2 p$ @9 a H& h7 s4 X0 D+ ]$ `8 V p4 `. |" r
% C2 A8 P P3 A' m% \
{苍狼MACD}: T1 |+ A. f) |
INPUT:N1(3,1,100),N2(10,1,100),N3(10,1,100),N4(20,1,100),M(9,1,100);
& b0 W G; p9 ?. y$ F& z9 v{短波}
8 T: H+ @/ j) O. W( X) i4 L2 }) M短波EMA(C,N1)-EMA(C,N2))*1000,LINETHICK0,COLORRED;& r! x3 t9 O8 }# z8 h; r
短均线:EMA(短波,M),LINETHICK0,COLORCYAN;
. G8 T8 @4 M" C7 i" PMACD:=2*(短波-短均线);
% o L: P2 ^, j# A7 O# k{中波}
, R5 Z8 _: U3 r% B7 \+ e中波EMA(C,N3)-EMA(C,N4))*1000,COLORYELLOW;
# M! P* Q0 M0 d2 D# S中均线:EMA(中波,M),COLORBLUE;% Y+ O/ K: M1 @9 e8 Q9 W
MACD2:2*(中波-中均线),LINETHICK1;
7 g( F4 G. B2 R, a6 P! ^ MSTICKLINE(MACD2>=0,MACD2,0,2,1),COLORMAGENTA;3 {8 b$ N& `6 A* x9 Z
STICKLINE(MACD2<0,MACD2,0,2,1),COLORWHITE;
% y2 M @4 J/ A) F, B{绘图}$ Q9 x* }5 ]2 p+ H3 U$ g
FILLRGN(中波>=中均线,中波,中均线),COLORYELLOW;
6 r1 l0 i# K3 G+ w" rFILLRGN(中波<中均线,中波,中均线),COLORBLUE;
0 z3 {; ~$ I2 i+ Z7 p/ p{FILLRGN(短波>=短均线,短波,短均线),COLORRED;* l5 x% s! j- \& V3 a& v8 L
FILLRGN(短波<短均线,短波,短均线),COLORGREEN;}$ [- X3 V/ F4 _
短均线,LINETHICK2,COLORCYAN;
9 }& Z/ q% m' R2 Y2 N6 yPARTLINE(短波>=短均线,短波),COLORRED,LINETHICK2;
" X, M+ b. j+ _' |/ BPARTLINE(短波<短均线,短波),COLORGREEN,LINETHICK2;, m3 g3 M6 n: C$ v6 @) u1 z
{周金叉,死叉}
/ R' f0 r6 u$ N, v' T0 P1 ZAA:="MACD.DIFF#WEEK";0 b* q. j- T" F/ S2 h W& c
BB:="MACD.DEA#WEEK";5 I& ]1 q6 w: n' l2 K- E+ D3 J
DRAWTEXT(CROSS(AA,BB),0,'▲周金叉'),ALIGN5,COLORRED;' |/ c; h V8 D
DRAWTEXT(CROSS(BB,AA),0,'◆周死叉'),ALIGN4,COLORBLUE;2 z% m" J4 \- E# c2 a
{月金叉,死叉} w2 m2 h4 ^& f3 \' _
CC:="MACD.DIFF#MONTH";
1 B: y* C" v) k6 @DD:="MACD.DEA#MONTH";
% U. c' V) e$ c. dDRAWTEXT(CROSS(CC,DD),0,'●月金叉'),ALIGN5,COLORRED;
6 V/ M! G- y# U* _DRAWTEXT(CROSS(DD,CC),0,'○月死叉'),ALIGN4,COLORBLUE;2 m2 J, H8 I9 @" {2 F* b
{选股}
# h- o( k8 o% m7 B0 B6 g: LEE:=CROSS(中波,中均线) AND MACD2>REF(MACD2,1) AND 短波>=REF(短波,1) AND 中均线>=REF(中均线,1);
" c9 j$ D' X4 w& O4 u. x( Q出来:FILTER(EE,10);7 a- G: l) v: W
DRAWICON(出来,中均线,1);
% S- j. ?5 O/ Z, S
! j/ R3 `! f( g) r" v! X# v0 \% c9 v, l1 t8 t' k, K }7 G' z
|