私募

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz

[选股技巧] [通达信] MACD 经典指标

[复制链接]
发表于 2019-5-22 01:07:09 | 显示全部楼层 |阅读模式
{MACD实战0源码}
* T4 n; p% \" _% ~  R. h: C中DIFFEMA(CLOSE,12) - EMA(CLOSE,26)),LINETHICK2,COLOR2A2AA5;
$ n" w  `9 ^6 |, T8 x5 O1 S5 n中DEA:EMA(中DIFF,9),COLORFFFF00;
" v" s1 ^5 [( K! {MACD2:(2 * (中DIFF -中DEA)),LINETHICK0,COLORFFFF00;
9 m) d% s1 m2 M: t! g" e% JSTICKLINE((MACD2>=0),0,MACD2,1,1),COLORD700FF;! A( O- x1 h9 R6 F3 _5 w. c
STICKLINE(((MACD2>=0) AND (MACD2 < REF(MACD2,1))),0,MACD2,1,0),COLOR0099FF;( D0 a7 ?5 \6 R; ]0 D
STICKLINE((MACD2= REF(UDGLINE,1)) AND (CLOSE < UDGLINE)) AND (TUD0 < TDU0));4 n* p" g6 m% A# C
JDU1:=(JDU0 AND (COUNT(JDU0,TDU0) = 1));! x" J5 m6 B3 E9 R1 P! w
JUD1:=(JUD0 AND (COUNT(JUD0,TUD0) = 1));7 C; H0 R8 R. E
JDU2:=(JDU1 AND (REF(BARSLAST(JUD1),1) < REF(BARSLAST(JDU1),1)));
: _6 y9 g& v- |2 }) E" R. g7 l2 iJUD2:=(JUD1 AND (REF(BARSLAST(JUD1),1) > REF(BARSLAST(JDU1),1)));. d6 s2 s( W2 ^8 V7 w' t
JDU3:=(JDU1 AND (REF(BARSLAST(JUD1),1) > REF(BARSLAST(JDU1),1)));& D0 f8 E+ @/ @. T0 N6 _
JUD3:=(JUD1 AND (REF(BARSLAST(JUD1),1) < REF(BARSLAST(JDU1),1)));5 F0 l# j9 Y  d( O
BSLINE:=IF((BARSLAST(JDU2) < BARSLAST(JUD2)),IF(REF(CROSS(0,MACD2),1),LLV(LOW,2),REF(LLV(LOW,2),BARSLAST(REF(CROSS(0,MACD2),1)))),IF(REF(CROSS(MACD2,0),1),HHV(HIGH,2),REF(HHV(HIGH,2),BARSLAST(REF(CROSS(MACD2,0),1)))));: v; O& b5 U7 A1 {7 x
$ R# @4 A- g' Z+ E
DEFUT:=BARSLAST(CROSS(MACD2,0));
+ K2 a" S4 G0 V0 p& D3 q2 h. FDEFDT:=BARSLAST(CROSS(0,MACD2));& V; q7 `) P8 B/ {
DEFUL:=IF((MACD2 >= 0),HHV(MACD2,(DEFUT + 1)),REF(HHV(MACD2,(DEFUT + 1)),(DEFDT + 1)));/ Z( u% N, }3 D, {6 A
DEFDL:=IF((MACD2 < 0),LLV(MACD2,(DEFDT + 1)),REF(LLV(MACD2,(DEFDT + 1)),(DEFUT + 1)));7 ~. u5 {7 s* m1 Z
DEFU2L:=REF(DEFUL,(DEFUT + 1));
% g- Y$ t* @' ?+ P' gDEFD2L:=REF(DEFDL,(DEFDT + 1));( W  s0 z) v; `) A/ S. Z: s
STICKLINE(中DIFF>=中DEA,中DIFF,中DEA,6,0),COLOR00FFFF;
8 J% ]8 r. y2 gSTICKLINE(中DIFF=短DEA,短DIFF,DRAWNULL),COLORRED,LINETHICK2;/ G) T5 {5 `& y- b2 u
$ D# ~' P- i% j1 l
D1:=EMA(C,3)-EMA(C,8);# ?" R9 L# S8 x& b: R  \; |
D2:=EMA(O,3)-EMA(O,8);
& E& g' J0 e) F! h! v1 R4 gD3:=EMA(H,3)-EMA(H,8);- H# ]* ~2 J9 ?8 x  @8 }. f
D4:=EMA(L,3)-EMA(L,8);* C  K9 X" j" d# f
DRAWICON(((((LLV(MACD2,4) > 0) AND (MACD2 < REF(MACD2,1))) AND (REF(MACD2,1) > REF(MACD2,2))) AND (REF(MACD2,2) > REF(MACD2,3))),MACD2,6);% h# Y2 m' [% l# `
DRAWICON(((((HHV(MACD2,4) < 0) AND (MACD2 > REF(MACD2,1))) AND (REF(MACD2,1) < REF(MACD2,2))) AND (REF(MACD2,2) < REF(MACD2,3))),MACD2,4);# q7 j9 v: ?8 F2 I5 u
DRAWICON(CROSS(中DIFF,D1) AND 中DIFF>0.1 ,D3+0.1,2);# `7 P3 Q, m5 U1 @! m% s
EE:=CROSS(中DIFF,中DEA) AND MACD2>REF(MACD2,1) AND 短DIFF>=REF(短DIFF,1) AND 中DEA>=REF(中DEA,1);
5 n+ L0 S9 k$ s6 {" K3 M出来:=FILTER(EE,10);- O, w) W* Z1 ^, m; N
DRAWICON(出来,中DEA,1);
http://www.simu001.cn/x73643x1x1.html
最好的私募社区 | 第一私募论坛 | http://www.simu001.cn

精彩推荐

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Archiver| ( 桂ICP备12001440号-3 )|网站地图

GMT+8, 2024-11-27 20:31 , Processed in 0.388752 second(s), 27 queries .

Powered by www.simu001.cn X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表