通达信公式源码概况:

指标类别:通达信公式

授权方式: 免费版

指标评级: ★★★★★

指标分类: 策略

画线方法: 副图

一、通达信一阳穿三线主图指标公式

工作线:=MA(CLOSE,1);

趋势线:MA(CLOSE,18)COLORGREEN,LINETHICK2;

强势线:MA(CLOSE,3)COLORRED,LINETHICK2;

TT2:=DMA((((HIGH + LOW) + (CLOSE * 2)) / 4.15),0.9);

TT1:=REF(EMA(TT2,3),1);

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;

LC:=REF(CLOSE,1);

RSI:=((SMA(MAX((CLOSE – LC),0),3,1) / SMA(ABS((CLOSE – LC)),3,1)) * 100);

FF:=EMA(CLOSE,3);

稻壳1:EMA(CLOSE,144),POINTDOT,COLORWHITE;

稻壳2:EMA(C,318);

AA1:=AMOUNT/VOL;

BB1:=L<AA1*0.9;

CC1:=(C-REF(C,1))/REF(C,1)*100>1.2;

DD1:=L<MA(C,5)*0.921;

EE1:=VOL<MA(V,5)*1.5;

FF1:=BB1 AND CC1 AND DD1 AND EE1;

F:=100*(C-REF(C,1))/REF(C,1);

P1:=IF(C<REF(O,1) AND F<0,1,0);

P2:=IF(C<REF(O,2) AND F<0,1,0);

TT3:=P1=0 AND REF(P1,1)=1 AND P2=0 AND REF(P2,1)=1 ;

TT4:=P1=1 AND REF(P1,1)=0 AND P2=1 AND REF(P2,1)=0 ;

Z1:=MA(C,13);

ZX:=REF(Z1,13/2+1);

DRAWICON(CROSS(ZX,C),H*1.01,2);

DRAWTEXT(CROSS(工作线,趋势线)AND J<55,LOW,'入')COLORWHITE;

DRAWTEXT(CROSS(CLOSE,TT1)AND J<55,LOW,'买'),COLORRED;

DRAWTEXT(CROSS(88,RSI),HIGH * 1.02,'顶'),COLOR00FFFF;

DRAWTEXT(FF1,L*0.99,'超短'),COLOR00FF00;

STICKLINE(TT3,OPEN,CLOSE,3,0),COLORFF00FF;

STICKLINE(TT4,OPEN,CLOSE,3,0),COLORGREEN;

TT5:=5;

V1:=MA(HIGH,30)*1.15;

V2:=MA(HIGH,3)*1.03;

V3:=MA(LOW,3)*0.97;

V4:=MA(LOW,30)*0.85;

GET:ZIG(3,TT5)COLORWHITE,LINETHICK2;

攻击线5:MA(C,5)LINETHICK1;

操盘线10:MA(C,10)LINETHICK1;

生命线30:MA(C,30)LINETHICK1;

决策线60:MA(C,60)LINETHICK1;

DRAWTEXT(CROSS(攻击线5,操盘线10),LOW*0.95,'攻抄金叉'),COLORRED;

DRAWTEXT(CROSS(生命线30,决策线60),LOW*0.95,'生决金叉'),COLORMAGENTA;

N:=20;

M:=30;

P1:=80;

P2:=100;

VAR101:=(C+H+O+L)/4;

卖出:XMA(VAR101,N)*(1+P1/1000),COLORRED,LINETHICK2;

买入:XMA(VAR101,M)*(1-P2/1000),COLORLIRED,LINETHICK2;

幅度:=100*(卖出-买入)/买入,NODRAW;

MA1:=MA(VAR101,3);

STICKLINE(卖出>LOW AND 卖出<HIGH,卖出,MAX(卖出,MAX(OPEN,CLOSE)),3,0),COLORGREEN;

STICKLINE(卖出>MIN(C,O) AND 卖出<MAX(C,O),卖出,MAX(OPEN,CLOSE),3,0),COLORGREEN;

STICKLINE(卖出>LOW AND 卖出<HIGH,卖出,HIGH,0,0),COLORGREEN;

