OBV(资金流量和能量流量)指标公式

2015-06-07 22:45 阅读 128 次 评论关闭

1、OBV(资金流量)
INPUT:N(9,1,100);
TYP := (HIGH + LOW + CLOSE)/3;
rs:=SUM(IF(TYP>REF(TYP,1),TYP*VOL,0),N)

/SUM(IF(TYP<=REF(TYP,1),TYP*VOL,0),N);
MFI:=100-100/(1+rs);
资金流量:MFI,LINETHICK0;
a1:=SUM(IF(MFI>REF(MFI,1),VOL,IF(MFI<REF(MFI,1),-VOL,0)),0);{OBV}
RSV:=(a1-LLV(a1,34))/(HHV(a1,34)-LLV(a1,34))*100;
K:SMA(RSV,5,1);
D:SMA(K,3,1);
J:3*K-2*D;
50,colorgray,LINEDOT;
80,COLORRED,LINEDOT;

2、OBV.MACD(能量)
INPUT:N(9,1,10);
LC := REF(CLOSE,1);
a1:=SMA(MAX(CLOSE-LC,0),N,1)/SMA(ABS(CLOSE-LC),N,1)*100; {RSI}
DIFF:-1*(EMA(a1,26) - EMA(a1,12))/200,COLORCYAN;
DEA:-1*(EMA(DIFF,9))/200,COLORRED;
MACD:2000*(DIFF-DEA),COLORSTICK,LINETHICK2;
{柱线颜色}
s1:=MACD<REF(MACD,1)and MACD>0;
s2:=MACD<REF(MACD,1)/2 and MACD<0;
STICKLINE(MACD>=0,MACD,0,8,1),COLORRED;
STICKLINE(s1,0,MACD,8,1),COLOR00ffff;
STICKLINE(s2,0,MACD,8,0),COLORffffff;
STICKLINE(MACD>REF(MACD,1)and MACD<0,0,MACD,8,1),COLORffff00;

80,COLORMAGENTA,LINEDOT;

版权声明:本文著作权归原作者所有,欢迎分享本文,谢谢支持!
转载请注明:OBV(资金流量和能量流量)指标公式 | 猎微网

评论已关闭!