填料的【MACD】运用好了是不错的技术
SJV:=FINANCE(34);{每股净资产}
市净率:C/SJV,NODRAW,COLOR00FF00;
每股税后利润:=(FINANCE(1)/FINANCE(29));
市盈率:C/FINANCE(33),NODRAW,COLORFFFF00;
DIF:=EMA(CLOSE,10)-EMA(CLOSE,22);
DE:=EMA(DIF,7.5);
MACDA:=2*(DIF-DE),;
HZL:=CROSS(MACDA,0);
LZH:=CROSS(0,MACDA);
BC:=BARSLAST(HZL OR LZH)+1;
ZGHZ:=IF(MACDA>0,HHV(MACDA,BC),0);
ZGLZ:=IF(MACDA<0,LLV(MACDA,BC),0);
DRAWBAND(ZGHZ,RGB(105,77,77),0,RGB(77,77,77));
DRAWBAND(ZGLZ,RGB(80,0,0),0,RGB(66,88,66));
DIFF:EMA(CLOSE,10)-EMA(CLOSE,22),COLORFFFFFF;
DEA:EMA(DIFF,7.5),COLOR00FFFF;
MACD:2*(DIFF-DEA), COLORSTICK,LINETHICK0;
STICKLINE(MACD>0 AND MACD>REF(MACD,1),0,MACD,1.5,1),COLORRED;
STICKLINE(MACD>0 AND MACD<REF(MACD,1),0,MACD,1.5,0),COLOR90FF00;
STICKLINE(MACD<0 AND MACD<REF(MACD,1),0,MACD,1.5,1),COLOREFFF00;
STICKLINE(MACD<0 AND MACD>REF(MACD,1),0,MACD,1.5,0),COLORFFAAFF;
STICKLINE(MACD>0 AND MACD=HHV(MACD,BARSLAST(MACD<0)) AND MACD>=REFX(MACD,1) AND MACD>=REFX(MACD,2),MACD,MACD*0.5,0.6,1),COLOR00F0FF;
STICKLINE(MACD<0 AND MACD=LLV(MACD,BARSLAST(MACD>0)) AND MACD<=REFX(MACD,1) AND MACD<=REFX(MACD,2),MACD,MACD*0.5,0.6,1),COLORFFAAFF;
A1:=LLV(MACD,30);
A2:=A1=MACD;
A3:=BARSLAST(A2);
A4:=REF(MACD,A3);
B1:=HHV(MACD,30);
B2:=B1=MACD;
B3:=BARSLAST(B2);
B4:=REF(MACD,B3);
STICKLINE(A3,A4,A4,10,0),COLOR999999;{MACD最低柱线的最高位置画线}
STICKLINE(B3,B4,B4,10,0),COLOR999999;{MACD最高柱线的最高位置画线}
↑:TROUGHBARS(3,3,1),COLOR0000FF,NODRAW;
↓:PEAKBARS(3,3,1),COLOR00FF00,NODRAW;
低:IF(↑=0,DIFF,IF(↓<↑,TROUGH(3,3,1),REF(TROUGH(3,3,1),1))),COLOR00FFFF,NODRAW;
高:IF(↓=0,DIFF,IF(↑<↓,PEAK(3,3,1),REF(PEAK(3,3,1),1))),COLOR00FF00,NODRAW;
STICKLINE(↑=0 AND DIFF<0 AND DIFF<DEA,0,DIFF,0,0),COLORFFAAFF;
STICKLINE(↓=0 AND DIFF>0 AND DIFF>DEA,DIFF,0,0,0),COLOR00FF00;
DRAWTEXT(↑=0 AND DIFF<0 AND DIFF<DEA,DIFF,'低'),COLORFFAAFF;
DRAWTEXT(↓=0 AND DIFF>0 AND DIFF>DEA,DIFF,'高'),COLOR00FF00;
低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
AA1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:=(REF(L,AA1+1)>L OR REF(C,AA1+1)>C) AND (L,DIFF)>REF((L,DIFF),AA1+1) AND CROSS(DIFF,DEA);
DRAWLINE(AA1=0,DEA,底背离,DEA,0),COLOR0000FF,LINETHICK1;
AA2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:=(REF(C,AA2+1)<C OR REF(H,AA2+1)<H) AND REF((H,DIFF),AA2+1)>(H,DIFF) AND CROSS(DEA,DIFF);
DRAWLINE(AA2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK1;
DRAWICON(CROSS(DIFF,DEA) AND DIFF>0,DEA,36);
DRAWICON(CROSS(DEA,DIFF) AND DIFF>0,DEA,37);
DRAWICON(CROSS(DIFF,DEA) AND DIFF<0,DEA,1);
DRAWICON(二次金叉,DEA*0.9,36) ;
解盘1:=CONST(IF(MACD>0,1,0));
解盘2:=CONST(IF(MACD<0,1,0));
解盘A:=IF(解盘1=1,'【精华8个字 买小卖小,缩头缩脚】 当股价一波比一波高时,反而红柱的堆,
一堆比一堆小,证明产生了顶背离现象,应该及时卖出',
IF(解盘2=1,'【精华8个字 买小卖小,缩头缩脚】 当股价一波比一波低时,
反而绿柱的堆一堆比一堆小,证明产生了底背离,应该买进',
DRAWNULL));
DRAWTEXT_FIX((解盘1=1 OR 解盘2=1),0.16,0,0,解盘A),COLORFFEE00;
未来函数检测结果如下:
该公式包含未来函数:PEAK
该公式包含未来函数:PEAKBARS
该公式包含未来函数:TROUGH
该公式包含未来函数:TROUGHBARS
该公式包含未来函数:FINANCE
该公式包含未来函数:REFX
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
SJV赋值:FINANCE(34)
输出{每股净资产}
市净率:C/SJV,NODRAW,COLOR00FF00
每股税后利润赋值:(FINANCE(1)/FINANCE(29))
输出
市盈率:C/FINANCE(33),NODRAW,COLORFFFF00
DIF赋值:收盘价的10日指数移动平均-收盘价的22日指数移动平均
DE赋值:DIF的7.5日指数移动平均
MACDA赋值:2*(DIF-DE),
HZL赋值:MACDA上穿0
LZH赋值:0上穿MACDA
BC赋值:上次HZL OR LZH距今天数+1
ZGHZ赋值:IF(MACDA>0,BC日内MACDA最高值,0)
ZGLZ赋值:IF(MACDA<0,BC日内MACDA最低值,0)
DRAWBAND(ZGHZ,RGB(105,77,77),0,RGB(77,77,77))
DRAWBAND(ZGLZ,RGB(80,0,0),0,RGB(66,88,66))
DIFF:收盘价的10日指数移动平均-收盘价的22日指数移动平均,COLORFFFFFF
DEA:DIFF的7.5日指数移动平均,COLOR00FFFF
输出
MACD:2*(DIFF-DEA), COLORSTICK,LINETHICK0
STICKLINE(MACD>0 AND MACD>1日前的MACD,0,MACD,1.5,1),画红色
STICKLINE(MACD>0 AND MACD<1日前的MACD,0,MACD,1.5,0),COLOR90FF00
STICKLINE(MACD<0 AND MACD<1日前的MACD,0,MACD,1.5,1),COLOREFFF00
STICKLINE(MACD<0 AND MACD>1日前的MACD,0,MACD,1.5,0),COLORFFAAFF
STICKLINE(MACD>0 AND MACD=HHV(MACD,上次MACD<0距今天数) AND MACD>=REFX(MACD,1) AND MACD>=REFX(MACD,2),MACD,MACD*0.5,0.6,1),COLOR00F0FF
STICKLINE(MACD<0 AND MACD=LLV(MACD,上次MACD>0距今天数) AND MACD<=REFX(MACD,1) AND MACD<=REFX(MACD,2),MACD,MACD*0.5,0.6,1),COLORFFAAFF
A1赋值:30日内MACD最低值
A2赋值:A1=MACD
A3赋值:上次A2距今天数
A4赋值:A3日前的MACD
B1赋值:30日内MACD最高值
B2赋值:B1=MACD
B3赋值:上次B2距今天数
B4赋值:B3日前的MACD
当满足条件A3时,在A4和A4之间画柱状线
当满足条件B3时,在B4和B4之间画柱状线
输出{MACD最高柱线的最高位置画线}
↑:TROUGHBARS(3,3,1),COLOR0000FF,NODRAW
输出
↓:PEAKBARS(3,3,1),COLOR00FF00,NODRAW
输出
低:IF(↑=0,DIFF,IF(↓<↑,TROUGH(3,3,1),REF(TROUGH(3,3,1),1))),COLOR00FFFF,NODRAW
输出
高:IF(↓=0,DIFF,IF(↑<↓,PEAK(3,3,1),REF(PEAK(3,3,1),1))),COLOR00FF00,NODRAW
当满足条件↑=0 AND DIFF<0 AND DIFF当满足条件↓=0 AND DIFF>0 AND DIFF>DEA时,在DIFF和0之间画柱状线
当满足条件↑=0 AND DIFF<0 AND DIFF当满足条件↓=0 AND DIFF>0 AND DIFF>DEA时,在DIFF和'高'位置书写文字
低位金叉:=DIFF上穿DEA AND DIFF<-0.1
JCCOUNT赋值:COUNT(DIFF上穿DEA,上次DEA>=0距今天数)
二次金叉赋值:DIFF上穿DEA AND DEA<0 AND 统计21日满足JC=2的天数=1
AA1赋值:上次1日前的DIFF上穿DEA距今天数
底背离赋值:(AA1+1日前的L>L OR AA1+1日前的C>C) AND (L,DIFF)>REF((L,DIFF),AA1+1) AND DIFF上穿DEA
DRAWLINE(AA1=0,DEA,底背离,DEA,0),COLOR0000FF,LINETHICK1
AA2赋值:上次1日前的DEA上穿DIFF距今天数
顶背离赋值:(AA2+1日前的C(H,DIFF) AND DEA上穿DIFF
DRAWLINE(AA2=0,DEA,顶背离,DEA,0),画绿色,LINETHICK1
DRAWICON(DIFF上穿DEA AND DIFF>0,DEA,36)
DRAWICON(DEA上穿DIFF AND DIFF>0,DEA,37)
DRAWICON(DIFF上穿DEA AND DIFF<0,DEA,1)
当满足条件二次金叉时,在DEA*0.9和36之间画图标
如果MACD>0返回1否则返回0
如果MACD<0返回1否则返回0
解盘A赋值:IF(解盘1=1,'【精华8个字 买小卖小,缩头缩脚】 当股价一波比一波高时,反而红柱的堆,
一堆比一堆小,证明产生了顶背离现象,应该及时卖出',
IF(解盘2=1,'【精华8个字 买小卖小,缩头缩脚】 当股价一波比一波低时,
反而绿柱的堆一堆比一堆小,证明产生了底背离,应该买进',
DRAWNULL))
DRAWTEXT_FIX((解盘1=1 OR 解盘2=1),0.16,0,0,解盘A),COLORFFEE00