當前位置: 網站首頁 > 股票軟件公式 > 通達信公式 > 文章 當前位置: 通達信公式 > 文章

通達信源碼精選:精準紅綠波段,盯莊跟莊,日周MACD同圖

點擊: 次    來源:頂尖財經    作者:股市狙擊 - 小 + 大

1、精準紅綠波段

VAR1:=(HHV(HIGH,9)-LLV(LOW,9));

VAR2:=(HHV(HIGH,9)-CLOSE);
VAR3:=(CLOSE-LLV(LOW,9));
VAR4:=VAR2/VAR1*100-70 ;
VAR5:=(CLOSE-LLV(LOW,60))/(HHV(HIGH,60)-LLV(LOW,60))*100; 
VAR6:=(2*C+H+L)/4;
VAR7:=SMA((VAR3/VAR1*100),3,1);
VAR8:=LLV(LOW,34);
VAR9:=SMA(VAR7,3,1)-SMA(VAR4,9,1);
VAR10:= IF(VAR9>100,VAR9-100,0);
VARA:=HHV(HIGH,34);
防線:=EMA((VAR6-VAR8)/(VARA-VAR8)*100,8);
B1:=EMA(防線,5);
見紅建倉:STICKLINE(防線-B1>0,防線,B1,8,1),COLORRED;
綠出離場:STICKLINE(防線-B1<0,防線,B1,8,1),COLOR00FF00;
快樂炒股:STICKLINE(防線>0 AND 防線-B1>=0,2,8,6,0),COLORRED;
離場休息:STICKLINE(防線>0 AND 防線-B1<0,2,8,6,0),COLOR00FF00;
警:88,LINETHICK3,COLORRED;
戒:20,LINETHICK3,COLORGREEN;
Y:0,LINETHICK2,COLORBLUE;


2、盯莊跟莊

{盯莊跟莊}

