把KDJ的MACD做成主图更加方便与分析【主图.附图.源码】加通达信的

2016-03-19 20:01:00来源:本站整理浏览:644

根据大家的要求我进一步把原来的幅图改成主图.再一次发给大家.源码不用理想币.但是你还是【不要拿了就走】.与人方便.还是回复一下.让更多的人知道.不更好吗.-------------
【A】大智慧的和通达信的.不是完全一样.这是因为各有特别的函数.不能取代. 也各有所长.
【B】用KDJ的J编辑MACD是有好处.但是你要是用在主图那就不一样了. 这个MACD的数据比原来的MACD大了十倍.百倍.所以和股价极其不协调.为此不得不加参数【PK】然而股价由一两块到几百块.指数则上千上万.所以为了明确看清楚【K线】就必须大幅度调整【PK】这个数据.大家看看我发的图.就明白了.
【C】我仔细研究一下参数【PK】每次换股都得调正太麻烦了---------------改用【PK:=50/C;】也可以的-----------通达信软件同样也可以的-----------------
大智慧的源码如下;-------------------------------------------------------------------

DRAWGBKlast(c>0,strip(R【】GB(0,0,60),RGB(0,0,0),0));
 PK:=50/C;  {后改的  不用再调正参数了}
A7:=(2*C+H+L)/4;
操作:WMA(a7,5),COLOR0000ff,linethick3;
 LLX:LLV(操作,2),COLORFF9900,linethick2; ;
 PARTLINE(操作,操作=LLX,rgb(0,200,200),操作<>LLX,rgb(255,0,0)),linethick2;
 Var1:LLV(a7,21),color00ffff,LINETHICK1;
 Var2:HHV(a7,21),color0044ff,LINETHICK1;
 {K线变色}
STICKLINE(CLOSE>=OPEN,OPEN,LOW,0.5,0 ),COLOR0000ff,LAYER0;
 STICKLINE(CLOSE>=OPEN,CLOSE,HIGH,0.5,0 ),COLOR0000ff,LAYER0;
 STICKLINE(CLOSE<OPEN,OPEN,LOW,0.5,0 ),COLOR00ff00,LAYER7;
 STICKLINE(CLOSE<OPEN,CLOSE,HIGH,0.5,0 ),COLOR00ff00,LAYER7;

 STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,8,0 ),COLOR002200;
 STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,7,0 ),COLOR004400;
 STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,6,0 ),COLOR006600;
 STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,5,0 ),COLOR008800;
 STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,4,0 ),COLOR00AA00;  
 STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,3,0 ),COLOR00BB00;
 STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,2,0 ),COLOR00CC00;
 STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,1,0 ),COLOR00DD00;
 STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,0,0 ),COLOR00DD00;

 STICKLINE(close>open,close,open,8,0) ,COLORFF00FF;
 STICKLINE(close>open,close,open,7,0) ,COLORFF22FF;
 STICKLINE(close>open,close,open,6,0) ,COLORFF44FF;
 STICKLINE(close>open,close,open,5,0) ,COLORFF66FF;
 STICKLINE(close>open,close,open,4,0) ,COLORFF88FF;
 STICKLINE(close>open,close,open,3,0) ,COLORFF99FF;
 STICKLINE(close>open,close,open,2,0) ,COLORFFAAFF;
 STICKLINE(close>open,close,open,1,0) ,COLORFFBBFF;
 STICKLINE(close>open,close,open,0,0) ,COLORFFBBFF;

 RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
 K:=SMA(RSV,3,1);
 D:=SMA(K,3,1);
 J:=3*K-2*D;
 DIFF:(EMA(J,8) - EMA(J,16))/PK,COLOR00FF00,LAYER0;;
 DEA:EMA(DIFF,5),COLORFF9900,LAYER0;;
 MACD:2*(DIFF-DEA), COLORSTICK;
 0,COLORff9900,DOTLINE;
 FILLRGN(DIFF,DEA,DIFF>DEA,RGB(80,0,80),DIFF<DEA,RGB(0,120,60)),LAYER7;
 DRAWTEXTABS(5,10,"■叠加KDJ的坐标参数与股票价格有关需要调整.在不重叠的条件下尽可能的放大K线:【 PK="+PK+"】"),COLOR00FFFF,LINETHICK3,LAYER0;
 DRAWTEXTABS(5,30,"■现在KDJ的参数是:N=9,M1=3,M2=3;"),COLOR00FF00,LINETHICK3,LAYER0;
 DRAWTEXTABS(5,50,"■【KDJ】的【MACD】的参数是:LONG=8,LONG=16,M=5;"),COLOR0049FF,LINETHICK3,LAYER0;

 {高抛低吸}
MA5:=MA(CLOSE,5);
 DIFFG:=(EMA(C,12) - EMA(C,26));
 DEAG:=EMA(DIFFG,9);
 MACDG:=2*(DIFFG-DEAG);
卖:=CROSS((MA5<REF(MA5,1) AND MACDG<REF(MACDG,1) AND J<REF(J,1)),(MA5>REF(MA5,1) AND MACDG>REF(MACDG,1) AND J>REF(J,1)));
 DRAWTEXT(FILTER(卖,5),H*1.112,"★卖"),COLOR00FF00;
 STICKLINE(FILTER(卖,5),H*1.15,H,0,0),COLOR05FF00;
买:=CROSS((MA5>REF(MA5,1) AND MACDG>REF(MACDG,1) AND J>REF(J,1)),(MA5<REF(MA5,1) AND MACDG<REF(MACDG,1) AND J<REF(J,1)));
 DRAWTEXT(FILTER(买,5),L*0.83,"★买"),COLOR0000FF;
 STICKLINE(FILTER(买,5),L*0.8,L,0,0),COLOR0555FF;

通达信的源码如下--------------------------------------------【PK】参数 0,50000,5.填入表格里-----------咱们也可以不用这个参数了----------------------------
DRAWGBK(O>C,RGB(0,30,0),RGB(0,0,60),0,'01',0);
PK:=50/C; {后改的 不用再调正参数了}
ZK1:(XMA(XMA(H,25),25)-XMA(XMA(L,25),25))*1+XMA(XMA(H,25),25),DOTLINE,COLORWHITE;
ZD1:XMA(XMA(L,25),25)-(XMA(XMA(H,25),25)-XMA(XMA(L,25),25))*1,DOTLINE,COLORWHITE;
BS:(XMA(XMA(H,60),60)-XMA(XMA(L,60),60))*2.2+XMA(XMA(H,60),60),DOTLINE,COLORRED;
BD:XMA(XMA(L,60),60)-(XMA(XMA(H,60),60)-XMA(XMA(L,60),60))*2.8,DOTLINE,COLORGREEN;
DRAWTEXT(ISLASTBAR,ZK1,STRCAT(' ←【卖出】= ',CON2STR(ZK1,2))),COLOR00FFFF;
DRAWTEXT(ISLASTBAR,ZD1,STRCAT(' ←【买入】= ',CON2STR(ZD1,2))),COLORWHITE;
DRAWTEXT(ISLASTBAR,BS,STRCAT(' ←【顶部】= ',CON2STR(BS,2))),COLOR0044FF;

[1] [2]  下一页

股票公式栏目导航

精品指标推荐

最新热门

本类随机推荐

相关公式