TA的每日心情 | 开心 2025-3-4 09:47 |
---|
签到天数: 953 天 [LV.10]签到十级
六段
 
- 积分
- 36960
|
感谢斗K不是逗K师兄发的MAC底背离条件选股公式
: ?8 d v8 J: t q/ a! B我这里发一个,MACD指标公式,可以在图中标出顶和底的背离0 @9 B$ z6 b+ K& I0 q4 [7 k; y# W
. K% C8 t9 a1 G9 u在主图上右键点MACD的“修改当前指标公式” 然后拷如下列程序,名字自命名,我命名的是“MACD=背离”( C5 r" b' J. M
$ X% L# F4 ^, L5 ^" Y
/ S# f- ?9 F! VDIFF:EMA(CLOSE,12) - EMA(CLOSE,26);
. ], r, h6 F; P* |- bDEA:EMA(DIFF,9);
. j, @. ^8 t z- h+ n, D% V, e9 bMACD:2*(DIFF-DEA), COLORSTICK; 6 T. N* Z8 K3 H, r& T
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
4 ?/ i- l: D+ `& O; b$ a4 _) ^8 {1 l底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);
' u5 X0 Y- {5 eSTICKLINE(底背离,0,0.1,8,0),COLORRED;
3 N1 p: I$ }5 u: g$ YDRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2;! h2 A: Q& r3 d+ @
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));7 D: c' u: S- A$ T! r' W
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);0 C# J; S" d! }( J5 v1 M7 j8 }
DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK2;* z5 Q) B* p0 T g( _
|
|