通达信公式源码概况:
指标类别:通达信公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
公式解读:
公式源码如下:
VAR1:=REF((LOW+OPEN+CLOSE+HIGH)/4,1);
VAR2:=SMA(ABS(LOW-VAR1),13,1)/SMA(MAX(LOW-VAR1,0),10,1);
VAR3:=EMA(VAR2,10);
VAR4:=LLV(LOW,33);
趋势线:3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1)-2*SMA(SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1),3,1),COLOR00FFFF;
见底信号:1;
买入时机:IF(CROSS(趋势线,见底信号),100,0),COLORRED,LINETHICK2;
VAR5:=EMA(IF(LOW =VAR4,VAR3,0),3);
STICKLINE(VAR5 REF(VAR5,1),0,VAR5,4,0),COLOR00FFFF;
STICKLINE(VAR5 REF(VAR5,1),0,VAR5,4,0),COLOR00FFFF;
极品底:IF((MA(C,5)-C)/C 0.04AND(MA(C,10)-MA(C,5))/MA(C,5) 0.04,100,0),LINETHICK2,COLORRED;
DRAWICON(极品底=100,100,1),LINETHICK0,COLORRED;
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;
X:=LLV(J,2)=LLV(J,8);
DRAWTEXT(CROSS(J,REF(J+0.01,1))ANDXANDJ 19,10, 低进 ),COLORFFFF00;
DRAWTEXT(CROSS(J,REF(J+0.01,1))ANDXANDJ 19,25, ▲ ),COLORRED;
DRAWTEXT(CROSS(J,REF(J+0.01,1))ANDXANDJ 19,20, ▲ ),COLORRED;
DRAWTEXT(CROSS(J,REF(J+0.01,1))ANDXANDJ 19,17, ↑ ),COLORRED;
:=EMA(((2*CLOSE+HIGH+LOW)/4-LLV(LOW,5))/(HHV(HIGH,4)-LLV(LOW,5))*100,4);
:=EMA(0.667*REF(散户,1)+0.333*散户,2);
DRAWTEXT(CROSS(庄家,散户)AND散户 70,90.5, 高出 ),COLOR00FF00;
DRAWTEXT(CROSS(庄家,散户)AND散户 70,80, ● ),COLOR00FF00;
高出:100*(CROSS(庄家,散户)AND散户 70),COLOR00FF00;
N:=5;
TYP:=(HIGH+LOW+CLOSE)/3;
2:2*(微分DIF-微分DEA),COLORBLacK;
MAMACD:=MA(MACD2,3),,COLORBLACK;
stICKLINE(MACD2 REF(MACD2,1)ANDMACD2 0,0,MACD2,1,0),COLORRED;
STICKLINE(MACD2 =ref(macd2,1)andmacd2 0,0,MACD2,1,0),COLORYELLOW;
STICKLINE(MACD2 REF(MACD2,1)ANDMACD2 0,0,MACD2,1,0),COLORCYAN;
STICKLINE(MACD2 =REF(MACD2,1)ANDMACD2 0,0,MACD2,1,0),COLORMAGENTA;
STICKLINE(MAMACD 1*REF(MAMACD,1),MAMACD,MACD2,3,0),COLORBLUE;
STICKLINE(MAMACD 1*REF(MAMACD,1),MAMACD,MACD2,3,0),COLORLIRED;
微分DEA2:KDEA12*5,COLORMAGENTA,LINETHICK1;
NOTEXT强:IF(微分DIF2 MA(微分DIF2,2),微分DIF2,DRAWNULL),COLORGREEN;
NOTEXT弱:IF(微分DEA2 MAX(微分DEA2,REF(微分DEA2,1)),微分DEA2,DRAWNULL),COLORYELLOW;
DIF:=(EMA(CLOSE,12)-EMA(CLOSE,26))*300,COLORWHITE,DOTLINE;
DEA:=EMA(DIF,9),COLORYELLOW,DOTLINE;
DIF普:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA普:=EMA(DIF,9);
MACD:=(DIF普-DEA普)*2,COLORSTICK;
A1:=BArslAST(REF(crOSS( MACD.DIF , MACD.DEA ),1));
B1:=REF(C,A1+1) CANDREF( MACD.DIF ,A1+1) MACD.DIF ANDCROSS( MACD.DIF , MACD.DEA
{DRAWTEXT(B1 0,DIF*0.7, ↙MACD底背 ),COLORFF00FF;}
C1:=BARSLAST(REF(CROSS( MACD.DEA , MACD.DIF ),1));
D1:=REF(C,C1+1) MACD.DIF ANDCROSS( MACD.DEA , MACD.DIF
{DRAWTEXT(D1 0,DIF*1.2, ↙MACD顶离 ),COLORBLUE;}{MACD顶}
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
本次最高价:=HHV(H,BARSLAST(JC
X1:=IF(MACD 0,BARSLAST(CROSS(DIF,DEA)),0);
前次绿柱面积:=REF(绿柱面积,X1+1);
前次最低价:=REF(本次最低价,X1+1);
Y1:=IF((绿柱面积 0ANDAbs(绿柱面积) ABS(前次绿柱面积)
AND本次最低价 前次最低价),1,0);
RS1:=MACD 0ANDREF(MACD,1) 0ANDC 前次最低价
ANDABS(绿柱面积) ABS(前次绿柱面积)ANDABS(MACD) ABS(REF(MACD,1));
底背驰:IF(CROSS(DIF,DEA),REF(Y1,1),0);
DRAWTEXT(底背驰,DIF*0.8, ↙积底背 ),COLOR00FFFF;
X2:=IF(MACD 0,BARSLAST(CROSS(DEA,DIF)),0);
前次红柱面积:=REF(红柱面积,X2+1);
前次最高价:=REF(本次最高价,X2+1);
Y2:=IF((红柱面积 0AND红柱面积 前次红柱面积and本次最高价 前次最高价),1,0);
RS2:=MACD 0ANDREF(MACD,1) 0ANDC 前次最高价ANDABS(红柱面积) ABS(前次红柱面积)ANDABS(MACD) ABS(REF(MACD,1));
顶背驰:=IF(CROSS(DEA,DIF),REF(Y2,1),0);
DRAWTEXT(顶背驰,DIF*0.8, ↙顶底背 ),COLORGREEN;
MACD高:=HHV(MACD,5);
E:=REF(C,C1+1) CANDDEA 0ANDREF(MACD高,C1+1) MACD高ANDCROSS( MACD.DEA , MACD.DIF
{DRAWTEXT(E 0,DIF*1.1, ↙柱顶背 ),COLORRED;}
F:=REF(C,A1+1) CANDDEA 0ANDREF(MACD高,A1+1) MACD高ANDCROSS( MACD.DIF , MACD.DEA
{DRAWTEXT(F 0,DIF*0.9, ↙柱底背 ),COLORYELLOW;};
N:=14;
TYP:=(HIGH+LOW+CLOSE)/3;
cci:(TYP-ma(TYP,14))/(0.015*AVEDEV(TYP,14)),LINETHICK0;
DRAWTEXT(crOSS(200,CCI),250, 下穿线 ),COLORGREEN;
DRAWTEXT(CROSS(100,CCI),100, 下穿强势力线 ),COLORGREEN;
DRAWTEXT(CROSS(CCI,-200),-150, 上穿弱势线 ),COLORYELLOW;
DRAWTEXT(CROSS(CCI,-100),-100, 上穿线 ),COLORFF00FF;
stICKLINE(CCI 0,0,CCI,1,0),COLORRED;
STICKLINE(CCI 0,0,CCI,1,0),COLORLIGREEN;
{之星}
VAR2:=(HIGH+LOW+CLOSE*2)/4;
VAR3:=EMA(VAR2,21);
VAR4:=STD(VAR2,21);
VAR5:=((VAR2-VAR3)/VAR4*100+200)/4;
VAR6:=(EMA(VAR5,5)-25)*1.56;
AK:EMA(VAR6,2)*1.22;
AD1:EMA(AK,2);
AJ:3*AK-2*AD1;
AA:100;
BB:0;
CC:80;
买进:IF(CROSS(AK,AD1),58,20);
卖出:IF(CROSS(AD1,AK),58,20);
逃遁:=(SMA(HIGH,21,2)*1.05);
STICKLINE((OPEN =CLOSE),CLOSE,OPEN,6,0),colorFF5B00;
STICKLINE((OPEN =CLOSE),CLOSE,OPEN,5,0),colorFF6C00;
STICKLINE((OPEN =CLOSE),CLOSE,OPEN,4,0),colorFF7B00;
STICKLINE((OPEN =CLOSE),CLOSE,OPEN,3,0),colorFF9C00;
STICKLINE((OPEN =CLOSE),CLOSE,OPEN,2,0),colorFFBE00;
STICKLINE((OPEN =CLOSE),CLOSE,OPEN,2,0),colorFFCC00;
STICKLINE((OPEN =CLOSE),CLOSE,OPEN,1.5,0),colorFFFF00;
STICKLINE((CLOSE =OPEN),CLOSE,OPEN,6,0),color070084;
STICKLINE((CLOSE =OPEN),CLOSE,OPEN,5,0),color0000A3;
STICKLINE((CLOSE =OPEN),CLOSE,OPEN,4,0),color0000B7;
STICKLINE((CLOSE =OPEN),CLOSE,OPEN,3,0),color0000CD;
STICKLINE((CLOSE =OPEN),CLOSE,OPEN,3,0),color0000E9;
STICKLINE((CLOSE =OPEN),CLOSE,OPEN,3,0),color0754E9;
STICKLINE((CLOSE =OPEN),CLOSE,OPEN,1.5,0),color076EF3;
STICKLINE((CLOSE =OPEN),CLOSE,OPEN,1,0),color077BF3;
STICKLINE((CLOSE OPEN),OPEN,LOW,1,0),color0726CA;
STICKLINE((CLOSE OPEN),CLOSE,HIGH,1,0),color0726CA;
STICKLINE((OPEN CLOSE),CLOSE,LOW,1,0),colorDE9100;
STICKLINE((OPEN CLOSE),OPEN,HIGH,1,0),colorDE9100;
STICKLINE(((((CLOSE/OPEN) 1.04)AND(CLOSE 逃遁))AND((CLOSE-REF(CLOSE,1)) 0)),CLOSE,OPEN,6,0),color0090FF;
STICKLINE(((((CLOSE/OPEN) 1.04)AND(CLOSE 逃遁))AND((CLOSE-REF(CLOSE,1)) 0)),CLOSE,OPEN,5,0),color009FFF;
STICKLINE(((((CLOSE/OPEN) 1.04)AND(CLOSE 逃遁))AND((CLOSE-REF(CLOSE,1)) 0)),CLOSE,OPEN,3,0),color00B5FF;
STICKLINE(((((CLOSE/OPEN) 1.04)AND(CLOSE 逃遁))AND((CLOSE-REF(CLOSE,1)) 0)),CLOSE,OPEN,2,0),color00E4FF;
STICKLINE(((((CLOSE/OPEN) 1.04)AND(CLOSE 逃遁))AND((CLOSE-REF(CLOSE,1)) 0)),OPEN,LOW,0.4,0),color00FFFF;
STICKLINE(((((CLOSE/OPEN) 1.04)AND(CLOSE 逃遁))AND((CLOSE-REF(CLOSE,1)) 0)),CLOSE,HIGH,0.4,0),color00FFFF;
STICKLINE(((((CLOSE REF(CLOSE,1))AND(CLOSE REF(CLOSE,1)))AND(HIGH 逃遁))AND(CLOSE 逃遁)),OPEN,LOW,0.7,0),colorFF76FF;
STICKLINE(((((CLOSE REF(CLOSE,1))AND(CLOSE REF(CLOSE,1)))AND(HIGH 逃遁))AND(CLOSE 逃遁)),CLOSE,HIGH,0.7,0),colorFF76FF;
STICKLINE(((((CLOSE REF(CLOSE,1))AND(CLOSE REF(CLOSE,1)))AND(HIGH 逃遁))AND(CLOSE 逃遁)),CLOSE,OPEN,6,0),colorFF00FF;
STICKLINE(((((CLOSE REF(CLOSE,1))AND(CLOSE REF(CLOSE,1)))AND(HIGH 逃遁))AND(CLOSE 逃遁)),CLOSE,OPEN,3,0),colorFF62FF;
STICKLINE(((((CLOSE REF(CLOSE,1))AND(CLOSE REF(CLOSE,1)))AND(HIGH 逃遁))AND(CLOSE 逃遁)),CLOSE,OPEN,2,0),colorFF76FF;
STICKLINE(((((CLOSE REF(CLOSE,1))AND(CLOSE REF(CLOSE,1)))AND(HIGH 逃遁))AND(CLOSE 逃遁)),CLOSE,OPEN,2,0),colorFFA8FF;
上线:=sma(c,6.5,1);
下线:=sma(c,13.5,1);
上线1:=sma(c,3,1);
下线1:=sma(c,8,1);
STICKLINE(上线 下线,上线,下线,2.5,0),color009999,linethick2;
STICKLINE(下线 上线,上线,下线,2.5,0),colorcc9999,linethick2;
DRAWTEXT(cross(上线,下线),low*0.95, ↑全仓 ),color00ff00;
drawtext(cross(下线1,上线1),h*1.02, ),coloryellow;
BBI:=(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4;
UPR:=BBI+3*STD(BBI,13),linethick2;
DWN:=BBI-3*STD(BBI,13);
安全:=MA(CLOSE,60),linethick2;
LC:=REF(CLOSE,1);
RSI:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;
DRAWTEXT(CROSS(82,RSI),HIGH*1.02, 减▼仓 ),COLORffffff,linethick2;
A7:=(2*C+H+L)/4;
操作线:MA(a7,5),COLORffffff,linethick2;
操作1:=MA(a7,5)*1.03,linethick2;
操作2:=MA(a7,5)*0.97,linethick2;
Var1:LLV(a7,21),COLORgreen;
Var2:HHV(a7,21),COLORff0000;
SK:=EMA((A7-Var1)/(Var2-Var1)*100,7);
SD:=EMA(0.667*REF(SK,1)+0.333*SK,5);
DRAWTEXT(IF(count(close ref(close,1),8)/8 6/10and =1.5*ma(vol,5)and
count(sk =sd,3)andref(low,1)=LLV(Low,120),1,0),LOW*0.98, 买进 ),COLOR0099ff;
DRAWTEXT(IF(count(close ref(close,1),13)/13 6/10and
count(sk sd,6)andref(low,5)=LLV(Low,120)andref(close =open,4)and
ref(close open,3)andREF(CLOSE OPEN,2)ANDref(open close,1)and
open ref(close,1),1,0),LOW*0.98, 买进 ),COLOryellow;
D:=MA(CLOSE,80)-MA(CLOSE,10)/3;
DRAWTEXT(if(CLOSE DandVOL/240 MA(VOL,5)/240ANDCLOSE REF(CLOSE,1)*1.08
ANDCLOSE MA(CLOSE,13)*1.3,1,0),LOW*0.98, 抄底 ),coloryellow;
强势:0,color009999;
弱势:0,colorcc9999;
下跌:0,colorFFBE00;
上涨:0,color0000FF;
底部买入信号:0,color0090FF;
逃顶信号:0,colorFF00FF;
STICKLINE(CROSS(CCI,-200)ANDCCI REF(CCI,1),CCI,0,1,0),COLORYELLOW;
STICKLINE(CROSS(200,CCI)ANDCCI REF(CCI,1),0,CCI,1,0),COLORGREEN;
CCI70:(TYP-MA(TYP,70))/(0.015*AVEDEV(TYP,70)),COLORYELLOW,LINETHICK4;
TYP:=IF((H CANDC 0)OR(H 0AND0 =C),C,H)*IF((L CANDC 0)OR(L 0AND0 =C),CLOSE,LOW)/3;
cci:Ema((TYP-MA(TYP,84.0270012))/(0.015*AVEDEV(TYP,84.0270012)),2.0332),colorwhite,LINETHICK2;
stICKLINE(CCI -100,CCI,-100,2,0),colormagenta;
STICKLINE(C 0,100,101,2,0),colorred,LINETHICK3;
STICKLINE(C 0,-100,-101,2,0),coloryellow,LINETHICK2;
N:=90;M:=3;
低:=REF(LLV(L,N),M);
低点:=REFDATE(低,DATE);
XGAA:=低点=LAND((C-L) (0-C)OR(0-L) (C-0));
IF(XGAA,88.50,0),coloryellow,LINETHICK3;
差值:=CCI70-REF(CCI70,1);
IF(差值 0,CCI70,DRAWNULL),COLORYELLOW,LINETHICK4;
IF(差值 0,CCI70,DRAWNULL),COLORBLUE,LINETHICK4;
逃顶线:200,COLORGREEN;
强势线:100,COLORRED,LINETHICK2;
中轴线:0,COLORYELLOW,LINETHICK1;
抄底线:-100,COLORLIRED;
弱势线:-200,COLORGREEN;
DRAWICON(CROSS(CCI,-100)OR(REF(CCI,1) -100ANDREF(CCI,1) -95andcci REF(CCI,1)),CCI-0.03,1);
DRAWICON(CROSS(100,CCI)OR(REF(CCI,1) 100andref(cci,1) 95ANDCCI REF(CCI,1)),CCI+0.03,2);
[源码注释]通达信公式动态公式解读
输出XG:最近3日一直存在KDJ的J 0 and= 20