MACD顺天通达信副图指标源码

 
{MACD顺天}


{INPUT:SHORT(12),LONG(26),M(9),N(55);}
DIFF:(EMA(CLOSE,3)-EMA(CLOSE,8)),LINETHICK2,COLORGREEN;
IF(DIFF>=REF(DIFF,1),DIFF,DRAWNULL),LINETHICK2,COLORRED;
DEA:EMA(DIFF,9),COLORWHITE;
MACD:DIFF-DEA,NODRAW,COLORMAGENTA;
IF(DIFF>0 AND DIFF>DEA AND DIFF>REF(DIFF,1),DIFF,DRAWNULL),LINETHICK2,COLORRED;
IF(DIFF<0 AND DIFF>DEA AND DIFF>REF(DIFF,1),DIFF,DRAWNULL),LINETHICK2,COLORYELLOW;


STICKLINE(MACD<=0 AND MACD<=REF(MACD,1),0,MACD,2,0),COLORGREEN;
STICKLINE(MACD<=0 AND MACD>=REF(MACD,1),0,MACD,2,0),COLORMAGENTA;
STICKLINE(MACD>=0 AND MACD<=REF(MACD,1),0,MACD,2,0),COLORCYAN;
STICKLINE(MACD>=0 AND MACD>=REF(MACD,1),0,MACD,2,0),COLORRED;
建仓:DIFF<0 AND REF(DIFF,1)<REF(DIFF,2) AND (DIFF>REF(DIFF,1)),COLORRED,NODRAW;
买点:DIFF<0 AND CROSS(DIFF,DEA),COLORYELLOW,NODRAW;
IF(买点,0.3,0),COLORYELLOW;
加仓:DIFF<0 AND DIFF>DEA AND MACD>REF(MACD,1){DIFF>REF(DIFF,1)},NODRAW,COLORYELLOW;
持股:DIFF>0 AND DIFF>DEA AND MACD>REF(MACD,1){DIFF>REF(DIFF,1)},NODRAW,COLORRED;
卖点:DIFF>0 AND REF(DIFF,1)>REF(DIFF,2) AND {MACD<REF(MACD,1)}DIFF<REF(DIFF,1),COLORGREEN,NODRAW;
持币:DIFF<DEA AND MACD<REF(MACD,1){DIFF<REF(DIFF,1)},NODRAW,COLORFFFF00;
清仓:=DIFF>0 AND CROSS(DEA,DIFF);
DRAWICON(建仓,DIFF*1.15,1);
DRAWTEXT(建仓,DIFF*1.25,'建仓'),COLORRED;
DRAWTEXT(买点,DEA*1.050,'买点'),COLORYELLOW;
DRAWICON(卖点,DIFF*1.10,2);
DRAWTEXT(卖点,DEA*1.30,'卖点'),COLORGREEN;
DRAWTEXT(DIFF>0 AND CROSS(DEA,DIFF),DIFF*1.200,'清仓'),COLORGREEN;
零线:0,COLORWHITE;
T6:=IF(FINDSTR(EXTERNSTR(0,1),','),STRCAT('千股千评:',EXTERNSTR(0,1)),'');
DRAWTEXT_FIX(1,0.30,0.00,0,T6),COLOR00FFFF;
底背离:=LLV(LOW,60)=LOW AND NOT(LLV(MACD,55)=MACD);{大智慧讲师原设55天,LCY改为60天}
顶背离:=HHV(HIGH,60)=HIGH AND NOT(HHV(MACD,55)=MACD);
DRAWTEXT(底背离=1,DIFF*0.98,'底背离'),COLORMAGENTA;
DRAWTEXT(顶背离=1,DEA*1.098,'顶背离'),COLORCCFF00;
{主力潜伏}
主力潜伏:COUNT(MACD<0,10)=10,COLORMAGENTA,NODRAW;
IF(主力潜伏,0.3,0),COLORMAGENTA;
{GX:REF(主力潜伏,1)=1 AND 主力潜伏<1 AND DIFF>0,COLORRED;};
量:=EMA(VOL,13);
资金:=EMA(AMOUNT,13);
过滤:=((资金 /量) / 100);
提纯:=(((CLOSE -过滤) / 过滤) * 100);
黄金:=((提纯<(0)) AND ZXNH),COLORRED;
粪土:=((提纯>(0)) AND ZXNH);
低买:IF(黄金 AND (持股 OR 加仓),0.3,0),COLORYELLOW,LINETHICK2;
高卖:IF(粪土 AND (持币 OR 清仓),0.3,0),COLORBLUE,LINETHICK2;
{上涨分界:25;}
STICKLINE(低买,0,0.3,2,0),COLORYELLOW;
STICKLINE(高卖,0,0.3,2,0),COLORBLUE;






来函数检测结果如下
该公式没有未来函数


