TA的每日心情 | 开心 2024-9-20 00:45 |
---|
签到天数: 949 天 [LV.10]签到十级
六段
- 积分
- 36750
|
感谢斗K不是逗K师兄发的MAC底背离条件选股公式5 |6 r; ~ j) G% E% m
我这里发一个,MACD指标公式,可以在图中标出顶和底的背离. B! P$ I% ~# j5 U
& p& p3 [. ?- H, @7 ?
在主图上右键点MACD的“修改当前指标公式” 然后拷如下列程序,名字自命名,我命名的是“MACD=背离”$ M- [! @* g! k6 i& J/ p
/ J! \6 j4 J/ c- a, h2 a4 w# t$ k& P, l& l% l! W; Q, ?8 i2 {1 I; M
DIFF:EMA(CLOSE,12) - EMA(CLOSE,26);
6 ^1 Y7 c9 c' @, z. G9 b8 SDEA:EMA(DIFF,9);1 k2 q- p' u0 L( f- r; o5 A
MACD:2*(DIFF-DEA), COLORSTICK; 1 i" C/ r; `* X1 N. s
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
4 k$ W% S3 [4 L B# D4 p/ c) r: X底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);
+ h, k2 `7 J! }6 E7 Q$ H# o' BSTICKLINE(底背离,0,0.1,8,0),COLORRED;+ y* y" R7 u1 g) e: l- Z4 M
DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2;) i6 S4 x+ \ ^) k6 k
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));, {' n0 \" G! [+ n+ y p; Z& M
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);
$ d/ v! R2 h: S& n p( W% tDRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK2;0 n, x+ |* k! t! x' n
|
|