TA的每日心情 | 开心 2024-9-20 00:45 |
---|
签到天数: 949 天 [LV.10]签到十级
六段
- 积分
- 36750
|
感谢斗K不是逗K师兄发的MAC底背离条件选股公式
- h+ `3 u) R4 H2 t6 r) L3 G我这里发一个,MACD指标公式,可以在图中标出顶和底的背离* ^& w. c Y4 _ i! Z E8 o# C% J) o
l- p8 K) Z' y# F, D( z# L6 R& Q在主图上右键点MACD的“修改当前指标公式” 然后拷如下列程序,名字自命名,我命名的是“MACD=背离”# J' o' ]& h) L; G( h
0 f& L9 c* d) R1 f, z+ `, A- t2 s6 s, x0 v
DIFF:EMA(CLOSE,12) - EMA(CLOSE,26);9 R" f @7 M- Y8 |6 U5 b
DEA:EMA(DIFF,9);
9 ?, M. b1 x! u" _7 [- V7 c+ j) F0 BMACD:2*(DIFF-DEA), COLORSTICK;
C6 i" } `* C6 \3 FA1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
# f" K' N4 b/ O" {+ w: `5 l& ~底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA); s0 u2 f, ~( F; f
STICKLINE(底背离,0,0.1,8,0),COLORRED;2 K- D: A4 q* h6 J' U, B
DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2;! Q6 c- ^% ?5 }/ m% E, \
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));/ y' r4 a6 q6 O! }2 d4 W
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);
( Z8 m4 p* {+ l+ sDRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK2;! p/ O1 ^# \* V' @; O0 w0 f. A
$ X8 C/ o/ Q- x
1 h8 Z1 R- C2 c0 n, ]( t; L3 m% C
|
; O$ }, U) F, Z% N( C( o
|
|