VAR4:=3*SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH, 75)-LLV(LOW,75))*100, 20, 1)-2*SMA(SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100, 20, 1), 15, 1);
VAR5:=3*SMA((OPEN-LLV(LOW,75))/(HHV(HIGH, 75)-LLV(LOW,75))*100, 20, 1)-2*SMA(SMA((OPEN-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100, 20, 1), 15, 1);
VAR6:=100-VAR5;
VAR7:=100-VAR4;
A1:=REF(C,1);
A2:=100*V/CAPITAL*10; 
AA:=CROSS(VAR6,VAR7) AND VAR4<25 ;
AAB:=CROSS(VAR6,VAR7) AND VAR4>30 AND  VAR4<50 ;
ABC:=CROSS(VAR6,VAR7) AND VAR4>50 AND  VAR4<65;
STICKLINE(VAR7<REF(VAR6, 1), -1*VAR7, -1*VAR6, A2,1), COLORRED;
VA1:=MA(VAR6,3);
STICKLINE(-1*VAR7>VA1, -1*VAR7, -1*VAR6,A2,1);
STICKLINE(VAR7>=REF(VAR6, 1), -1*VAR7, -1*VAR6, A2,1),COLORBLUE;
FORCAST(-1*VAR6,21);
百萬:=MA(WINNER(C),9)*100;
BB:=CROSS(百萬,2.5) ;
BB*-85,LINETHICK4,STICK;
DRAWTEXT(BB,-40,'..新莊介入');
DRAWTEXT(AAB,-80,'叮莊');
{DRAWTEXT(ABC,-50,'梅開二度');}
DRAWTEXT(AA,-70,'跟莊'),COLORRED;
{股民學院 www.243679.tw 整理}



3、日周MACD同圖

日周KDJ 日周MACD,兩個副圖公式

 {日周MACD同圖}
DRAWTEXT_FIX(1,0.01,0.01,0,'1、在日線觀察周MACD,與它在周線的樣子是一樣的'),COLORWHITE;
DRAWTEXT_FIX(1,0.01,0.06,0,'2、在日線分析周MACD時,注意對應的最右邊一根K線是最近的這周'),COLORWHITE;
DRAWTEXT_FIX(1,0.01,0.11,0,'3、相應的,往左數第二根K線對應上周,接著是上上周...'),COLORWHITE;
DRAWTEXT_FIX(1,0.01,0.16,0,'4、周線MACD的具體數值看上方,這才是是正確的'),COLORWHITE;
{MACD}
DDATE:DATE,NODRAW,COLORRED;
DIF:EMA(C,12)-EMA(C,26),COLORWHITE;
DEA:EMA(DIF,9),COLORYELLOW;
MACD:(DIF-DEA)*2,NODRAW,COLORMAGENTA;
{顯示MACD柱}
STICKLINE(MACD>0,MACD,0,1,1),COLORRED;
STICKLINE(MACD<0,0,MACD,1,1),COLORGREEN;
TESTSKIP(PERIOD!=5);
{周MACD}
D1:=DATE;
DIF1:=MACD.DIF#WEEK;
DEA1:=MACD.DEA#WEEK;
WEK:=REFX(WEEKDAY<REF(WEEKDAY,1) OR
DATETODAY(DATE)-DATETODAY(REF(DATE,1))>=7,1) OR ISLASTBAR;
D2:=IF(WEK,D1,DRAWNULL);
DIF2:=IF(WEK,DIF1,DRAWNULL);
DEA2:=IF(WEK,DEA1,DRAWNULL);
周日期:ALIGNRIGHT(D2),NODRAW,COLORRED;
周DIF:ALIGNRIGHT(DIF2),NODRAW,COLORWHITE;
周DEA:ALIGNRIGHT(DEA2),NODRAW,COLORYELLOW;
周MACD:(周DIF-周DEA)*2,NODRAW,COLORMAGENTA;
A1:=CONST(LLV(MACD,150))*2;
Q:=0.6;
NOTEXTA1:A1,COLOR336699,DOTLINE;
{顯示周MACD柱}
STICKLINE(周MACD>0,A1,周MACD*Q+A1,1,1),COLOR0099FF;
STICKLINE(周MACD<0,A1,周MACD*Q+A1,1,1),COLOR999900;
{顯示周MACD均線}
NOTEXT周DIF:周DIF*Q+A1,DOTLINE,COLORLIRED;
NOTEXT周DEA:周DEA*Q+A1,DOTLINE,COLORCYAN;

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
{日周KDJ同圖}
DRAWTEXT_FIX(1,0.01,0.01,0,'1、在日線觀察周KDJ,與它在周線的樣子是一樣的'),COLORWHITE;
DRAWTEXT_FIX(1,0.01,0.06,0,'2、在日線分析周KDJ時,注意對應的最右邊一根K線是最近的這周'),COLORWHITE;
DRAWTEXT_FIX(1,0.01,0.11,0,'3、相應的,往左數第二根K線對應上周,接著是上上周...'),COLORWHITE;
DRAWTEXT_FIX(1,0.01,0.16,0,'4、周線KDJ的具體數值看上方,這才是是正確的'),COLORWHITE;
{KDJ}
DDATE:DATE,NODRAW,COLORRED;
RSV:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
K:SMA(RSV,3,1),COLORFFFFFF;
D:SMA(K,3,1),COLOR00FFFF;
J:3*K-2*D,COLORFF00FF;
TESTSKIP(PERIOD!=5);
{周KDJ}
D1:=DATE;
K01:=KDJ.K#WEEK;
D01:=KDJ.D#WEEK;
J01:=KDJ.J#WEEK;
WEK:=REFX(WEEKDAY<REF(WEEKDAY,1) OR DATETODAY(DATE)-DATETODAY(REF(DATE,1))>=7,1)
  OR ISLASTBAR;
D2:=IF(WEK,D1,DRAWNULL);
K02:=IF(WEK,K01,DRAWNULL);
D02:=IF(WEK,D01,DRAWNULL);
J02:=IF(WEK,J01,DRAWNULL);
周日期:ALIGNRIGHT(D2),NODRAW,COLORRED;
周K:ALIGNRIGHT(K02),NODRAW,COLORFFFFFF;
周D:ALIGNRIGHT(D02),NODRAW,COLOR00FFFF;
周J:ALIGNRIGHT(J02),NODRAW,COLORFF00FF;
A1:=CONST(LLV(J,150))*5;
Q:=0.6;
{NOTEXTA1:A1,COLOR336699,DOTLINE;}
{顯示周KDJ}
NOTEXT周K:周K*Q+A1,COLORFFFFFF,DOTLINE;
NOTEXT周D:周D*Q+A1,COLOR00FFFF,DOTLINE;
NOTEXT周J:周J*Q+A1,COLORFF00FF,DOTLINE;

 
KDJ和MACD是我們經常用到的公式,特別是它們在周線下的形態我們會特別關注,因此免不了經常在日周兩個周期內切換。本公式免去了這種切換的麻煩,同時又不像有些周線公式日顯時需要不斷縮小才能窺見全貌。
使用中需要注意的問題我已經在公式內做了說明,不需要可自行編輯刪除。

上一篇:通達信源碼精選:動量買賣,風險評測,頂和底

下一篇:通達信源碼精選:趨勢線,小散盯盤,精準短波

广东11选5最容易中奖