TA的每日心情 | 开心 2024-9-20 00:45 |
---|
签到天数: 949 天 [LV.10]签到十级
六段
- 积分
- 36750
|
感谢斗K不是逗K师兄发的MAC底背离条件选股公式
8 b4 H7 V/ @$ |: f0 f( U. M我这里发一个,MACD指标公式,可以在图中标出顶和底的背离7 D( T+ b! \, K2 a- _: U8 v& V7 ~
# X# Z7 t" J4 h! ^
在主图上右键点MACD的“修改当前指标公式” 然后拷如下列程序,名字自命名,我命名的是“MACD=背离” |6 {- _, @2 N0 U- i" v$ h
" i7 ^; D9 W E4 ]
+ j% r& v/ z& A" r
DIFF:EMA(CLOSE,12) - EMA(CLOSE,26);3 `( Z" ?6 {- J7 O: r8 t6 A: k5 i
DEA:EMA(DIFF,9);* P" _: |# b8 j6 O3 z, {1 A, r
MACD:2*(DIFF-DEA), COLORSTICK;
8 \" B8 u! e5 ]0 HA1:=BARSLAST(REF(CROSS(DIFF,DEA),1));1 M: V: s% e% e; n5 M% X0 ^1 l
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);
2 ^+ {% {" Q0 H. b( U4 bSTICKLINE(底背离,0,0.1,8,0),COLORRED;
6 [7 W: \' ?2 z7 q( \' u3 \% uDRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2;* |- w7 W' p6 s ^1 j2 F1 E
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
: _& _# L! R; t* U; G. g) o) n8 p, D顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);% s9 i9 I. i0 z% p% I
DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK2;
' g; n& N9 p5 S+ G9 s! K" d8 A7 H; i2 b5 F$ K: }
" S5 D( O& f9 Y1 P* e7 V0 I2 [0 G1 E0 [: |: B6 R
|
4 t: w$ B( j! Z4 ~6 I
|
|