STICKLINE(卖出<LOW,OPEN,CLOSE,3,0),COLORGREEN;

STICKLINE(卖出<LOW,HIGH,LOW,0,0),COLORGREEN;

STICKLINE(买入>LOW AND 买入<HIGH,买入,MIN(MIN(OPEN,CLOSE),买入),3,0),COLORMAGENTA;

STICKLINE(买入>MIN(C,O) AND 买入<MAX(C,O),买入,MIN(OPEN,CLOSE),3,0),COLORMAGENTA;

STICKLINE(买入>LOW AND 买入<HIGH,买入,LOW,0,0),COLORMAGENTA;

STICKLINE(买入>HIGH,OPEN,CLOSE,3,0),COLORMAGENTA;

STICKLINE(买入>HIGH,HIGH,LOW,0,0),COLORMAGENTA;

DRAWTEXT(CROSS(LOW,买入),LOW*0.95,'买'),COLORRED,LINETHICK2;

DRAWTEXT(CROSS(卖出,HIGH),HIGH*1.02,'卖'),COLORGREEN;

MA20:=MA(CLOSE,20);

MA120:=MA(CLOSE,120);

MA30:=MA(CLOSE,37);

MAP:=MA(CLOSE,8);

AA5:=MA(CLOSE,21);

AA10:=MA(CLOSE,8),COLORFF0000;

AA12:=MA(CLOSE,12),COLORFF0000;

BB10:=((ATAN((AA10 – REF(AA10,1))) * 3.1416) * 10);

BB12:=((ATAN((AA12 – REF(AA12,1))) * 3.1416) * 10);

MA13:=MA(CLOSE,13);

VAR01:=((((OPEN + LOW) + HIGH) + CLOSE) / 4);

中期大底:=LLV(LOW,30),;

短期底部0:=LLV(HIGH,30);

短底:=EMA(VAR01,5);

支撑:=HHV(短底,60);

压力1:=HHV(LOW,20),COLORFAABEC;

压力:=SMA(LOW,5,1);

中线:=MA(CLOSE,3);

DRAWTEXT(FILTER(((((HIGH > 支撑) AND (CLOSE < 支撑)) AND ((CLOSE / OPEN) > (0 – 1.06))) AND (CLOSE < OPEN)),5),(HIGH + 0.02),'逃'),COLORFFFF00;

中轨道:=(MA(HIGH,15) * 1.05);

天:=(MA(LOW,15) * 0.985);

人:=(MA(LOW,15) * 0.96);

地:=(((HIGH + LOW) + CLOSE) / 3);

B1:=HHV(地,(4 * 15));

B6:=LLV(地,(4 * 15));

B7:=(B1 – B6);

B8:=(MA(((地 – B6) / B7),2) * 80);

VAR1:=(((CLOSE – LLV(LOW,100)) / (HHV(HIGH,100) – LLV(LOW,100))) * 200);

飞龙顶底线1:=SMA(VAR1,3,1);

VAR2:=SMA(飞龙顶底线1,3,1);

VAR3:=((3 * 飞龙顶底线1) – (2 * VAR2));

VAR4:=LLV(LOW,5);

VAR5:=HHV(HIGH,5);

VAR6:=(EMA((((CLOSE – VAR4) / (VAR5 – VAR4)) * 100),4) * 2);

VAR7:=EMA(((0.667 * REF(VAR6,1)) + (0.333 * VAR6)),2);

VAR8:=((3 * VAR6) – (2 * VAR7));

VAR9:=(POW(MA(CLOSE,5),2) + MA(CLOSE,5));

VARA:=(POW(MA(LOW,5),2) + MA(LOW,5));

VARB:=(POW(MA(HIGH,5),2) + MA(HIGH,5));

VARC:=(((((VAR9 – LLV(VARA,64)) / (HHV(VARB,64) – LLV(VARA,64))) * 150) + 65) – 10);

VARD:=((SMA(VARC,3,1) * 1.5) – 100);

VARE:=SMA(VARD,3,1);

VARF:=((3 * VARD) – (2 * VARE));

VAR10:=(((HIGH + LOW) + (CLOSE * 2)) / 4);

