【通達(dá)信】OBV和MACD結(jié)合(比、基、點(diǎn)、零點(diǎn))-指標(biāo)公式源碼 VA:=IF(CLOSE>REF(CLOSE,1),VOL,-VOL); OBV:SUM(IF(CLOSE=REF(CLOSE,1),0,VA),0),COLORWHITE; MAOBV:=MA(OBV,30); 零點(diǎn):(CONST(LLV(OBV,90))+CONST(HHV(OBV,90)))/2,CIRCLEDOT,COLORWHITE; DI:=EMA(CLOSE,12)-EMA(CLOSE,26); F分:=CONST(LLV(DI,90)); F百:=CONST(HHV(DI,90))-F分; 點(diǎn):=CONST(LLV(OBV,90)); 基:=CONST(HHV(OBV,90))-點(diǎn); F比:=(DI-F分)/F百; XFX:=F比*基+點(diǎn); DIF:=XFX,LINETHICK2; DEA:=EMA(DIF,9),LINETHICK2; MACD:(DIF-DEA)*2+零點(diǎn); STICKLINE(MACD>零點(diǎn),零點(diǎn),MACD,0,0),COLORRED; STICKLINE(MACD<零點(diǎn),零點(diǎn),MACD,0,0),COLORCYAN; MAV:=MA(VOL,30); DRAWICON(VOL>MA(VOL,30)*3 AND CLOSE>REF(CLOSE,1),零點(diǎn),1); DRAWICON(VOL>MA(VOL,30)*3 AND CLOSE>REF(CLOSE,1) AND REF(VOL,1)>MA(VOL,30)*3,零點(diǎn)+10,11); |
|