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

 找回密码
 注册昵称

QQ登录

只需一步,快速开始

搜索
上一主题 下一主题

[通达信] 通达信MACD多彩做波段怎么这么准自用系列 副图源码


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

以下是通达信MACD多彩做波段怎么这么准自用系列 副图源码

喜欢就下,做波段不错,自用系列最常用的指标之一。
日线下参数,按源码上说明设定,捉住波段的起点!

{SHORT 2 2000 24
LONG 2 2000 152
MID 2 2000 18}

DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG),NODRAW;
DEA:EMA(DIF,MID),NODRAW;
MACD:(DIF-DEA)*2,COLORSTICK;

{多周期统计}
当红:IF(BARSLAST(MACD<0),BARSLAST(MACD<0),0),NODRAW,COLORRED;
当绿:IF(BARSLAST(MACD>0),BARSLAST(MACD>0),0),NODRAW,COLORGREEN;
{MACD周值}
周DIF:="MACD.DIF#WEEK";
周DEA:="MACD.DEA#WEEK";
周MACD:=(周DIF-周DEA)*2;
周红天数:IF(周MACD>0,BARSLAST(CROSS(周MACD,0)),DRAWNULL)+1,COLORYELLOW,NODRAW;
周绿天数:IF(周MACD<0,BARSLAST(CROSS(0,周MACD)),DRAWNULL)+1,COLORCYAN,NODRAW;
{MACD月值}
月DIF:="MACD.DIF#MONTH";
月DEA:="MACD.DEA#MONTH";
月MACD:=(月DIF-月DEA)*2;
月红天数:IF(月MACD>0,BARSLAST(CROSS(月MACD,0)),DRAWNULL)+1,COLORRED,NODRAW;
月绿天数:IF(月MACD<0,BARSLAST(CROSS(0,月MACD)),DRAWNULL)+1,COLORGREEN,NODRAW;

A1:=LAST(MACD>=REF(MACD,1),3,1);
B1:=MACD<REF(MACD,1);
C1:=LAST(MACD<=REF(MACD,1),3,1);
D1:=MACD>REF(MACD,1);

GD:=MACD=HHV(MACD,30);
GJ:=BARSLAST(FILTER(CROSS(0.8,GD),2))+1;
E1:=REF(MACD,GJ),POINTDOT,COLORMAGENTA;
DA:=MACD=LLV(MACD,30);
DJ:=BARSLAST(FILTER(CROSS(0.8,DA),2))+1;
F1:=REF(MACD,DJ);

CS:=BARSLAST(MACD<REF(MACD,1));

STICKLINE(MACD>REF(MACD,1) AND MACD<0 AND CS=1,0,MACD,2,1),COLORFFFF99;
STICKLINE(MACD>REF(MACD,1) AND MACD<0 AND CS=2,0,MACD,2,1),COLORFFFFAA;
STICKLINE(MACD>REF(MACD,1) AND MACD<0 AND CS=3,0,MACD,2,1),COLOREEEEBB;
STICKLINE(MACD>REF(MACD,1) AND MACD<0 AND CS=4,0,MACD,2,1),COLORDDDDCC;
STICKLINE(MACD>REF(MACD,1) AND MACD<0 AND CS=5,0,MACD,2,1),COLORCCCCDD;
STICKLINE(MACD>REF(MACD,1) AND MACD<0 AND CS=6,0,MACD,2,1),COLORBBBBEE;
STICKLINE(MACD>REF(MACD,1) AND MACD<0 AND CS=7,0,MACD,2,1),COLORAAAAFF;
STICKLINE(MACD>REF(MACD,1) AND MACD<0 AND CS=8,0,MACD,2,1),COLOR9999FF;
STICKLINE(MACD>REF(MACD,1) AND MACD<0 AND CS=9,0,MACD,2,1),COLOR8888FF;
STICKLINE(MACD>REF(MACD,1) AND MACD<0 AND CS>9,0,MACD,2,1),COLOR8888FF;

STICKLINE(MACD>REF(MACD,1) AND MACD>0 AND CS=2,0,MACD,1,1),COLOR000099;
STICKLINE(MACD>REF(MACD,1) AND MACD>0 AND CS=2,0,MACD,2,1),COLOR0000AA;
STICKLINE(MACD>REF(MACD,1) AND MACD>0 AND CS=3,0,MACD,2,1),COLOR1100BB;
STICKLINE(MACD>REF(MACD,1) AND MACD>0 AND CS=4,0,MACD,2,1),COLOR1100CC;
STICKLINE(MACD>REF(MACD,1) AND MACD>0 AND CS=5,0,MACD,2,1),COLOR3300DD;
STICKLINE(MACD>REF(MACD,1) AND MACD>0 AND CS=6,0,MACD,2,1),COLOR3300EE;
STICKLINE(MACD>REF(MACD,1) AND MACD>0 AND CS=7,0,MACD,2,1),COLOR5500FF;
STICKLINE(MACD>REF(MACD,1) AND MACD>0 AND CS=8,0,MACD,2,1),COLOR5500FF;
STICKLINE(MACD>REF(MACD,1) AND MACD>0 AND CS=9,0,MACD,2,1),COLOR7700FF;
STICKLINE(MACD>REF(MACD,1) AND MACD>0 AND CS>9,0,MACD,2,1),COLOR7700FF;

STICKLINE(MACD>E1 AND E1>0,E1,E1,2,0),COLORRED;
STICKLINE(MACD<F1 AND F1<0,MACD,F1,0,1),COLORBLUE;
STICKLINE(A1 AND B1 AND MACD>0,MACD,0,2,1),COLOR00DD00;
STICKLINE(C1 AND D1 AND MACD<0,MACD,0,2,0),COLOR000DDD;

DRAWBAND(DIF,RGB(250,250,250),DIF,RGB(0,0,0));
DRAWBAND(DEA,RGB(250,250,0),DEA,RGB(0,0,0));











回复

举报

QQ|

GMT+8, 2024-11-19 16:34

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