大智慧把KDJ的MACD做成主图更加方便与分析 源码
-
相关简介:把KDJ的MACD做成主图更加方便与分析 源码 附通达信的 【A】大智慧的和通达信的.不是完全一样.这是因为各有特别的函数.不能取代. 也各有所长. 【B】用KDJ的J编辑MACD是有好处.但是你要是用在主图那就不一样了. 这个MACD的数据比原来的MACD大了十倍.百倍.所以和股价极其不协调.为此不得不加参数【PK】然而股价由一两块到几百块.指数则上千上万.所以为了明确看清楚【K线】就必须大幅度调整【PK】这个数据.大家看看我发的图.就明白了. 【C】我仔细研究一下参数【PK】每次换股都得调正
-
文章来源:股海网作者:股海网发布时间:2016-11-19浏览次数:
把KDJ的MACD做成主图更加方便与分析 源码 附通达信的
【A】大智慧的和通达信的.不是完全一样.这是因为各有特别的函数.不能取代. 也各有所长.
【B】用KDJ的J编辑MACD是有好处.但是你要是用在主图那就不一样了. 这个MACD的数据比原来的MACD大了十倍.百倍.所以和股价极其不协调.为此不得不加参数【PK】然而股价由一两块到几百块.指数则上千上万.所以为了明确看清楚【K线】就必须大幅度调整【PK】这个数据.大家看看我发的图.就明白了.
【C】我仔细研究一下参数【PK】每次换股都得调正太麻烦了---------------改用【PK:=50/C;】也可以的-----------通达信软件同样也可以的-----------------
【D】其实高抛低吸现在的太过频繁咱们可以根据你的喜好变化变化比如可以用【RSI】这个指标:
{高抛低吸}
LC:=REF(CLOSE,1);
RSI1:=SMA(MAX(CLOSE-LC,0),3,1)/SMA(ABS(CLOSE-LC),3,1)*100;
SELL2:=(CROSS(85,RSI1));
DRAWTEXT(FILTER(SELL2,4),H*1.112,'★卖'),COLOR00FF00;
STICKLINE(FILTER(SELL2,4),H*1.15,H,0,0),COLOR05FF00;
VB1:=C-REF(C,1);
VB2:=100*EMA(EMA(VB1,6),6)/EMA(EMA(ABS(VB1),6),6);
VB3:=IF(LLV(VB2,2)=LLV(VB2,7) AND COUNT(VB2<0,2) AND CROSS(VB2,MA(VB2,2)),1,0);
VB4:=FILTER(VB3=1,5);
DRAWTEXT(FILTER(VB4,4),L*0.83,'★买'),COLOR006FFF;
STICKLINE(FILTER(VB4,4),L*0.8,L,0,0),COLOR006FFF;
大智慧的源码如下;
DRAWGBKlast(c>0,strip(RGB(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;