VAR11:=EMA(VAR10,13);

VAR12:=STD(VAR10,13);

VAR13:=(((VAR10 – VAR11) * 100) / VAR12);

VAR14:=EMA(VAR13,5);

VAR15:=EMA(VAR14,13);

VAR16:=((EMA(VAR14,13) + 200) – 100);

VAR17:=EMA(VAR16,10);

VAR18:=((3 * VAR16) – (2 * VAR17));

VAR19:=(((飞龙顶底线1 + VAR6) + VARD) + VAR16);

VAR1A:=(((VAR2 + VAR7) + VARE) + VAR17);

VAR1B:=(((VAR3 + VAR8) + VARF) + VAR18);

VAR1C:=(((HIGH + LOW) + CLOSE) / 3);

VAR1D:=((AMOUNT / VOL) / 100);

VAR1E:=((SUM(AMOUNT,5) / SUM(VOL,5)) / 100);

VAR1F:=((VAR1C – MA(VAR1C,34)) / (0.015 * AVEDEV(VAR1C,34)));

VAR21:=((((HIGH + LOW) + CLOSE) + VAR1C) / 4);

VAR22:=EMA(VAR21,24);

VAR23:=STD(VAR21,24);

VAR24:=(((VAR21 – VAR22) / VAR23) * 100);

VAR25:=((VAR1C – MA(VAR1C,24)) / (0.015 * AVEDEV(VAR1C,24)));

VAR26:=EMA(VAR24,5);

VAR27:=((VAR1D – MA(VAR1D,21)) / (0.015 * AVEDEV(VAR1D,21)));

VAR28:=((VAR1E – MA(VAR1E,90)) / (0.015 * AVEDEV(VAR1E,90)));

VAR29:=(((((((VAR28 + VAR27) + VAR26) + VAR25) + VAR1F) / 5) + 165) / 4);

VAR2A:=(((((VAR19 + VAR1A) + (VAR1B * 30)) / 32) / 5) – 15);

VAR2B:=(((VAR29 + VAR2A) / 2) / 1.1);

VAR2C:=VAR2B;

短线:=MA(VAR2C,26);

MID:=(短线 + (2 * STD(VAR2C,26)));

UPPER:=(短线 – (2 * STD(VAR2C,26)));

LOWER:=IF((VAR2C > 短线),短线,VAR2C);

XY:=MA(CLOSE,5);

M80:=MA(CLOSE,80);

短期底部:=(LLV(HIGH,30) * 0.93);

MA80:=LLV(HIGH,30);

短期底部2:=SMA(CLOSE,2,1);

趋势:=(MA(LOW,10) * 0.96);

趋:=(EMA(OPEN,107) * 0.897);

超跌位2:=MA(CLOSE,15);

GF:=MA(CLOSE,10);

MAN:=(SMA(HIGH,21,2) * 1.05);

上1:=(HHV(短底,60) * 0.92);

压力2:=(SMA(HIGH,21,2) * 1.035);

阻挡线:=(SMA(LOW,21,2) * 0.96);

下档线:=(((CLOSE – LLV(LOW,13)) / (HHV(HIGH,13) – LLV(LOW,13))) * 100);

RSV:=SMA(下档线,3,1);

K:=SMA(RSV,3,1);

D:=((3 * RSV) – (2 * K));

J:=(((CLOSE – MA(CLOSE,6)) / MA(CLOSE,6)) * 100);

VAR2P:=(((CLOSE – MA(CLOSE,12)) / MA(CLOSE,12)) * 100);

VAR3P:=(((CLOSE – MA(CLOSE,24)) / MA(CLOSE,24)) * 100);

VAR4P:=(((J + (2 * VAR2P)) + (3 * VAR3P)) / 6);

VAR5P:=MA(VAR4P,3);

VAR6P:=(((CLOSE – LLV(LOW,34)) / (HHV(HIGH,34) – LLV(LOW,34))) * 100);

RSV12:=SMA(VAR6P,3,1);

K12:=SMA(RSV12,3,1);

D12:=((3 * RSV12) – (2 * K12));

