TA的每日心情 | 开心 2024-9-20 00:45 |
---|
签到天数: 949 天 [LV.10]签到十级
六段
- 积分
- 36750
|
感谢斗K不是逗K师兄发的MAC底背离条件选股公式( I, R) j6 H/ l
我这里发一个,MACD指标公式,可以在图中标出顶和底的背离
; W2 {; U+ w; t. E
( \9 z6 Z, _' m- ]0 @在主图上右键点MACD的“修改当前指标公式” 然后拷如下列程序,名字自命名,我命名的是“MACD=背离”0 h/ i) o/ [$ l. \
! ] {+ y. u' ~/ p
- W& n* `0 d0 O7 J) |3 C
DIFF:EMA(CLOSE,12) - EMA(CLOSE,26);
( C; D! h; A+ B* X8 F2 _DEA:EMA(DIFF,9);
+ }" u7 ?5 c: T1 K. i2 z5 zMACD:2*(DIFF-DEA), COLORSTICK; " Y9 Z. E# Z( Q
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
$ x9 l. ?) U5 {2 C4 \底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);3 J# q+ N8 [8 e& |$ f
STICKLINE(底背离,0,0.1,8,0),COLORRED;
% k/ j% j4 S9 G6 KDRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2;6 k+ T3 b3 U3 G0 ~8 B
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
& R5 Z! r. m( w# z$ A: v7 E8 `顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);9 [6 q8 P! N3 ^* x" \3 V6 |
DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK2;9 k: N! }* f5 p+ B1 i8 x
/ L6 S0 Q3 a! w7 s/ O1 l* j( y
' i3 e ?/ i% [
/ y% \& V0 y8 O) \5 ?5 T$ G6 ` | / q! [+ G% M, ^& Z5 l% x$ V/ a
|
|