解密、定制、编写公式指标请联系QQ或微信同号:88652583
置顶指标

相关指标公式

输出DIFF:(收盘价的3日指数移动平均-收盘价的8日指数移动平均),线宽为2,画绿色
如果DIFF>=1日前的DIFF,返回DIFF,否则返回无效数,线宽为2,画红色
输出DEA:DIFF的9日指数移动平均,画白色
输出平滑异同平均线:DIFF-DEA,NODRAW,画洋红色
如果DIFF>0ANDDIFF>DEAANDDIFF>1日前的DIFF,返回DIFF,否则返回无效数,线宽为2,画红色
如果DIFF<0ANDDIFF>DEAANDDIFF>1日前的DIFF,返回DIFF,否则返回无效数,线宽为2,画黄色
当满足条件MACD<=0ANDMACD<=1日前的MACD时,在0和MACD位置之间画柱状线,宽度为2,0不为0则画空心柱.,画绿色
当满足条件MACD<=0ANDMACD>=1日前的MACD时,在0和MACD位置之间画柱状线,宽度为2,0不为0则画空心柱.,画洋红色
当满足条件MACD>=0ANDMACD<=1日前的MACD时,在0和MACD位置之间画柱状线,宽度为2,0不为0则画空心柱.,画青色
当满足条件MACD>=0ANDMACD>=1日前的MACD时,在0和MACD位置之间画柱状线,宽度为2,0不为0则画空心柱.,画红色
输出建仓:DIFF<0 AND 1日前的DIFF<2日前的DIFF AND (DIFF>1日前的DIFF),画红色,NODRAW
输出买点:DIFF<0 AND DIFF上穿DEA,画黄色,NODRAW
如果买点,返回0.3,否则返回0,画黄色
输出加仓:DIFF<0 AND DIFF>DEA AND MACD>1日前的MACD,NODRAW,画黄色
输出持股:DIFF>0 AND DIFF>DEA AND MACD>1日前的MACD,NODRAW,画红色
输出卖点:DIFF>0 AND 1日前的DIFF>2日前的DIFF AND DIFF<1日前的DIFF,画绿色,NODRAW
输出持币:DIFF清仓赋值:DIFF>0 AND DEA上穿DIFF
当满足条件建仓时,在DIFF*1.15位置画1号图标
当满足条件建仓时,在DIFF*1.25位置书写文字,画红色
当满足条件买点时,在DEA*1.050位置书写文字,画黄色
当满足条件卖点时,在DIFF*1.10位置画2号图标
当满足条件卖点时,在DEA*1.30位置书写文字,画绿色
当满足条件DIFF>0ANDCROSS(DEA,DIFF)时,在DIFF*1.200位置书写文字,画绿色
输出零线:0,画白色
T6赋值:如果字符串查找,返回字符串相加,否则返回''
当满足条件1时,在横轴0.30纵轴0.00位置书写文字,COLOR00FFFF
底背离赋值:60日内最低价的最低值=最低价 AND 取反
顶背离赋值:60日内最高价的最高值=最高价 AND 取反
当满足条件底背离=1时,在DIFF*0.98位置书写文字,画洋红色
当满足条件顶背离=1时,在DEA*1.098位置书写文字,COLORCCFF00
输出主力潜伏:统计10日中满足MACD<0的天数=10,画洋红色,NODRAW
如果主力潜伏,返回0.3,否则返回0,画洋红色

量赋值:成交量(手)的13日指数移动平均
资金赋值:成交额(元)的13日指数移动平均
过滤赋值:((资金 /量) / 100)
提纯赋值:(((收盘价 -过滤) / 过滤) * 100)
黄金赋值:((提纯<(0)) AND 直线拟合),画红色
粪土赋值:((提纯>(0)) AND 直线拟合)
输出低买:如果黄金AND(持股OR加仓),返回0.3,否则返回0,画黄色,线宽为2
输出高卖:如果粪土AND(持币OR清仓),返回0.3,否则返回0,画蓝色,线宽为2
当满足条件低买时,在0和0.3位置之间画柱状线,宽度为2,0不为0则画空心柱.,画黄色
当满足条件高卖时,在0和0.3位置之间画柱状线,宽度为2,0不为0则画空心柱.,画蓝色

指标安装下载帮助  |   联系我们  |  乐淘公式网  |  公式网   |  指标公式  |   加入收藏   |  设为主页

@2005-2025 浙ICP备2024071487号-1 乐淘公式网公式网均来源互联网收集整理,如不慎侵犯了你的权益,请联系我们告知,我们将做删除处理
免责声明:乐淘公式网所有指标公式及文章由网络收集,不保障实时性和真实性, 仅供学习研究并不构成投资建议,请勿以此为依据进行股票交易,由此引起的投资亏损与本站无关。
QQ:88652583 微信 88652583
sitemap站点地图