J12:=(((CLOSE – LLV(LOW,55)) / (HHV(HIGH,55) – LLV(LOW,55))) * 100);

RSV24:=SMA(J12,3,1);

K24:=SMA(RSV24,3,1);

D24:=((3 * RSV24) – (2 * K24));

J24:=IF(CROSS(D,D24),LOW,REF(LOW,BARSLAST(CROSS(D,D24))));

压力位:=IF(CROSS(D24,D),HIGH,REF(HIGH,BARSLAST(CROSS(D24,D))));

支撑位:=IF((CLOSE >= MA(CLOSE,20)),80,50);

U2L:=IF((CLOSE >= MA(CLOSE,20)),50,20);

L2L:=IF(((D < 支撑位) AND (REF(D,1) >= 支撑位)),HHV(REF(HIGH,1),(BARSLAST(((D >= 支撑位) AND (REF(D,1) < 支撑位))) – 1)),REF(HHV(REF(HIGH,1),(BARSLAST(((D >= 支撑位) AND (REF(D,1) < 支撑位))) – 1)),BARSLAST(((D < 支撑位) AND REF(D,1)))));

RH1:=IF((HIGH > L2L),LOW,REF(LOW,BARSLAST((HIGH > L2L))));

RH4:=IF((HIGH > L2L),D,REF(D,BARSLAST((HIGH > L2L))));

RH42:=IF((((HIGH > RH1) AND (D < RH4)) AND (D < D24)),HIGH,REF(HIGH,BARSLAST((((HIGH > RH1) AND (D < RH4)) AND (D < D24)))));

RH5:=IF(((D > U2L) AND (REF(D,1) <= U2L)),LLV(REF(LOW,1),(BARSLAST(((D <= U2L) AND (REF(D,1) > U2L))) – 1)),REF(LLV(REF(LOW,1),(BARSLAST(((D <= U2L) AND (REF(D,1) > U2L))) – 1)),BARSLAST(((D > U2L) AND REF(D,1)))));

RL1:=IF((LOW < RH5),HIGH,REF(HIGH,BARSLAST((LOW < RH5))));

RL4:=IF((LOW < RH5),D,REF(D,BARSLAST((LOW < RH5))));

RL42:=IF((((LOW < RL1) AND (D > RL4)) AND (D > D24)),LOW,REF(LOW,BARSLAST((((LOW < RL1) AND (D > RL4)) AND (D > D24)))));

长期底部:=LLV(HIGH,30);

DRAWTEXT(FILTER(((((RL42 = J24) AND (CLOSE > OPEN)) AND (CLOSE > 长期底部)) AND (LOW <= J24)),20),(LOW – 0.12),'底成'),COLOR0EABFF;

RL5:=(SMA(HIGH,5,2) * 1.05);

上:=(SMA(LOW,5,2) * 0.96);

下:=SMA(LOW,2,1);

中:=(((((3 * CLOSE) + HIGH) + LOW) + OPEN) / 6);

X1:=EMA(中,10);

X2:=REF(X1,1);

X3:=((REF(HIGH,1) + REF(LOW,1)) / 2);

X4:=(MA(CLOSE,21) + (2 * STD(CLOSE,21)));

X5:=REF(CLOSE,1);

X6:=((SMA(MAX((CLOSE – X5),0),7,1) / SMA(ABS((CLOSE – X5)),7,1)) * 100);

X7:=CROSS(79,X6);

X8:=FILTER(X7,4);

X9:=MA(CLOSE,115);

VAR001:=EMA(CLOSE,8);

飞龙顶底线:=EMA(VAR001,20);

VAR002:=CROSS(VAR001,飞龙顶底线);

VAR003:=(VAR001 < MA(CLOSE,20));

VAR004:=(((HHV(HIGH,36) – CLOSE) / (HHV(HIGH,36) – LLV(LOW,36))) * 100);

VAR005:=SMA(VAR004,5,1);

VAR006:=SMA(VAR005,8,1);

VAR007:=(CROSS(VAR005,VAR006) AND (VAR006 < 5));

