相關(guān)標(biāo)簽: 周K線疊及周量疊指標(biāo)詳解, 周K線疊加周MACD源碼, K線疊及周量疊源碼
?
用了一些變量和函數(shù)來(lái)獲取股票的日線和周線數(shù)據(jù),然后用不同的顏色和形狀來(lái)畫出K線圖和量能柱狀圖。K線圖可以顯示股票在一段時(shí)間內(nèi)的價(jià)格波動(dòng),量能柱狀圖可以顯示股票在一段時(shí)間內(nèi)的交易活躍程度。這樣可以幫助投資者分析股票的走勢(shì)和趨勢(shì)。
?
{輔助公式}
C1:CLOSE;
O1:OPEN;
H1:HIGH;
L1:LOW;
VVLA:VOL;
{日周K線疊加}
ccc1:="輔助公式.c1#week";
ooo1:="輔助公式.o1#week";
hhh1:="輔助公式.h1#week";
lll1:="輔助公式.l1#week";
vvar1:=if(WEEKDAY=3,hhh1,ccc1);
vvar2:=if(WEEKDAY=3,lll1,ooo1);
STICKLINE(ccc1>=ooo1,ooo1,ccc1,10,0),Color613076,LINEDOT;
STICKLINE(ccc1>=ooo1,vvar1,vvar2,3,0),Color613076;
STICKLINE(ooo1>ccc1,ccc1,ooo1,10,0),ColorFA7D32,LINEDOT;
STICKLINE(ooo1>ccc1,vvar1,vvar2,3,0),ColorFA7D32;
STICKLINE(C>=O,C,O,8,0),COLOR0000BB;
STICKLINE(C>=O,H,L,0,0),COLOR0000BB;
STICKLINE(C<=O,C,O,8,0),COLORFFFF00;
STICKLINE(C<=O,H,L,0,0),COLORffff00;
{周量疊加}
ccc1:="輔助公式.c1#week";
ooo1:="輔助公式.o1#week";
ZZL:="輔助公式.VVLA#week";
周量:ZZL,ColorFFff00,LINETHICK0;
STICKLINE(ccc1>ooo1 ,0,周量*0.45,10,0),Color613076,LINEDOT;
STICKLINE(ccc1<=ooo1 ,0,周量*0.45,10,0),ColorFA7D32,LINEDOT;
量:VOL,VOLSTICK;
MA1:MA(VOL,5);
MA2:MA(VOL,13);
MA3:MA(VOL,90);
大智慧用
{輔助001}
C1:CLOSE;
O1:OPEN;
H1:HIGH;
L1:LOW;
VVLA:VOL;
{日周K線疊加}
ccc1:="輔助001.c1#week";
ooo1:="輔助001.o1#week";
hhh1:="輔助001.h1#week";
lll1:="輔助001.l1#week";
vvar1:=if(WEEKDAY=3,hhh1,ccc1);
vvar2:=if(WEEKDAY=3,lll1,ooo1);
STICKLINE(ccc1>=ooo1,ooo1,ccc1,10,0),Color613076;
STICKLINE(ccc1>=ooo1,vvar1,vvar2,4,0),Color613076;
STICKLINE(ooo1>ccc1,ccc1,ooo1,10,0),ColorFA7D32;
STICKLINE(ooo1>ccc1,vvar1,vvar2,4,0),ColorFA7D32;
STICKLINE(C>=O,C,O,8,0),COLOR0000BB;
STICKLINE(C>=O,H,L,0,0),COLOR0000BB;
STICKLINE(C<=O,C,O,8,0),COLORFFFF00;
STICKLINE(C<=O,H,L,0,0),COLORffff00;
{周量疊加}
ccc1:="輔助001.c1#week";
ooo1:="輔助001.o1#week";
ZZL:="輔助001.VVLA#week";
周量:ZZL,ColorFFff00,LINETHICK0;
STICKLINE(ccc1>ooo1 ,0,周量*0.45,10,0),Color613076;
STICKLINE(ccc1<=ooo1 ,0,周量*0.45,10,0),ColorFA7D32;
量:VOL,VOLSTICK;
STICKLINE(C>=O,量,0,8,1),COLOR0000BB;
STICKLINE(C<=O,量,0,8,0),COLORFFFF00;
通達(dá)信用
{引用}
XA:=BARSLAST(WEEKDAY=1)+1;
BZ:=WEEKDAY=2;
O1:REF(O,BZ);
C1:C;
H1:HHV(H,XA);
L1:LLV(L,XA);
周量:SUM(V,XA)*0.4,COLORFF0000,LINETHICK0
{疊加周K線}
WO:="引用.O1#WEEK",LINETHICK1;
WC:="引用.C1#WEEK",LINETHICK1;
WH:="引用.H1#WEEK",LINETHICK1;
WL:="引用.L1#WEEK",LINETHICK1;
VVAH:=IF(WEEKDAY=3,WH,WC);
VVAL:=IF(WEEKDAY=3,WL,WO);
AD:=WC>=WO;
AF:=WO>=WC;
STICKLINE(AD ,WO,WC,4,0),COLOR73599D;
STICKLINE(AD ,VVAH,VVAL,1.5,0),COLOR73599D;
STICKLINE(AF ,WC,WO,4,0),COLOR8A8E31;
STICKLINE(AF ,VVAH,VVAL,1.5,0),COLOR8A8E31;
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
{疊加周量}
Z周:="引用.周量#WEEK",LINETHICK0;
WO:="引用.O1#WEEK",LINETHICK0;
WC:="引用.C1#WEEK",LINETHICK0;
AD:=WC>WO;
AF:=WC<=WO;
STICKLINE(AD,Z周,0,4,0),COLOR73599D;
STICKLINE(AF,Z周,0,4,0),COLOR8A8E31;
量:VOL,LINETHICK0,VOLSTICK;
MA1:MA(VOL,5);
MA2:MA(VOL,13);
MA3:MA(VOL,90);
?
公式導(dǎo)入教程: 【通達(dá)信公式源碼導(dǎo)入方法教程】 【同花順公式源碼導(dǎo)入方法教程】 【大智慧新一代公式源碼導(dǎo)入方法教程】
?