您的位置:爱股网 > 查股公式 > 通达信MACD买卖副图公式源码[查股公式]
股票行情消息数据:

通达信MACD买卖副图公式源码[查股公式]

2022/8/22 15:46:45

明 :红箭头买入;白箭头持股;绿箭头卖出。

注:请将参数:
SHDRT  2  200  12  改为:
SHORT  2  200  12  (即D改为:O)

全部参数:
SHORT  2  200  12
LONG 2  200  26
MID  2  200  9
N1 2  100  6
LL1  2  100  20
LH1  2  100  80 
(抱歉,后面漏掉参数: LL1  2  100  20
LH1  2  100  80  )

{MACD买卖}
M21:=MA(C,21);
M55:=MA(C,55);
A0:=M21>REF(M21,1) AND M55>REF(M55,1);
A1:=COUNT(V>REF(V,1),2)>=2;
A3:=KDJ.K>KDJ.D;
A4:=MACD.DIF>0;
A5:=CCI.CCI>100;
A6:=C>BOLL.BOLL;
{ST:=IF(NAMELIKE('S'),0,1) AND IF(NAMELIKE('*'),0,1);}
S2:=DYNAINFO(4)>0;
A0 AND A1 AND A3 AND A4 AND A5 AND A6 AND S2;
DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:EMA(DIF,MID);
MACD:(DIF-DEA)*2,COLORSTICK;
IF(DIF<REF(DIF,1),DIF,DRAWNULL),COLORGREEN,LINETHICK2;
IF(DIF>=REF(DIF,1),DIF,DRAWNULL),COLORRED,LINETHICK2;
{MACD提示};

B1:=REF(C,A1+1)> C AND REF("MACD.DIF",A1+1)<"MACD.DIF" AND CROSS("MACD.DIF","MACD.DEA");
DRAWICON(B1>0,DIF*1.21,1);{MACD底背离}
C1:=BARSLAST(REF(CROSS("MACD.DEA","MACD.DIF"),1));
D1:=REF(C,C1+1)<C AND REF("MACD.DIF",C1+1)> "MACD.DIF" AND CROSS("MACD.DEA","MACD.DIF");
DRAWICON(D1>0,DEA*1.21,2);{MACD顶背离};



WQ:="RSI.RSI1"(N1,2,2);
ENTERLONG:CROSS(WQ,LL1),COLORRED;
EXITLONG:CROSS(LH1,WQ),COLORGREEN;



DIFF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);


ZERO:0;
GJ:=MAX(C,O);
STICKLINE(MACD>0 AND MACD>=REF(MACD,1),0,MACD,2,0),COLOR0000FF;
STICKLINE(MACD>0 AND MACD<REF(MACD,1),0,MACD,2,0),COLORFFFF00;
STICKLINE(MACD<0 AND MACD>=REF(MACD,1),0,MACD,2,0),COLORFF00FF;
STICKLINE(MACD<0 AND MACD<REF(MACD,1),0,MACD,2,0),COLOR00FF00;
L4:=LLV(GJ,4);
JL:=(HHV(DIFF,55)-LLV(DIFF,55))/5;
GT:=DEA>REF(DEA,1) AND REF(DEA,1)<REF(DEA,2);
A1Y:=BARSLAST(REF(GT,1));
底背离:=REF(L4,A1Y+1)>CLOSE AND DIFF>REF(DIFF,A1Y+1) AND GT;
DRAWLINE(A1Y=0,DEA,底背离,REF(DEA,A1Y),0),COLORRED,LINETHICK2;
DRAWLINE(底背离,DEA,底背离,REF(DEA,A1Y),0),COLORRED,LINETHICK2;
DRAWTEXT(底背离,REF(DEA,A1)*1.18,' 底背离'),COLORFF00FF;
H4:=HHV(GJ,4);
GT2:=DEA<REF(DEA,1) AND REF(DEA,1)>REF(DEA,2);
A2:=BARSLAST(REF(GT2,1));
顶背离:= REF(H4,A2+1)<H4 AND  DIFF<REF(DIFF,A2+1) AND GT2;
DRAWLINE(A2=0  ,DEA,顶背离,REF(DEA,A2),0),COLORGREEN,LINETHICK2;
DRAWLINE(顶背离,DEA,顶背离,REF(DEA,A2),0),COLORGREEN,LINETHICK2;
DRAWTEXT(顶背离,REF(DEA,A2)*1.18,' 顶背离'),COLORGREEN;

相关文章列表
天天查股公式列表

股票公式分类

天天查股:股票行情消息 实时DDX在线 资金流向 千股千评 业绩报告 十大股东 最新消息 超赢数据 大小非解禁 停牌复牌 股票分红数据 股票评级报告
广告客服:315126368   843010021
爱股网免费查股,本站内容与数据仅供参考,不构成投资建议,据此操作,风险自担,股市有风险,投资需谨慎。 沪ICP备15043930号-29