VAR008:=((CLOSE > (LLV(CLOSE,60) + (0.3 * LLV(CLOSE,60)))) AND VAR007);

VAR009:=IF((CLOSE > 1000),VAR007,VAR008);

VAR00F:=CROSS(X1,X2);

MA115:=VAR00F;

低买:=(VAR002 AND VAR003);

黑马起步:=VAR009;

DRAWTEXT(X8,(HIGH * 1.03),'出货'),COLOR9000F5;

DRAWTEXT((黑马起步 > 0),(HIGH * 1.04),'逃命'),COLORFF0000;

逃遁:=(SMA(HIGH,21,2) * 1.05);

阻挡:=(SMA(LOW,21,2) * 0.94);

DRAWTEXT(FILTER(((((((((CLOSE / OPEN) > 1.03) AND ((超跌位2 – REF(超跌位2,1)) > 0)) AND ((CLOSE – REF(CLOSE,1)) > 0)) AND (HIGH < 压力1)) AND (CLOSE < 压力1)) AND ((压力2 – REF(压力2,1)) > 0)) AND (CLOSE < MAN)),3),LOW,'出击'),COLOR646E69;

DRAWTEXT((((((低买 > 0) AND ((X1 – REF(X1,1)) > 0)) AND (HIGH < 压力位)) AND (HIGH < X9)) AND ((X2 – REF(X2,1)) > 0)),LOW,'黑马'),COLOR00FF00;

DRAWTEXT((((CROSS(VAR2C,UPPER) AND (HIGH < 压力1)) AND ((XY – REF(XY,1)) > 0)) AND (HIGH < 支撑)),LOW,'买'),COLORFFFFFF;

DRAWTEXT(FILTER((((((MA115 AND (CLOSE < 压力位)) AND ((人 – REF(人,1)) > 0)) AND ((X1 – REF(X1,1)) > 0)) AND (HIGH < 上1)) AND ((CLOSE / OPEN) > 1.03)),5),LOW,'●买'),COLOR93EE7D;

DRAWTEXT(((((LOW <= 上) AND (HIGH >= 短期底部)) AND (CLOSE >= 长期底部)) AND ((CLOSE / OPEN) > 1.03)),(LOW – 0.08),'★抄底'),COLOR0000FF;

DRAWTEXT(FILTER((((((LOW <= 阻挡线) AND ((MA20 – REF(MA20,1)) > 0)) AND (OPEN <= 上1)) AND (HIGH > 上1)) AND (CLOSE > 阻挡线)),5),LOW,'涨10%'),COLORFFFFFF;

DRAWTEXT(FILTER((((((B8 <= 1) AND (LOW <= 阻挡)) AND (CLOSE > OPEN)) AND (LOW <= 中期大底)) AND (CLOSE >= 长期底部)),3),(LOW – 0.08),'短抄E'),COLORA100FF;

DRAWTEXT(FILTER((((CROSS(趋势,趋) AND (HIGH < M80)) AND (HIGH < 压力1)) AND LLV(LOW,0)),10),LOW,'果断买'),COLOR668800;

DRAWTEXT(FILTER(((CROSS(中线,人) AND (LOW <= 人)) AND (CLOSE >= 人)),4),(LOW – 0.06),'买'),COLOR00FF00;

DRAWTEXT(FILTER((((((((MA20 – REF(MA20,1)) > 0) AND (HIGH < 支撑)) AND ((AA10 – REF(AA10,1)) > 0)) AND (HIGH < 压力1)) AND (VOL >= REF(VOL,1))) AND CROSS(CLOSE,MA20)),57),LOW,'突破生命线'),COLOR0000FF;

DRAWTEXT(FILTER(((((LOW <= MA80) AND (CLOSE > MA80)) AND (CLOSE > OPEN)) AND (短期底部2 <= MA80)),8),LOW,'底'),COLORFFFF00;

DRAWTEXT(((CROSS(MA20,压力位) AND (LOW <= MA20)) AND ((MA20 – REF(MA20,1)) > 0.02)),(LOW – 0.03),'●绝佳买点'),COLORAFA0AF;

