本帖最后由 流行云 于 2013-6-17 01:00 编辑
T: _+ L: n3 X2 q- q0 H5 e+ G7 c I9 F8 h& n a4 {6 U+ {( V) K
, f# @1 g2 e) q* ?. V5 L4 a或许对某些同志会有帮助,继续贴上源码
) |- T9 G# e" r# H. q& g7 l5 X8 }: i0 [8 z% O2 f
0 l2 ^- q7 ]: L f{苍狼MACD}
& P$ i8 P9 v: \1 z' e7 w IINPUT:N1(3,1,100),N2(10,1,100),N3(10,1,100),N4(20,1,100),M(9,1,100);
: F6 e2 E2 u. a5 V{短波}
4 y0 A2 S" g/ p* |$ N" U短波EMA(C,N1)-EMA(C,N2))*1000,LINETHICK0,COLORRED;( R, y: q/ W. z9 ?/ i! M) ^
短均线:EMA(短波,M),LINETHICK0,COLORCYAN;9 k$ ?/ U3 C: W% s* w3 u
MACD:=2*(短波-短均线);
6 }/ s2 b+ V( \; N{中波}3 t6 n' c v# H J5 W& R& {9 _
中波EMA(C,N3)-EMA(C,N4))*1000,COLORYELLOW;1 Q1 x; p* U+ K1 X* v" o2 Z5 q
中均线:EMA(中波,M),COLORBLUE;' z$ B3 ^& S$ i5 |, H8 I9 {
MACD2:2*(中波-中均线),LINETHICK1;
+ I, b7 a7 v" h9 l- {. l# USTICKLINE(MACD2>=0,MACD2,0,2,1),COLORMAGENTA;
+ h* v; h) J1 Y% }) f( A, P5 _STICKLINE(MACD2<0,MACD2,0,2,1),COLORWHITE;
5 b# `! j$ X- g7 \" j; L{绘图} V, c$ |; |9 [8 l: q
FILLRGN(中波>=中均线,中波,中均线),COLORYELLOW;' D' q, t; s' l b4 o" f: i' W3 h5 Z
FILLRGN(中波<中均线,中波,中均线),COLORBLUE;/ j8 O" H* o+ d3 m; u/ Z5 R3 y
{FILLRGN(短波>=短均线,短波,短均线),COLORRED;% H4 g. `* l4 M2 T! k
FILLRGN(短波<短均线,短波,短均线),COLORGREEN;}
6 m) D. v, @" x2 T! y5 S短均线,LINETHICK2,COLORCYAN;# J6 ^5 t9 h) g) P8 V6 v
PARTLINE(短波>=短均线,短波),COLORRED,LINETHICK2;
& D4 s/ l: q, ]1 M& L9 kPARTLINE(短波<短均线,短波),COLORGREEN,LINETHICK2;
% A. O) l* _8 j& t{周金叉,死叉}9 u) ]# Q8 t z3 {! ?% X
AA:="MACD.DIFF#WEEK";
@% q0 [$ q+ V: b5 KBB:="MACD.DEA#WEEK";" E3 k- b- w3 a1 k4 x
DRAWTEXT(CROSS(AA,BB),0,'▲周金叉'),ALIGN5,COLORRED;
9 K7 L) a3 h+ S" J% [" P! fDRAWTEXT(CROSS(BB,AA),0,'◆周死叉'),ALIGN4,COLORBLUE;& L* C! v9 A2 i- e6 g5 E& n
{月金叉,死叉}
9 J4 X. [' X# v' B( d VCC:="MACD.DIFF#MONTH";
7 i l/ Y5 A! D- H' `' X2 b2 m5 jDD:="MACD.DEA#MONTH";8 h" H+ P0 n. R8 V
DRAWTEXT(CROSS(CC,DD),0,'●月金叉'),ALIGN5,COLORRED;
8 J! A* D% J$ M' G, jDRAWTEXT(CROSS(DD,CC),0,'○月死叉'),ALIGN4,COLORBLUE;/ U ^8 Z# I. }3 P. D
{选股}
- V6 n5 B: H* N1 k2 `EE:=CROSS(中波,中均线) AND MACD2>REF(MACD2,1) AND 短波>=REF(短波,1) AND 中均线>=REF(中均线,1);3 a3 W7 Z/ {; n+ V# L4 g/ q
出来:FILTER(EE,10);4 y7 O8 G* M) m, G/ J
DRAWICON(出来,中均线,1);
, I+ b/ t4 s, ^! Z1 B+ Q3 {: y$ O# I( v# Q9 n+ w5 A
2 b) P& s, V. |0 p
|