大智慧OBV-金 结合MACD的OBV寻找买卖点更清楚实用幅图源码
大智慧原版OBV很难利用他寻找买卖点.这实用上咱们根本用不上.可是他又是同时反应量价的公式也正是我们所需要的.因为买卖股票量和价是密不可分的.K线图必需加成交量同时分析才有这种价值.所以OBV是个相当有用的公式.现在我们把OBV用NACD显示就恰当的解决了这个问题
可是在图形上同时显示成交量由于坐标不同配合不上.我们就同时编辑了两个公式放在一起使用.可以清楚的显示出买卖的位置.
【A】OBV+MACD的公式源码:---------------------------------在时间原版OBV是0.而我们改为可调整的参数更加适合K线变化的需要OBV也不是一定要由第一天开始统计变变更贴切K线图形.
{OBV-金}
input:BX(20,0,1000);
DRAWGBKlast(c>0,strip(RGB(0,0,160),RGB(0,0,0),0));
MAC:=WMA((2*C+H+L)/4,3);
JOBV:=SUM(IF(MAC>REF(MAC,1),VOL,IF(MAC<REF(MAC,1),-VOL,0)),BX);
OBVE:=(JOBV-LLV(JOBV,55))/(HHV(JOBV,55)-LLV(JOBV,55))*100;
DIFF:=WMA(OBVE,13)-WMA(OBVE,21);
DEA:=WMA(DIFF,8);
MACD:20*(DIFF-DEA), COLORSTICK;
20*(DIFF-DEA),COLOR00ff00,LINETHICK3,LAYER3;
PARTLINE(MACD,MACD>REF(MACD,1),rgb(255,0,0)),LINETHICK3,LAYER0;
{成交量}
OBVD:IF(MAC>REF(MAC,1),VOL/CAPITAL*100,IF(MAC<REF(MAC,1),-VOL/CAPITAL*100,0)),COLOR3D;
DRAWTEXTABS(50,10,'【关注量价方向的转换 SUM:'+bx+'天】'),COLOR00ffff,LINETHICK3;
【B】OBV+VOL公式源码:--------------------------和原版OBV不一样用MAC:=WMA((2*C+H+L)/4,3);替代收盘价更能说明问题.
{OBVV-金成交量}
DRAWGBKlast(c>0,strip(RGB(0,0,160),RGB(0,0,0),0));
MAC:=WMA((2*C+H+L)/4,3);
WOBV:WMA(SUM(IF(MAC>REF(MAC,1),VOL,IF(MAC<REF(MAC,1),-VOL,0)),3),5),COLOR00FF00,LINETHICK2;
PARTLINE(WOBV,WOBV>REF(WOBV,1),rgb(255,0,0)),LINETHICK3,LAYER0;
OBVD:IF(MAC>REF(MAC,1),VOL,IF(MAC<REF(MAC,1),-VOL,0)),COLOR3D;
用于分时的【FSDBV-金】源码:----------------------------
{FSOBV-J}
DRAWRECTREL(-1,0,1000,1000,RGB(0,0,50)),color0077FF,LINETHICK2,LAYER7;
OBV:=SUM(IF(C>REF(C,1),VOL,IF(C<REF(C,1),-VOL,0)),0);
DIFF:=EMA(OBV,18)-EMA(OBV,20);
DEA:=EMA(DIFF,8);
MACD:50*(DIFF-DEA),COLORSTICK,LAYER7;
50*(DIFF-DEA),COLOR00ff00,LINETHICK2,LAYER3;
PARTLINE(MACD,MACD>REF(MACD,1),rgb(255,0,0)),LINETHICK2,LAYER0;
{成交量}
STICKLINE(C>=REF(C,1),0,V,4,0 ),Color0077ff,LAYER0;
STICKLINE(C<REF(C,1),0,-V,4,0 ),Color00FFFF,LAYER0;