TA的每日心情 | 开心 2024-9-20 00:45 |
---|
签到天数: 949 天 [LV.10]签到十级
六段
- 积分
- 36750
|
感谢斗K不是逗K师兄发的MAC底背离条件选股公式
9 j( E. k5 ?2 `+ s4 N4 F9 x0 H1 X我这里发一个,MACD指标公式,可以在图中标出顶和底的背离% F0 W# M6 x; [7 D" y! ]
! N# ]/ q% D: L/ }在主图上右键点MACD的“修改当前指标公式” 然后拷如下列程序,名字自命名,我命名的是“MACD=背离”- S n' J) _2 i% |# ~7 K
. Q% r9 J# m" D. P0 n( j" _0 C. W+ i
* R& N8 Y7 v" l3 v t- F
DIFF:EMA(CLOSE,12) - EMA(CLOSE,26);
) G/ C; p2 X2 oDEA:EMA(DIFF,9);$ Z- y) D! X6 u# T3 I+ b
MACD:2*(DIFF-DEA), COLORSTICK;
, j1 s$ E. e+ QA1:=BARSLAST(REF(CROSS(DIFF,DEA),1));. O9 D! v% O8 H; J$ Q' S8 G
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);: a" I z2 F9 b+ c- L) F% E& Q2 i
STICKLINE(底背离,0,0.1,8,0),COLORRED;
( E$ B6 F' x& W9 Q0 JDRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2;) V9 L# d. o% Q4 q& H9 x* s" x) s
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));) U( j% Q* o3 c" C5 q: |- n
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);& w' F6 \1 y4 @$ g
DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK2;& A9 _3 ]4 W7 D8 H$ H- U5 p2 [6 A
+ }. s: Y% h6 ?* S
2 E) `# B9 z) E6 U" g+ [9 \0 ~2 ]3 @% U% u
| : W, T' g6 p+ {# H4 g/ x( f' y: o
|
|