macd顶背离公式
关键字:macd顶背离公式
macd的顶背离公式是什么,我们首先看一下macd指标关于顶背离的概念,顶背离就是指K线形态一浪比一浪高,而MACD的DIF线则出现一浪比一浪低的震荡下行走势,这也是现货黄金行情看空的前兆,持有多单的现货黄金投资者应该获利出逃,空单则即时入场布局。下面我们先看一下MACD的指标公式
DIFF : EMA(CLOSE,SHORT) – EMA(CLOSE,LONG);
DEA : EMA(DIFF,M);
MACD : 3*(DIFF-DEA), COLORSTICK;
在这个公式里,短期移动平均线设置为12天,长期移动平均线设置为26天。二值所形成的日偏差值均价连成白线DIF(在大田环球贵金属电子交易平台,白线DIFF显示为白柱的边),日离差平滑均价的计算周期设置为9天,连接成黄线DEA。
Macd的顶背离公式代码如下,我们在下载大田环球贵金属安装包时,通过安装包中的MACD模块里面的程序指令进行修改,然后导入交易平台系统完成安装:
DF:EMA(C,10)-EMA(C,25) COLOR6600FF;
DA:EMA(DF,9)*1 COLORGREEN;
MACD:EMA((DF-DA),1)*2 COLORBLUE;
XSZX:MACD/2,COLORSTICK;
D1:=CONST(LLV(MIN(DF,MACD),120));D2:=D1*(4/5);D3:=D1*(3/5);D4:=D1*(2/5);D5:=D1*(1/5);
G1:=CONST(HHV(MAX(DF,MACD),120));G2:=G1*(4/5);G3:=G1*(3/5);G4:=G1*(2/5);G5:=G1*(1/5);
JXD:=TROUGH(MACD,5,1);ZXD:=REF(JXD,1);
JJD:=TROUGH(C,5,1);ZJD:=REF(JJD,1);
XDGTJ:=EXIST(((JXD-ZXD)>0),2);
JDDTJ:=EXIST(((ZJD-JJD)>0),2);
DBLTJ:=(XDGTJ)AND(JDDTJ);
JXH:=PEAK(MACD,5,1);ZXH:=REF(JXH,1);
JJH:=PEAK(C,5,1);ZJH:=REF(JJH,1);
XHDTJ:=EXIST(((ZXH-JXH)>0),2);
JHGTJ:=EXIST(((JJH-ZJH)>0),2);
HBLTJ:=(XHDTJ)AND(JHGTJ);
HBL:IF(HBLTJ,G3,G1)COLORLIRED;DRAWTEXT(FILTER(HBLTJ,5),G3, ‘顶背离’)COLORYELLOW;
本文来源: 大田环球贵金属
最新内容
相关阅读
Risk Warning
Trading bullion and financial instruments carries significant risks and may not be suitable for all investors, requiring careful consideration of investment objectives, experience, and risk tolerance. Key risks include market volatility, leverage risks that can amplify gains or losses, liquidity issues that may prevent executing trades at desired prices, and technical failures in online trading systems. Prices fluctuate unpredictably, and past performance does not guarantee future results. CIDT Global Bullion Limited provides general market commentary but does not offer investment advice and is not liable for any losses incurred from reliance on its information, which may change without notice.
Jurisdiction Disclaimer
CIDT Global Bullion Limited's services are subject to local regulations and may not be available in all jurisdictions. Users are responsible for ensuring compliance with their local laws. Services are not provided in regions where they are prohibited by law, under international sanctions, or require licensing that the company does not hold. By using the platform, users confirm they are not in a restricted jurisdiction and accept full responsibility for legal compliance. The company reserves the right to decline or terminate services in restricted areas without prior notice.