如何編寫通達信macd主圖指標原始碼

時間 2021-08-30 11:15:23

1樓:醉笑天地

dif:ema(close,12)-ema(close,26);

dea:ema(dif,9);

macd:(dif-dea)*2,colorstick;

2樓:欣茹意

單擊macd,然後進行編輯就可以了

3樓:指標公式編寫

dif:100*(ema(close,12)-ema(close,26)),colorwhite,linethick1;

dea:ema(dif,9),coloryellow,linethick1;

macd:(dif-dea)*2,colorstick;

stickline(macd>ref(macd,1)and macd>0,0,macd,0.2,0),colorred;

stickline(macd0,0,macd,0.2,0),coloryellow;

stickline(macd>ref(macd,1)and macd<0,0,macd,0.2,0),colorblue;

stickline(macd=0 and count(macd>ref(macd,1),1)=1;

fh3:=fh1 and fh2 and ema(c,13)>ref(ema(c,13),1);

fh4:=fh1 and fh2 and abs((dif-dea)/c)<0.018;

fh5:=fh1 and fh2 and macd<0.10;

二次翻紅:=(fh3 or fh4 or fh5),colorred,nodraw;

低買:=cross(dif,dea) and dif<0,colorff00ff,nodraw;

加油:=cross(dif,dea) and dif>0,coloryellow,nodraw;

drawicon(二次翻紅,-0.05,1);

drawtext(二次翻紅,-0.15,'↖翻紅'),colorred;

drawtext(cross(dif,dea) and dif<0,dea-0.02,'↖低買'),colorff00ff;

drawtext(cross(dif,dea) and dif>0,dea-0.05,'↖加油'),coloryellow;

ylzc:=if(close=indexc,(indexc+indexh+indexl+indexo)/4,amount/(vol+0.01)/100);

w1:=c>ref(c,4);

nt:=barslastcount(w1);

tj11:=nt=9;

tj13:=islastbar and between(nt,5,8);

ay:=(backset(tj11>0,9) or backset(tj13>0,nt))*nt;

drawtext(ay>0,macd*1.02,var2str(ay,0)),colorlired;

drawtext(nt=9,macd*1.02,'9'),colorgreen;

q1:=c0,9) or backset(tj23>0,nt0))*nt0;

drawtext(ay1>0,macd*0.98,var2str(ay1,0)),colorgreen;

drawtext(nt0=9,macd*0.98,'9'),colorred;

drawicon(cross(dif,dea),dea,1);

drawicon(cross(dea,dif),dea,2);

死叉:=cross(dea,dif);

n1:=barslast(死叉),nodraw;

n2:=ref(barslast(死叉),n1+1),nodraw;

n3:=ref(barslast(死叉),n2+n1+2),nodraw;

cl1:=llv(c,n1+1),nodraw;

difl1:=llv(dif,n1+1),nodraw;

cl2:=ref(cl1,n1+1),nodraw;

difl2:=ref(difl1,n1+1),nodraw;

cl3:=ref(cl2,n1+1),nodraw;

difl3:=ref(difl2,n1+1),nodraw;

pdifl2:=if(difl2>0,intpart(log(difl2))-1,intpart(log(-difl2))-1);

mdifl2:=intpart(difl2/pow(10,pdifl2));

pdifl3:=if(difl3>0,intpart(log(difl3))-1,intpart(log(-difl3))-1);

mdifl3:=intpart(difl3/pow(10,pdifl3));

mdifb2:=intpart(dif/pow(10,pdifl2));

mdifb3:=intpart(dif/pow(10,pdifl3));

直接底背離:=(cl1mdifl2) and (macd<0 and ref(macd,1)<0) and mdifb2<=ref(mdifb2,1);

隔峰底背離:=(cl1mdifl3) and (macd<0 and ref(macd,1)<0) and mdifb3<=ref(mdifb3,1);

底部鈍化:=直接底背離 or 隔峰底背離,nodraw;

底背離:=((mdifb2>ref(mdifb2,1))*ref(直接底背離,1)) or ((mdifb3>ref(mdifb3,1))*ref(隔峰底背離,1)),nodraw;

stickline(底部鈍化,dif,dea,1,0),colorred;