DRAWTEXT((((((((CROSS(CLOSE,MA20) AND (HIGH < 压力位)) AND (OPEN < MA20)) AND (HIGH < 支撑)) AND ((MAN – REF(MAN,1)) > 0)) AND ((X1 – REF(X1,1)) > 0)) AND (D < 63)) AND ((MA20 – REF(MA20,1)) > 0)),(LOW – 0.05),'●大牛浮水'),COLOR73777F;

DRAWTEXT(CROSS(中期大底,短期底部),(LOW – 0.02),'短线买');

短趋势线:=MA(CLOSE,13);

中趋势线1:=MA(CLOSE,33),LINETHICK1;

中趋势线:=MA(CLOSE,55);

涨:=IF(短趋势线>REF(短趋势线,1),短趋势线,DRAWNULL),COLORRED,LINETHICK3;

平:=IF(短趋势线=REF(短趋势线,1),短趋势线,DRAWNULL),COLOR00FFFF,LINETHICK3;

跌:=IF(短趋势线<REF(短趋势线,1),短趋势线,DRAWNULL),COLORGREEN,LINETHICK3;

STICKLINE(CROSS(MA(CLOSE,13),C) AND MA(CLOSE,13)>REF(MA(CLOSE,13) ,1) AND V<REF(V,1) AND MA(CLOSE,13)>MA(CLOSE,55) ,L,L*0.98,3,0),COLORYELLOW;

DRAWTEXT(CROSS(MA(CLOSE,13),C) AND INDEXC>MA(INDEXC,13) AND MA(CLOSE,13)>REF(MA(CLOSE,13) ,1) AND V<REF(V,1) AND MA(CLOSE,13)>MA(CLOSE,55) ,L*0.95,'买'),COLORRED,LINETHICK2;

VAR011:=((CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100+(CLOSE-MA(CLOSE,24))/MA(CLOSE,24)*100+(CLOSE-MA(CLOSE,32))/MA(CLOSE,32)*100)/3;

VAR012:=HHV(VAR011>20,10);

DRAWTEXT(VAR011<-20 AND INDEXC<MA(INDEXC,13) AND FILTER(VAR011> REF(VAR011,1),5),L*0.93,'抄底'),COLORYELLOW,LINETHICK2;

VAR013:=IF(MA(CLOSE,13)>REF(MA(CLOSE,13),1),MA(CLOSE,13),DRAWNULL);

DRAWTEXT((IF(CLOSE>MA(CLOSE,13) AND OPEN<CLOSE,-0.1,0))AND((C-REF(C,1))/(REF(C,1))>0.061)AND (MA(CLOSE,13)=VAR013) AND (MA(CLOSE,1),MA(CLOSE,13)) AND (VOL>REF(HHV(VOL,3),1)*2),L*0.98,'主力介入'),COLORMAGENTA;

X:=EMA(((SLOPE(CLOSE,21) * 20) + CLOSE),68);

Y:=EMA(CLOSE,10);

MA1:=MA(CLOSE,1);

MA2:=MA(CLOSE,250);

AA:=CROSS(MA1,MA2);

MA3:=MA(CLOSE,1);

MA4:=MA(CLOSE,16);

BB:=CROSS(MA3,MA4);

MA5:=MA(CLOSE,1);

MA6:=MA(CLOSE,44);

CC:=CROSS(MA5,MA6);

三穿:AA AND BBAND CC;

MA5:=MA(C,5);

MA10:=MA(C,10);

MA30:=MA(C,30);

低:=REF(C,1)<MA5ANDREF(C,1)<MA10ANDREF(C,1)<MA30;

高:=CROSS(C,MA5)ANDCROSS(C,MA10)ANDCROSS(C,MA30);

选股:低AND高;

image.png

[源码注释]通达信公式动态翻译结果

输出XG:2日前的最近2日一直存在收阳线 AND 1日前的收阴线 AND (收盘价-开盘价)/开盘价的绝对值<=0.18 100="" and="">最低价

每日通达信公式解答:

    编写条件:

    今天阳线,今日股价突破昨天最高价的选股公式。

    编写方法:

    XG:REF(C<O&&CO&&C>REF(H,1);

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。