「翔博精选指标」北斗八星 和 六脉神剑(通达信公式 副图 源码
2022-02-11原创 编 辑:翔博软件
分享两个副图公式: 北斗八星 和 六脉神剑
没未来函数不加密
其实公式简单明了不用多说
{北斗八星}
{}
{}
{8}
F:=71;F10:=13;F15:=3;F11:=12;F12:=9;F13:=7;
{1}
BBI:=(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4;
DRAWICON(C>BBI,105,1);
DRAWTEXT(ISLASTBAR=1,IF(C>BBI,100,100),' 1'),COLORWHITE;
{2MACD}
DIFF:=EMA(C,F11)-EMA(C,F);
DEA:=EMA(DIFF,F12);
MACD:=2*(DIFF-DEA);
DRAWICON(MACD>REF(MACD,1),90,1);
DRAWTEXT(ISLASTBAR=1,IF(MACD>REF(MACD,1),90,90),' 2'),COLORWHITE;
{3KDJ}
RSV:=(C-LLV(L,F))/(HHV(H,F)-LLV(L,F))*100;
K:=SMA(RSV,F10,1);
D:=SMA(K,F15,1);
J:=3*K-2*D;
DRAWICON(J>REF(J,1),80,1);
DRAWTEXT(ISLASTBAR=1,IF(J>REF(J,1),80,80),' 3'),COLORWHITE;
{4, 47}
MA1:=EMA(C,F13);
DRAWICON(C>MA1,70,1);
DRAWTEXT(ISLASTBAR=1,IF(C>MA1,70,70),' 4'),COLORWHITE;
{5 RSI7,13}
WLC:= REF(C,1);
RSI1:=SMA(MAX(C-WLC,0),F13,1)/SMA(ABS(C-WLC),F13,1)*100;
RSI2:=SMA(MAX(C-WLC,0),F10,1)/SMA(ABS(C-WLC),F10,1)*100;
DRAWICON(RSI1>RSI2,60,1);
DRAWTEXT(ISLASTBAR=1,IF(RSI1>RSI2,60,60),' 5'),COLORWHITE;
{6}
VAR6:=(2*C+H+L)/4;
VAR8:=LLV(L,34);
VARB:=HHV(H,34);
VARC:=EMA((VAR6-VAR8)/(VARB-VAR8)*100,8);
VARD:=EMA(VARC,5);
DRAWICON (VARC-VARD<0,50,2);
DRAWICON(VARC-VARD>0,50,1);
DIFF:=EMA(CLOSE,8)-EMA(CLOSE,13);
DEA:=EMA(DIFF,5);
A1:=DIFF>DEA;
MACD金叉:IF(A1,1,0),COLORRED;
RSV1:=(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8))*100;
K:=SMA(RSV1,3,1);
D:=SMA(K,3,1);
DRAWICON(K>D,2,1);
DRAWICON(K<D,2,2);
DRAWTEXT(ISLASTBAR=1,2,'.KDJ'),COLORFFFFFF;
A2:=K>D;
KDJ金叉:IF(A2,2,0),COLORRED;
LC:=REF(CLOSE,1);
RSI1:=(SMA(MAX(CLOSE-LC,0),5,1))/(SMA(ABS(CLOSE-LC),5,1))*100;
RSI2:=(SMA(MAX(CLOSE-LC,0),13,1))/(SMA(ABS(CLOSE-LC),13,1))*100;
DRAWICON(RSI1>RSI2,3,1);
DRAWICON(RSI1<RSI2,3,2);
DRAWTEXT(ISLASTBAR=1,3,'.RSI'),COLORFFFFFF;
A3:=RSI1>RSI2;
RSI金叉:IF(A3,3,0),COLORRED;
RSV:=-(HHV(HIGH,13)-CLOSE)/(HHV(HIGH,13)-LLV(LOW,13))*100;
LWR1:=SMA(RSV,3,1);
LWR2:=SMA(LWR1,3,1);
DRAWICON(LWR1>LWR2,4,1);
DRAWICON(LWR1<LWR2,4,2);
DRAWTEXT(ISLASTBAR=1,4,'.LWR'),COLORFFFFFF;
A4:=LWR1>LWR2;
LWR金叉:IF(A4,4,0),COLORRED;
BBI:=(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4;
DRAWICON(CLOSE>BBI,5,1);
DRAWICON(CLOSE<BBI,5,2);
DRAWTEXT(ISLASTBAR=1,5,'.BBI'),COLORFFFFFF;
A5:=CLOSE>BBI;
BBI金叉:IF(A5,5,0),COLORRED;
MTM:=CLOSE-REF(CLOSE,1);
MMS:=100*EMA(EMA(MTM,5),3)/EMA(EMA(ABS(MTM),5),3);
MMM:=100*EMA(EMA(MTM,13),8)/EMA(EMA(ABS(MTM),13),8);
DRAWICON(MMS>MMM,6,1);
DRAWICON(MMS<MMM,6,2);
DRAWTEXT(ISLASTBAR=1,6,'.MTM'),COLORFFFFFF;
A6:=MMS>MMM;
MTM金叉:IF(A6,6,0),COLORRED;
涨买入:IF((A1 AND A2 AND A3 AND A4 AND A5 AND A6) AND REF(A1 AND A2 AND A3 AND A4 AND A5 AND A6,1)=0,7,0),COLORYELLOW,LINETHICK2;
上涨:IF(A1 AND A2 AND A3 AND A4 AND A5 AND A6,7,0),COLORYELLOW,LINETHICK2;
晴天:BARSLASTCOUNT(A1 AND A2 AND A3 AND A4 AND A5 AND A6),NODRAW;
雨天:BARSLASTCOUNT(MACD金叉+KDJ金叉+RSI金叉+LWR金叉+BBI金叉+MTM金叉>0 AND MACD金叉+KDJ金叉+RSI金叉+LWR金叉+BBI金叉+MTM金叉<21 ),NODRAW;
雪天:BARSLASTCOUNT(MACD金叉+KDJ金叉+RSI金叉+LWR金叉+BBI金叉+MTM金叉=0),NODRAW;