drawtext(tfilter(底背離,c0,intpart(log(difh2))-1,intpart(log(-difh2))-1);

mdifh2:=intpart(difh2/pow(10,pdifh2));

pdifh3:=if(difh3>0,intpart(log(difh3))-1,intpart(log(-difh3))-1);

mdifh3:=intpart(difh3/pow(10,pdifh3));

mdift2:=intpart(dif/pow(10,pdifh2));

mdift3:=intpart(dif/pow(10,pdifh3));

直接頂背離:=(ch1>ch2 ) and (mdift20 and ref(macd,1)>0) and mdift2>=ref(mdift2,1);

隔峰頂背離:=(ch1>ch3 and ch3>ch2 ) and (mdift30 and ref(macd,1)>0) and mdift3>=ref(mdift3,1);

頂部鈍化:=直接頂背離 or 隔峰頂背離,nodraw;

頂背離:=((mdift2ref(ch1,1),1),dif*1.02,'頂部結構形成'),colormagenta;

drawicon(cross(dif,dea),dea,36);

drawicon(cross(dea,dif),dea,37);

macddif:=if(abs(macd)>abs(dif),macd,dif);

drawicon(ref(dif,1)>ref(dif,2) and dif0 and dif>dea,macddif*1.1,39),colorgreen;

drawicon(ref(dif,1)ref(dif,1) and dif<0 and difref(macd ,1) and ref(macd ,1)dea,dif,drawnull)color0099ff;

a1:=barslast(ref(cross('macd.dif','macd.dea'),1));

b1:=ref(c,a1+1)>c and ref('macd.dif',a1+1)<'macd.

dif' and cross('macd.dif','macd.dea');

drawicon(b1>0,llv(dif,60)*0.84,1);

drawtext(b1>0,llv(dif,60)*0.85,'macd底背離'),color9900ff;

macd底背離:=b1>0 and llv(dif,60)*0.85;

c1:=barslast(ref(cross("macd.dea","macd.dif"),1));

d1:=ref(c,c1+1)"macd.dif" and cross("macd.dea","macd.dif");

drawicon(d1>0,hhv(dif,60)*0.84,2);

drawtext(d1>0,hhv(dif,60)*0.85,'m頂背離'),color00ff00;

a2:=barslast(ref(cross("kdj.k","kdj.d"),1));

b2:=ref(c,a2+1)> c and ref("kdj.k",a2+1)<"kdj.k" and cross("kdj.k","kdj.d") ;

drawicon(b2>0,llv(dif,60)*0.59,1);

drawtext(b2>0,llv(dif,60)*0.60,'k底背'),colorff33ff;

k底背:=b2>0 and llv(dif,60)*0.60;

c2:=barslast(ref(cross("kdj.d","kdj.k"),1));

d2:=ref(c,c2+1)"kdj.k" and cross("kdj.d","kdj.k") ;

drawicon(d2>0,hhv(dif,60)*0.59,2);

drawtext(d2>0,hhv(dif,60)*0.60,'k頂背'),colorffff99;

a3:=barslast(ref(cross("rsi.rsi1","rsi.rsi2"),1));

b3:=ref(c,a3+1)> c and ref("rsi.rsi1",a3+1)<"rsi.

rsi1" and cross("rsi.rsi1","rsi.rsi2") ;

drawicon(b3>0,llv(dif,60)*0.34,1);

drawtext(b3>0,llv(dif,60)*0.35,'rsi底背'),color00ffff;

rsi底背:=b3>0 and llv(dif,60)*0.35;

c3:=barslast(ref(cross("rsi.rsi2","rsi.rsi1"),1));

d3:=ref(c,c3+1)"rsi.rsi1" and cross("rsi.rsi2","rsi.rsi1") ;

drawicon(d3>0,hhv(dif,60)*0.34,2);

drawtext(d3>0,hhv(dif,60)*0.35,'rsi頂背'),colorffcc99;

jc:=dea-dif;

綠柱:=if(macd<0,sum(macd,barslast(jc<0)),0);

紅柱:=if(macd>0,sum(macd,barslast(jc>0)),0);

本次最低價:=llv(l,barslast(jc<0));

本次最**:=hhv(h,barslast(jc>0));

x1:=if (macd<0,barslast(cross(dif,dea)),0);

前次綠柱:=ref(綠柱,x1+1);

前次最低價:=ref(本次最低價,x1+1);

y1:=if((綠柱<0 and abs(綠柱)0,barslast(cross(dea,dif)),0);

指標編寫看我頭像

前次紅柱:=ref(紅柱,x2+1);

前次最**:=ref(本次最**,x2+1);

y2:=if((紅柱》0 and 紅柱《前次紅柱 and 本次最**》前次最**),1,0);

rs2:=macd>0 and ref(macd,1)>0 and c>前次最** and abs(紅柱)

求助通達信大神MACD編寫,下面公式是日線附圖指標,怎麼改成附圖日周月同時顯示並改成選股公式

可以,但由於週期不同,各週期數值疊加後,你會被影象整的眼花繚亂的,並且,影象變形沒有什麼實際意義。 你的意思是將 日周月 指標疊加在主圖上,還是副圖上?kdj.j week c month 試試吧,不過好像在主圖的日線上有失真的現象 通達信分析圖日 圖副圖怎麼更改顯示macd 50 分析圖副圖怎麼調...

通達信軟體裡如何新增副圖,如何把通達信的副圖指標修改成主圖指標?

在通達信 軟體裡新增副圖方法及步驟如下 第一步 副圖指標的製作 一 首先開啟通達信 軟體,點選左上角的 功能 公式系統 公式管理器 如下圖 二 點選 技術指標公式 其他型別 再點選右上角的 新建 如下圖 三 在出來的介面中,將之前準備好的指標文字內容複製 貼上到下方的空白處,然後在左上角填上公式的名...

請問,通達信軟體如何把KDJ與MACD結合在指標裡,但只保留J線與MACD的柱狀線?拜託各位大神

可以編寫把kdj指標合macd指標合在一起,只保留j線跟macd柱效果如下圖 第一個副圖是合成的效果,第二第三個幅圖分別是macd和kdj指標 通達信軟體怎麼同時看成交量,macd.kdj三個指標?10 怎麼把通達信軟體macd指標藍色的柱狀線變為綠色 遊樂裝置 引數還是macd原來的引數,保持不變...