TA的每日心情 | 开心 2025-3-4 09:47 |
---|
签到天数: 953 天 [LV.10]签到十级
六段
 
- 积分
- 36960
|
感谢斗K不是逗K师兄发的MAC底背离条件选股公式3 K) F, E# u9 M1 M' @$ i0 y/ F
我这里发一个,MACD指标公式,可以在图中标出顶和底的背离
/ Y+ k- X# @3 X5 E2 O! m' N! \8 \5 N9 A3 E
在主图上右键点MACD的“修改当前指标公式” 然后拷如下列程序,名字自命名,我命名的是“MACD=背离”& F6 l6 Y0 _$ u8 m% O/ v( V
2 [6 x- |" b* |) L: S# {5 Y
( a* j# E- a: h) {# m" MDIFF:EMA(CLOSE,12) - EMA(CLOSE,26);5 Z: G1 U3 z& b+ p* X
DEA:EMA(DIFF,9);, u- T5 e. {. x) e3 |$ W6 |
MACD:2*(DIFF-DEA), COLORSTICK; ( N# q( h+ p7 E4 e/ \$ b3 K2 f5 c
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));& F4 d+ w: e9 {& {4 [* Y+ q
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);( q8 M) H$ Q) o. Q
STICKLINE(底背离,0,0.1,8,0),COLORRED;
- a$ s% q* G0 ]/ n* F( A8 aDRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2;. D# l7 `4 q6 v) B5 l; m4 B: w* X
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
/ a5 i! }3 b3 _# f* q! j) W顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);* D. o9 h' R7 L6 M3 D
DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK2;
3 _7 Q/ m( V; U7 W. N+ t
|
|