TA的每日心情 | 开心 2024-9-20 00:45 |
---|
签到天数: 949 天 [LV.10]签到十级
六段
- 积分
- 36750
|
感谢斗K不是逗K师兄发的MAC底背离条件选股公式
# w3 s0 s/ d+ q% r, Z1 s2 d我这里发一个,MACD指标公式,可以在图中标出顶和底的背离
$ V+ B0 I& T L7 _
9 ^4 a3 ]$ V: a在主图上右键点MACD的“修改当前指标公式” 然后拷如下列程序,名字自命名,我命名的是“MACD=背离”
! S9 r6 ~" x8 n& c( C1 e* M
. B7 B$ a$ o1 D8 ]7 f: {$ Y; A9 Y; C9 F8 j4 ]8 U: W
DIFF:EMA(CLOSE,12) - EMA(CLOSE,26);
$ m( d" f: \1 I- |2 ]DEA:EMA(DIFF,9);
' I5 ^; o9 O% i' u) l2 [/ D/ H3 jMACD:2*(DIFF-DEA), COLORSTICK;
6 ~% @. C' Q0 l. R" t8 X1 w& O/ nA1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
) Y$ n! V0 i X' x& L5 M# M/ N底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);8 }5 m% T. I: q7 c
STICKLINE(底背离,0,0.1,8,0),COLORRED;) m8 G. p% F7 L$ D: t
DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2;3 W" o6 u8 s: \" I
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
& ~( E# K4 W. N- }) w* q顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);
( h& `0 D# f$ M. N, e9 W% T, h( NDRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK2;, C2 d5 R2 V4 L, ^4 M
- r- y, s6 L/ t2 s
% T. n5 Q! o' L7 s1 J- t
' @* h$ p1 g* k | ! h0 c \$ `" ]/ W# {4 r1 u
|
|