TA的每日心情 | 开心 2024-9-20 00:45 |
---|
签到天数: 949 天 [LV.10]签到十级
六段
- 积分
- 36750
|
感谢斗K不是逗K师兄发的MAC底背离条件选股公式
- t% P, P. z. g我这里发一个,MACD指标公式,可以在图中标出顶和底的背离
; a+ Z- d7 r% o5 e' Z/ w. r r$ P* l
5 k: f) G. C$ R% g/ s在主图上右键点MACD的“修改当前指标公式” 然后拷如下列程序,名字自命名,我命名的是“MACD=背离”1 r0 W5 H, w! t. a
% w* R4 W$ y+ F7 k
0 ^$ A5 {0 e1 `0 V3 A2 Y: ADIFF:EMA(CLOSE,12) - EMA(CLOSE,26);; X4 S3 i" B' }8 P0 I
DEA:EMA(DIFF,9);
1 P# h2 E' O% f8 u0 g- hMACD:2*(DIFF-DEA), COLORSTICK;
) \: h: u$ v, a% M! yA1:=BARSLAST(REF(CROSS(DIFF,DEA),1));) f0 U4 M2 {9 F6 E
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);5 i9 d, |- R1 p% r/ V# u
STICKLINE(底背离,0,0.1,8,0),COLORRED;6 E- b' A3 C; Y- s% v
DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2;
+ I* M8 Y7 X* M0 ]A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
5 V# o$ g- i, c6 ?5 K( G顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);
9 T; O! L1 ]& x" y. KDRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK2;2 u' N) Q5 b2 {; `: a s8 `
* D7 F! C+ `) L+ d6 G2 O9 |0 |+ q1 @; K0 S
; r7 }; ^3 J {! T |
) V$ |: H0 [9 p3 F
|
|