通达信稳赚MACD建仓空仓买卖指标公式
- 指标类别: 通达信指标公式
- 授权方式: 免费版
- 指标评级: ★★★★★
- 指标分类: 趋势
- 画线方法: 副图
- 日期:2020-07-01 来源:互联网
通达信稳赚MACD建仓空仓买卖指标公式:包含未来函数:BACKSET
SHORT:=8;
LONG:=13;
MID:=5;
P:=5;
DIF1:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA1:=EMA(DIF1,9);
MACD1:=2*(DIF1-DEA1),STICK;
MACD2:=EMA(MACD1,3);
STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,1,0),COLORRED;
STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,1,0),COLORGREEN;
STICKLINE(MACD1<MACD2,0,MACD1,1,0),COLORCBCBC0;
STICKLINE(MACD1>=0 OR MACD1<=0,0,0,50,1),COLORWHITE;
DIF:DIF1,COLOR33FF33;
DEA:DEA1,COLORYELLOW;
MACD:MACD1,NODRAW,COLORMAGENTA;
强:IF(DIF1>=DEA1,DIF1,DRAWNULL),COLORRED,LINETHICK2;
持仓段:0,COLOR00CFFF;
空仓段:0,COLORFFCCFF;
DRAWTEXT(CROSS(DIF,DEA),DIF-0,'建仓'),COLORRED;
DRAWTEXT(CROSS(DEA,DIF),DIF+0,'空仓'),COLORGREEN;
A1:=REF(DEA,P)=HHV(DEA,2*P+1);
B1:=FILTER(A1,P);
C1:=BACKSET(B1,P+1);
D1:=FILTER(C1,P);{高点}
A2:=REF(DEA,P)=LLV(DEA,2*P+1);
B2:=FILTER(A2,P);
C2:=BACKSET(B2,P+1);
D2:=FILTER(C2,P);{低点}
前期高点:REF(DEA,BARSLAST(D1)),COLORFF00FF,NODRAW;
前期低点:REF(DEA,BARSLAST(D2)),COLOR00FF00,NODRAW;
向前期高点:CROSS(DEA,前期高点*1.01),NODRAW;
相对能量:(DEA-前期低点)/(前期高点-前期低点)*100,COLORRED,NODRAW;
R11:=BACKSET(ISLASTBAR,BARSLAST(D1)+1);
S11:=R11>REF(R11,1);
DRAWLINE(D1,DEA,S11,DEA,1),COLORRED;
T11:=BACKSET(ISLASTBAR,BARSLAST(D2)+1);
U11:=T11>REF(T11,1);
DRAWLINE(D2,DEA,U11,DEA,1),COLORRED;
STICKLINE(C>0,前期低点,前期低点,1,0),COLORRED;
STICKLINE(C>0,前期高点,前期高点,1,0),COLORFF00FF;
通达信稳赚MACD建仓空仓买卖指标公式实例图解:
通达信稳赚MACD建仓空仓买卖指标公式