TA的每日心情 | 开心 2022-11-11 07:43 |
---|
签到天数: 1848 天 [LV.Master]签到十一级
六段
- 积分
- 56080
|
DIF:= EMA(CLOSE,12)-EMA(CLOSE,26);* ^+ |4 j/ A* j& m4 x% ?' N
DEA:= EMA(DIF,9);
, z* o6 J2 U& k# B8 g, ~0 VMACD:= (DIF-DEA)*2;
4 Z: {" C+ a A5 {" K6 W; p8 [/ k6 _& U/ y0 ~, [1 ^
均值:= SUM(ABS(MACD), 100)/100;; F! u. A* g2 V" M2 L/ }
NOTEXT回:= REF(MACD, 2) > REF(MACD, 1) AND REF(MACD, 1) < 均值*0.1 AND
6 m ]* c/ m% p7 k) P' l# H3 Y5 E0 JREF(MACD, 1)>=0 AND REF(MACD, 1) < MACD;( X9 t: l6 i' r! x4 H
金叉败:= REF(MACD, 2) < REF(MACD, 1) AND REF(MACD, 1) > 0-均值*0.1 AND
' ~0 @ g& D0 X1 E) DREF(MACD, 1)<=0 AND REF(MACD, 1) > MACD;
0 n N" Z) U8 P5 X m3 y& j7 v3 k2 u! {6 s
AA1A:= BARSLAST(CROSS(DEA, DIF))+1;" Q& }+ A8 R! N, b% b
AA1B:= IF(NOTEXT回 OR 金叉败, BARSLAST(NOTEXT回 OR 金叉败)+3, 99999);
4 n l# r! y9 K& _AA1:= IF(AA1B<AA1A, AA1B, AA1A);
+ `2 h1 y0 g+ b6 Y& m$ n4 N
$ s1 c2 ?, e# a1 H6 MAA2A:= REF(BARSLAST(CROSS(DEA, DIF)), AA1)+1;
: }- l* L* o, j' y6 ~AA2B:= IF(REF(NOTEXT回 OR 金叉败, AA1), REF(BARSLAST(NOTEXT回 OR 金叉败), AA1), 99999)+3;/ L- e1 @4 x/ \2 d
AA2:= IF(AA2B<AA2A, AA2B, AA2A);
9 [& k2 v& _* L. n, } a
% ]0 r m; m" B9 S& J# Z& R# ODIFZ~小值:= LLV(DIF, AA1+AA2);6 H' H4 _# o. n1 z: \$ W' H
DIFZ~小日:= LLVBARS(DIF, AA1+AA2);4 {6 N; O0 x1 q. A& N
DBL1:= IF(DIFZ~小日<=AA1, 0, 1);
" i' K$ T& C. \; QDBL2:= IF(DBL1=1 AND C<REF(C, DIFZ~小日) AND DIF>REF(DIF, DIFZ~小日), 1, 0);
4 f+ a6 Y- Y# u# H9 vDBL:= IF(DBL1=0, 0, DBL2);+ R6 T9 \3 L* u0 A
6 l* W# r' U" G; S0 L# e1 |
DBLJC: MACD2.DBL AND (CROSS(MACD2.DIF, MACD2.DEA) OR MACD2.NOTEXT回) AND MACD2.DIF>REF(MACD2.DIF, 1);
, b) {! B* S0 N( _# h" m, J/ }$ p( U& C1 w
把中间的字符减少了,测试通过了,不知道有没有改变函数的用法,试试再说 |
|