通达信超短法师副图指标公式源码副图
A3:=REF(CLOSE,1.000);
A4:=SMA(MAX((CLOSE-A3),0),8,1)/SMA(ABS((CLOSE-A3)),8.000,1)*100;
A5:=SMA(MAX((CLOSE-A3),0),55,1)/SMA(ABS((CLOSE-A3)),55.000,1)*100;
超短线2:(((A4<=20) AND (A5<=49))*1);
超卖1:IF(SMA(MAX(CLOSE-REF(CLOSE,2),0),7,1)/SMA(ABS(CLOSE- REF(CLOSE,2)),7,1)*100<12,0.5,0);
超卖2:IF(SMA(MAX(CLOSE-REF(CLOSE,1),0),7,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),7,1)*100 <12,0.5,0);
买特灵:超短线2 OR 超卖1 OR 超卖2;
MA5:=MA(CLOSE,5);
MA10:=MA(CLOSE,10);
MA60:=MA(CLOSE,60);
PDAY1:=BARSLAST(CROSS(MA60,MA5));{5日均线下穿60日均线}
PDAY2:=BARSLAST(CROSS(MA60,MA10));{10日均线下穿60日均线,至此形成鸭颈部}
PDAY3:=BARSLAST(LOW=LLV(LOW,PDAY2));{形成头部,要反弹}
PDAY4:=BARSLAST(CROSS(MA5,MA10));{反弹后,5日均线和10日均线金叉}
PDAY5:=BARSLAST(CROSS(MA10,MA5));{反弹不久,5日均线和10日均线形成死叉,形成嘴部}
A1:=PDAY1>PDAY2 AND PDAY2>PDAY3 AND PDAY3>PDAY4 AND PDAY4>PDAY5 AND PDAY5<5;
A2:=COUNT(CROSS(MA10,MA5),PDAY2)=1;
鸭头:A1 AND A2,COLOR000099;
M2:=EMA(C,5);
M18:=EMA(C,18);
买点:=IF(CROSS(M18,M2),5,10* 10000),COLORGREEN,LINETHICK1;
LC:=REF(CLOSE,1);
RSI5:=((SMA(MAX((CLOSE-LC),0),5,1)/SMA(ABS((CLOSE-LC)),5,1))*100);
TR1:=SUM(MAX(MAX((HIGH-LOW),ABS((HIGH-REF(CLOSE,1)))),ABS((LOW-REF(CLOSE,1)))),10);
HD:=(HIGH-REF(HIGH,1));
LD:=(REF(LOW,1)-LOW);
DMP:=SUM(IF(((HD>0) AND (HD>LD)),HD,0),10);
DMM:=SUM(IF(((LD>0) AND (LD>HD)),LD,0),10);
PDI:=((DMP*100)/TR1);
MDI:=((DMM*100)/TR1);
ADX:=MA(((ABS((MDI-PDI))/(MDI+PDI))*100),5);
AV:=(RSI5+ADX);
DXR:=(((ADX+REF(ADX,5))/2)+RSI5);
WR10:=((100*(HHV(HIGH,10)-CLOSE))/(HHV(HIGH,10)-LLV(LOW,10)));
NEWVOL:=(RSI5-WR10);
选出后观察:=(AV+NEWVOL);
底部特征选股:=IF(CROSS(选出后观察,0),1,0);
VAR1:=SMA(底部特征选股,3,1);
VAR2:=SMA(VAR1,3,1);
VAR3:=SMA(VAR2,3,1);
底买入:IF(CROSS(VAR2,VAR3) AND (VAR2<40),0.8,0);
SM01:=MA((2*C+H+L)/4,5);
SM02:=SM01*(200-102)/100;
SM03:=(1-7/100)*DMA(C,ABS((2*C+H+L)/4-MA(C,20))/MA(C,20));
SM04:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
SM05:=3*SMA(SM04,3,1)-2*SMA(SMA(SM04,3,1),3,1);
SM06:=((H+L+C)/3-MA((H+L+C)/3,14))/(0.015*AVEDEV((H+L+C)/3,14));
SM07:=SM02<SM03&&SM05>REF(SM05,1)&&REF(SM05,1)<REF(SM05,2)&&SM06<-100&&SM06>REF(SM06,1);
STICKLINE(SM07,0,0.5,2,0),COLORYELLOW;
主力入场:SM07,COLORRED,LINETHICK3;
VA:=IF(CLOSE>REF(CLOSE,1),VOL,-VOL);
OBV1:=SUM(IF(CLOSE=REF(CLOSE,1),0,VA),0);
OBV2:=EMA(OBV1,3)-MA(OBV1,9);
OBV3:=EMA(IF(OBV2>0,OBV2,0),3);
MAC3:=MA(C,3);
SHORT:=12;LONG:=26;MID:=9;
DIF:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG),COLORYELLOW ;
DEA:=EMA(DIF,MID),COLORFF9900 ;
MACD:=(DIF-DEA)*2;
入1:=IF(DIF>REF(DIF,1),DIF,DRAWNULL),COLORRED,LINETHICK2;
入2:=IF(DIF<REF(DIF,1),DIF,DRAWNULL),COLOR00FF00,LINETHICK2;
低位金叉:=CROSS(DIF,DEA) AND DIF<-0.1;
STICKLINE(低位金叉,0,0.08,2,0),COLORFF00FF;
DRAWTEXT(低位金叉,0.16,' 低位金叉'),COLORWHITE;
JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
STICKLINE(二次金叉,0,0.06,2,0),COLORFFCC00;
DRAWTEXT(二次金叉,0.2,' 二次金叉'),COLORYELLOW;
A11:=BARSLAST(REF(CROSS(DIF,DEA),1));
底背离:=REF(CLOSE,A11+1)>CLOSE AND DIF>REF(DIF,A11+1) AND CROSS(DIF,DEA);
STICKLINE(底背离,0,0.03,2,0),COLOR00FF00;
DRAWTEXT(底背离,0.12,' 底背离'),COLORFF00FF;
A12:=BARSLAST(REF(CROSS(DEA,DIF),1));
顶背离:=REF(CLOSE,A12+1)<CLOSE AND REF(DIF,A12+1)>DIF AND CROSS(DEA,DIF);
DRAWTEXT(低位金叉 AND 二次金叉 AND 底背离,0.25,'三全项'),COLOR0000FF,LINETHICK2;
VAR4:=MA(CLOSE,13);
VAR5:=100-ABS((CLOSE-VAR4)/VAR4*100);
VAR6:=LLV(LOW,75);
VAR7:=HHV(HIGH,75);
VAR8:=(VAR7-VAR6)/100;
VAR9:=SMA((CLOSE-VAR6)/VAR8,20,1);
VARA:=SMA((OPEN-VAR6)/VAR8,20,1);
VARB:=3*VAR9-2*SMA(VAR9,15,1);
VARC:=3*VARA-2*SMA(VARA,15,1);
VARD:=100-VARC;
VARE:=REF(LOW,1)*0.9;
VARF:=LOW*0.9;
VAR10:=(VARF*VOL+VARE*(CAPITAL-VOL))/CAPITAL;
VAR11:=EMA(VAR10,30);
VAR12:=CLOSE-REF(CLOSE,1);
VAR13:=MAX(VAR12,0);
VAR14:=ABS(VAR12);
VAR15:=SMA(VAR13,7,1)/SMA(VAR14,7,1)*100;
VAR16:=SMA(VAR13,13,1)/SMA(VAR14,13,1)*100;
VAR17:=BARSCOUNT(CLOSE);
VAR18:=SMA(MAX(VAR12,0),6,1)/SMA(ABS(VAR12),6,1)*100;
VAR19:=(-200)*(HHV(HIGH,55)-CLOSE)/(HHV(HIGH,55)-LLV(LOW,55))+100;
VAR1A:=(CLOSE-LLV(LOW,15))/(HHV(HIGH,15)-LLV(LOW,15))*100;
VAR1B:=SMA((SMA(VAR1A,4,1)-50)*2,3,1);
VAR1C:=(INDEXC-LLV(INDEXL,14))/(HHV(INDEXH,14)-LLV(INDEXL,14))*100;
VAR1D:=SMA(VAR1C,4,1);
VAR1E:=SMA(VAR1D,3,1);
VAR1F:=(HHV(HIGH,30)-CLOSE)/CLOSE*100;
VAR20:=VAR18<=25 AND VAR19<-95 AND VAR1F>20 AND VAR1B<-30 AND VAR1E<30 AND VAR11-CLOSE>=-0.25 AND VAR15<22 AND VAR16<55 AND VAR17>50;
明天低买:IF(CROSS(VAR20,0.5),0.8,0),COLOR00FFFF ,LINETHICK2;
A:=SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),3);
AA1:=HIGH-REF(HIGH,1);
AA2:=REF(LOW,1)-LOW;
ADMP:=SUM(IF(AA1>0 AND AA1>AA2,AA1,0),3);
ADMM:=SUM(IF(AA2>0 AND AA2>AA1,AA2,0),5);
APDI:=ADMP*100/A;
AMDI:=ADMM*100/A;
AADX:=MA((ABS(AMDI-APDI))/(AMDI+APDI)*100,7);
暴涨前夜:IF(AADX>90 AND APDI=0,0.6,0),COLORRED;
OB0:=EMA(V,18)-EMA(V,36);
OB1:=EMA(C,18)-EMA(C,36);
OB2:=OB0>REF(OB0,1) AND OB1<REF(OB1,1);
OB3:=REF(OB2,2)=1 AND REF(OB2,1)=1 AND OB2;
OB4:=REF(OB2,3)=1 AND REF(OB2,2)=1 AND REF(OB2,1)=1 AND OB2;
变盘在即:IF((OB3 OR OB4),0.5,0),COLOR0099FF,LINETHICK2;
{量价背离:IF(OB5 OR OB6,0.4,0),COLOR0099FF;};
HH1:=AMOUNT/(VOL);
HH2:=MA(HH1,13);
HH3:=(C-HH2)/HH2*100;
HH4:=MA(CLOSE,22);
HH5:=HH4+2*STD(C,22);
HH6:=HH4-2*STD(C,22);
HH7:=(C-HH6)/(HH5-HH6);
HH8:=(REF(HH3,1)<-15 AND REF(HH7,1)<0 AND HH3>REF(HH3,1));
★:HH8>0,COLORFF00FF;
DRAWTEXT(★,0.6,'★'),COLORRED;{COLORDD00DD};
X1A:=(CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34))*100;
X2A:=SMA(X1A,3,1);
X3A:=SMA(X2A,3,1.2);
X4A:=VOL/CAPITAL*100;
X5A:=REF(X4A,1);
建仓:X3A<14.5 AND X2A<11,COLORRED,NODRAW;
STICKLINE(建仓>=1,0,0.3,1,0),COLORRED;
VARX:=((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)));
即启:IF(CROSS(VARX,3),0.7,0),COLORBROWN;
密买:IF((VARX<=3),0.8,0),COLOR008800;
增仓:IF((VARX<5),0.9,0),COLOR880088;
底显:=(HHV(HIGH,25)-LLV(LOW,25))/EMA((CLOSE-LLV(LOW,25)),5);
底显现:底显>30,COLORGREEN,LINETHICK2;{30数值根据需要调整大小,数值小选股多,做短线;数值大选股少,做长线};
牛大底: ("999999$CLOSE"/REF("999999$CLOSE",23)<0.78)
AND ((CLOSE / REF(CLOSE, 120)) < 0.558)
AND (REF(C,1)/L<1.5)
AND (REF(C,1)!=REF(O,1))
AND (REF(C,2)!=REF(O,2))
AND (REF(C,3)!=REF(O,3)),COLORWHITE,LINETHICK2;
未来函数检测结果如下:
该公式包含未来函数:CAPITAL
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
A3赋值:1.000日前的收盘价
A4赋值:SMA(MAX((收盘价-A3),0),8,1)/SMA((收盘价-A3的绝对值),8.000,1)*100
A5赋值:SMA(MAX((收盘价-A3),0),55,1)/SMA((收盘价-A3的绝对值),55.000,1)*100
输出超短线2:(((A4<=20) AND (A5<=49))*1)
输出超卖1:IF(SMA(收盘价-2日前的收盘价和0较大值,7,1)/SMA(收盘价- 2日前的收盘价的绝对值,7,1)*100<12,0.5,0)
输出超卖2:IF(SMA(收盘价-1日前的收盘价和0较大值,7,1)/SMA(收盘价-1日前的收盘价的绝对值,7,1)*100 <12,0.5,0)
输出买特灵:超短线2 OR 超卖1 OR 超卖2
MA5赋值:收盘价的5日简单移动平均
MA10赋值:收盘价的10日简单移动平均
MA60赋值:收盘价的60日简单移动平均
PDAY1赋值:上次MA60上穿MA5距今天数
{5日均线下穿60日均线}
PDAY2赋值:上次MA60上穿MA10距今天数
{10日均线下穿60日均线,至此形成鸭颈部}
PDAY3赋值:上次最低价=PDAY2日内最低价最低值距今天数
{形成头部,要反弹}
PDAY4赋值:上次MA5上穿MA10距今天数
{反弹后,5日均线和10日均线金叉}
PDAY5赋值:上次MA10上穿MA5距今天数
{反弹不久,5日均线和10日均线形成死叉,形成嘴部}
A1赋值:PDAY1>PDAY2 AND PDAY2>PDAY3 AND PDAY3>PDAY4 AND PDAY4>PDAY5 AND PDAY5<5
A2赋值:统计PDAY2日满足MA10上穿MA5的天数=1
输出鸭头:A1 AND A2,COLOR000099
M2赋值:C的5日指数移动平均
M18赋值:C的18日指数移动平均
买点赋值:IF(M18上穿M2,5,10* 10000),画绿色,LINETHICK1
LC赋值:1日前的收盘价
RSI5赋值:((SMA(MAX((收盘价-LC),0),5,1)/SMA((收盘价-LC的绝对值),5,1))*100)
TR1赋值:SUM(MAX(MAX((最高价-最低价),(最高价-1日前的收盘价的绝对值)),ABS((最低价-1日前的收盘价))),10)
HD赋值:(最高价-1日前的最高价)
LD赋值:(1日前的最低价-最低价)
DMP赋值:SUM(IF(((HD>0) AND (HD>LD)),HD,0),10)
DMM赋值:SUM(IF(((LD>0) AND (LD>HD)),LD,0),10)
PDI赋值:((DMP*100)/TR1)
MDI赋值:((DMM*100)/TR1)
ADX赋值:MA((((MDI-PDI的绝对值)/(MDI+PDI))*100),5)
AV赋值:(RSI5+ADX)
DXR赋值:(((ADX+5日前的ADX)/2)+RSI5)
WR10赋值:((100*(10日内最高价最高值-收盘价))/(10日内最高价最高值-10日内最低价最低值))
NEWVOL赋值:(RSI5-WR10)
选出后观察赋值:(AV+NEWVOL)
底部特征选股赋值:IF(选出后观察上穿0,1,0)
底部特征选股的3日[1日权重]移动平均
VAR1的3日[1日权重]移动平均
VAR2的3日[1日权重]移动平均
输出底买入:IF(VAR2上穿VAR3 AND (VAR2<40),0.8,0)
SM01赋值:MA((2*C+H+L)/4,5)
SM02赋值:SM01*(200-102)/100
SM03赋值:(1-7/100)*DMA(C,(2*C+H+L的绝对值/4-MA(C,20))/MA(C,20))
SM04赋值:(C-9日内L最低值)/(9日内H最高值-9日内L最低值)*100
SM04的3日[1日权重]移动平均
SM06赋值:((H+L+C)/3-MA((H+L+C)/3,14))/(0.015*AVEDEV((H+L+C)/3,14))
SM07赋值:SM021日前的SM05&&1日前的SM05<2日前的SM05&&SM06<-100&&SM06>1日前的SM06
当满足条件SM07时,在0和0.5之间画柱状线
输出主力入场:SM07,画红色, 线宽为3
VA赋值:IF(收盘价>1日前的收盘价,成交量,-成交量)
OBV1赋值:SUM(IF(收盘价=1日前的收盘价,0,VA),0)
OBV2赋值:OBV1的3日指数移动平均-OBV1的9日简单移动平均
如果OBV2>0返回OBV2否则返回0
MAC3赋值:C的3日简单移动平均
SHORT赋值:12
LONG赋值:26
MID赋值:9
DIF赋值:收盘价的SHORT日指数移动平均-收盘价的LONG日指数移动平均,画黄色
DEA赋值:DIF的MID日指数移动平均,COLORFF9900
MACD赋值:(DIF-DEA)*2
入1赋值:IF(DIF>1日前的DIF,DIF,DRAWNULL),画红色, 线宽为2
入2赋值:IF(DIF<1日前的DIF,DIF,DRAWNULL),COLOR00FF00, 线宽为2
低位金叉赋值:DIF上穿DEA AND DIF<-0.1
当满足条件低位金叉时,在0和0.08之间画柱状线
当满足条件低位金叉时,在0.16和' 低位金叉'位置书写文字
JCCOUNT赋值:COUNT(DIF上穿DEA,上次DEA>=0距今天数)
二次金叉赋值:DIF上穿DEA AND DEA<0 AND 统计21日满足JC=2的天数=1
当满足条件二次金叉时,在0和0.06之间画柱状线
当满足条件二次金叉时,在0.2和' 二次金叉'位置书写文字
A11赋值:上次1日前的DIF上穿DEA距今天数
底背离赋值:A11+1日前的收盘价>收盘价 AND DIF>A11+1日前的DIF AND DIF上穿DEA
当满足条件底背离时,在0和0.03之间画柱状线
当满足条件底背离时,在0.12和' 底背离'位置书写文字
A12赋值:上次1日前的DEA上穿DIF距今天数
顶背离赋值:A12+1日前的收盘价<收盘价 AND A12+1日前的DIF>DIF AND DEA上穿DIF
当满足条件低位金叉 AND 二次金叉 AND 底背离时,在0.25和'三全项'位置书写文字
VAR4:=收盘价的13日简单移动平均
VAR5:=100-(收盘价-VAR4的绝对值/VAR4*100)
VAR6:=75日内最低价最低值
VAR7:=75日内最高价最高值
VAR8:=(VAR7-VAR6)/100
VAR9:=SMA((收盘价-VAR6)/VAR8,20,1)
VARA赋值:SMA((开盘价-VAR6)/VAR8,20,1)
VAR9的15日[1日权重]移动平均
VARA的15日[1日权重]移动平均
VARD:=100-VARC
VARE:=1日前的最低价*0.9
VARF:=最低价*0.9
VAR10:=(VARF*成交量+VARE*(CAPITAL-成交量))/CAPITAL
VAR11:=VAR10的30日指数移动平均
VAR12:=收盘价-1日前的收盘价
VAR13:=VAR12和0较大值
VAR14:=VAR12的绝对值
VAR13的7日[1日权重]移动平均
VAR13的13日[1日权重]移动平均
VAR17:=收盘价的有效数据周期数
VAR18:=SMA(VAR12和0较大值,6,1)/SMA(VAR12的绝对值,6,1)*100
VAR19:=(-200)*(55日内最高价最高值-收盘价)/(55日内最高价最高值-55日内最低价最低值)+100
VAR1A赋值:(收盘价-15日内最低价最低值)/(15日内最高价最高值-15日内最低价最低值)*100
VAR1B:=SMA((SMA(VAR1A,4,1)-50)*2,3,1)
VAR1C:=(INDEXC-14日内INDEXL最低值)/(14日内INDEXH最高值-14日内INDEXL最低值)*100
VAR1C的4日[1日权重]移动平均
VAR1D的3日[1日权重]移动平均
VAR1F:=(30日内最高价最高值-收盘价)/收盘价*100
VAR20:=VAR18<=25 AND VAR19<-95 AND VAR1F>20 AND VAR1B<-30 AND VAR1E<30 AND VAR11-收盘价>=-0.25 AND VAR15<22 AND VAR16<55 AND VAR17>50
输出明天低买:IF(VAR20上穿0.5,0.8,0),COLOR00FFFF , 线宽为2
A赋值:SUM(MAX(MAX(最高价-最低价,最高价-1日前的收盘价的绝对值),ABS(最低价-1日前的收盘价)),3)
AA1:=最高价-1日前的最高价
AA2赋值:1日前的最低价-最低价
如果AA1>0 AND AA1>AA2返回AA1否则返回0
如果AA2>0 AND AA2>AA1返回AA2否则返回0
APDI赋值:ADMP*100/A
AMDI赋值:ADMM*100/A
AADX赋值:MA((AMDI-APDI的绝对值)/(AMDI+APDI)*100,7)
如果AADX>90 AND APDI=0返回0.6否则返回0
OB0赋值:V的18日指数移动平均-V的36日指数移动平均
OB1赋值:C的18日指数移动平均-C的36日指数移动平均
OB2赋值:OB0>1日前的OB0 AND OB1<1日前的OB1
OB3赋值:2日前的OB2=1 AND 1日前的OB2=1 AND OB2
OB4赋值:3日前的OB2=1 AND 2日前的OB2=1 AND 1日前的OB2=1 AND OB2
输出变盘在即:IF((OB3 OR OB4),0.5,0),COLOR0099FF, 线宽为2
如果OB5 OR OB6返回0.4否则返回0
}
HH1赋值:AMOUNT/(成交量)
HH2赋值:HH1的13日简单移动平均
HH3赋值:(C-HH2)/HH2*100
HH4赋值:收盘价的22日简单移动平均
HH5赋值:HH4+2*C的22估算标准差
HH6赋值:HH4-2*C的22估算标准差
HH7赋值:(C-HH6)/(HH5-HH6)
HH8赋值:(1日前的HH3<-15 AND 1日前的HH7<0 AND HH3>1日前的HH3)
输出★:HH8>0,COLORFF00FF
当满足条件★时,在0.6和'★'位置书写文字
{COLORDD00DD}
X1A赋值:(收盘价-34日内最低价最低值)/(34日内最高价最高值-34日内最低价最低值)*100
X1A的3日[1日权重]移动平均
X2A的3日[1.2日权重]移动平均
X4A赋值:成交量/CAPITAL*100
X5A赋值:1日前的X4A
输出建仓:X3A<14.5 AND X2A<11,画红色,NODRAW
当满足条件建仓>=1时,在0和0.3之间画柱状线
VARX:=((3*SMA((((收盘价-27日内最低价最低值)/(27日内最高价最高值-27日内最低价最低值))*100),5,1))
-(2*SMA(SMA((((收盘价-27日内最低价最低值)/(27日内最高价最高值-27日内最低价最低值))*100),5,1),3,1)))
输出即启:IF(VARX上穿3,0.7,0),COLORBROWN
输出密买:IF((VARX<=3),0.8,0),COLOR008800
输出增仓:IF((VARX<5),0.9,0),COLOR880088
底显赋值:(25日内最高价最高值-25日内最低价最低值)/EMA((收盘价-25日内最低价最低值),5)
底显现:底显>30,画绿色, 线宽为2
{30数值根据需要调整大小,数值小选股多,做短线;数值大选股少,做长线}
输出牛大底: ("999999$收盘价"/23日前的"999999$收盘价"<0.78)
AND ((收盘价 / 120日前的收盘价) < 0.558)
AND (1日前的C/L<1.5)
AND (1日前的C!=1日前的O)
AND (2日前的C!=2日前的O)
AND (3日前的C!=3日前的O),画白色, 线宽为2