股资源-股票学习站-学炒股-股票课程-炒股教程-分析选股指标-入门基础知识

 找回密码
 注册昵称

QQ登录

只需一步,快速开始

搜索
上一主题 下一主题

[通达信] 通达信MACD底背离(主图副图选股源码)


    [-----复制链接-----]
楼主
 通达信源码安装路径:1,工具栏点击公式选项。2,弹出公式窗口点击新建。3,把源码复制到指标编辑器保存。4,回到K线图界面安装建立好的公式 || 2023-10-9 00:07:05

以下是通达信MACD底背离(主图副图选股源码)

{主图}

DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2;
T:=BARSLAST(CROSS(0,MACD));
TA:=BARSLAST(CROSS(MACD,0));
T2:=REF(T,TA+1)+TA+1;
L1:=LLV(L,T+1);
L2:=REF(L1,T+1);
L1T:=BARSLAST(L=L1);
M1:=REF(MACD,BARSLAST(L=L1));
M2:=REF(M1,T+1+T+1);
L2T:=BARSLAST(L=CONST(L2));
TJ:=(T2-TA)>=10 AND (TA-T)>=10;
TJ1:=L1<L2 AND M1>M2;
EXT:DRAWLINE(L2T=0,L,L1T=0 AND TJ AND TJ1 AND T>=10 AND L2T>20 ,L,0),COLORYELLOW;
DRAWTEXT(CROSS(EXT!=DRAWNULL,0.5),EXT*1.05,'底背离'),COLORYELLOW;


{幅图}

DIF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIF,9);
MACD:(DIF-DEA)*2,COLORSTICK;
T:=BARSLAST(CROSS(0,MACD));
TA:=BARSLAST(CROSS(MACD,0));
T2:=REF(T,TA+1)+TA+1;
L1:=LLV(L,T+1);
L2:=REF(L1,T+1);
L1T:=BARSLAST(L=L1);
M1:=REF(MACD,BARSLAST(L=L1));
M2:=REF(M1,T+1+T+1);
L2T:=BARSLAST(L=CONST(L2));
TJ:=(T2-TA)>=10 AND (TA-T)>=10;
TJ1:=L1<L2 AND M1>M2;
EXT:DRAWLINE(L2T=0,MACD,L1T=0 AND TJ AND TJ1 AND T>=10 AND L2T>20,MACD,0),DOTLINE,COLORMAGENTA;
DRAWTEXT(CROSS(EXT!=DRAWNULL,0.5),MACD,'底背离'),COLORMAGENTA;


{选股}


DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2;
T:=BARSLAST(CROSS(0,MACD));
TA:=BARSLAST(CROSS(MACD,0));
T2:=REF(T,TA+1)+TA+1;
L1:=LLV(L,T+1);
L2:=REF(L1,T+1);
L1T:=BARSLAST(L=L1);
M1:=REF(MACD,BARSLAST(L=L1));
M2:=REF(M1,T+1+T+1);
L2T:=BARSLAST(L=CONST(L2));
TJ:=(T2-TA)>=10 AND (TA-T)>=10;
TJ1:=L1<L2 AND M1>M2;
XG:TJ AND TJ1 AND L1T=0 AND T>=10 AND L2T>20;






回复

举报

QQ|

GMT+8, 2024-11-17 11:00

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