MACD背离指标公式源码:DIFF:EMA(CLOSE,9)-EMA(CLOSE,17);DEA:EMA(DIFF,8),COLOrffaa00;MACD:=2*(DIFF-DEA);STICKLINE(MACD>=0,MACD,0,4,1),COLORF00FF0;STICKLINE(MACD<0,MACD,0,4,1),colorwhite;STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,4,0 ),COLOR00aaff;...
一、MACD顶底背离副图 DIFF:EMA(CLOSE,12) - EMA(CLOSE,26);DEA:EMA(DIFF,9);MACD:2*(DIFF-DEA),COLORSTICK;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));B1:=REF(C,A1 1)>C AND REF(DIFF,A1 1)A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));B2:=REF(C,A2 1)>C AN...
A:=CROSSDOWN(DIFF,DEA)&&HH>HH2&&MHD<MHD2;//顶背离 B:=CROSS(DIFF,DEA)&&LL<LL2&&MLD>MLD2;//底背离 DRAWICON(A,MACD,5); DRAWICON(B,MACD,4);
D1:=REF(C,C1+1)<C AND REF(DIFF,C1+1)>DIFF AND CROSS(DEA,DIFF); STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,1,0),COLORRED; STICKLINE(MACD<=REF(MACD,1) AND MACD>0,0,MACD,1,0),COLORYELLOW; STICKLINE(MACD<REF(MACD,1) AND MACD<0,0,MACD,1,0),COLORCYAN; STICKLINE(MACD>...
自动画MACD背离线通达信指标公式源码 以下是通达信软件中计算MACD背离指标的源码: ``` /*功能:计算MACD背离线指标 公式:当股价形成新高而MACD指标不形成新高时,出现向下背离 当股价形成新低而MACD指标不形成新低时,出现向上背离 参数:无 返回值:无*/ indicator fn_DEVIATION_MACD...
MACD背离通达信指标公式源码DIF:EMA(CLOSE,12)-EMA(CLOSE,26); DEA:EMA(DIF,9); MACD:(DIF-DEA)*2,COLORSTICK; SWIFTK:="MACD.MACD" * REF("MACD.MACD",1)<0; EARLYDAY_1:=BARSLAST(SWIFTK,1); EARLYDAY_2:=BARSLAST(SWIFTK,2); EARLYDAY_3:=BARSLAST(SWIFTK,3);...
接下来,我们可以使用通达信的画线函数实现在背离点位置上自动画线。下面是该指标的示例源码: ```javascript /* 时间:2024-01-01 */ #include "stdio.h" #include "stdlib.h" #include "string.h" #include "windows.h" /* 定义MACD指标相应变量 */ double EMA_SHORT; double EMA_LONG; double DIFF; ...
MACD三背离通达信指标公式源码这里面有三种背离,1普通的背离,2红绿柱面积的背离,3红绿柱的背离。不过俺很奇怪,他要绿柱背离,绿柱子同一堆都有可能背离的,个人认为没有很大参考性。背离俺很少用,研究发现绿柱面积背离和macd普通底背离同时出现往往是要大幅上升倒是真的。
MACD柱线均势和背离通达信指标公式源码 1)MACD柱线均势公式: MAVL:MA(CLOSE,VOL);//计算成交量的均值,VOL表示成交量 REFMAVL:REF(MAVL,1);//取上一周期的成交量均值 DIFF:EMA(CLOSE,12)-EMA(CLOSE,26);//计算DIFF DEA:EMA(DIFF,9);//计算DEA...
MACD三背离通达信指标公式源码 以下是通达信软件中MACD三背离指标的公式源码: ```python #定义变量 VAR1:=CLOSE-REF(CLOSE,1); VAR2:=EMA(VAR1,12); VAR3:=EMA(VAR1,26); VAR5:=(VAR2-VAR3)/VAR2*100; VAR6:=EMA(VAR5,9); VAR7:=IF(VAR5>0,VAR5,VAR6); VAR8:=EMA(VAR7,9);...