123法则画线指标公式源码_123战法指标公式

hacker|
131

文章目录:

通达信三点预测画线指标公式

通达信三点预测画线指标公式是:DIF:=EMA(CLOSE,12)EMA(CLOSE,29);DEA:=EMA(DIF,9);MD:(DIF-DEA)*2*50;STICKLINE(MD=REF(MD,1) AND MD0,0,MD,2,0),COLORRED;

STICKLINE(MDREF(MD,1) AND MD0,0,MD,2,1),COLORC0C0C0;

STICKLINE(MDREF(MD,1) AND MD0,0,MD,2,0),COLORFF8000;

参考资料:通达信三点指标公式

求通达信画线公式

这个画线公式需要源码,以下是通达信画线指标:

参数设置

AA:=REF(H,N)=HHV(H,2*N+1);{N日前的最高价}

QY:=BACKSET(AA,N+1);{周期记录}

CC:=FILTER(QY,N) AND H=HHV(H,N+1);{周期过滤 最高价最高值}

DDD:=BARSLAST(CC),NODRAW;{CC条件成立的天数}

GDTS:=IF(CC,CURRBARSCOUNT,0),NODRAW;{CC成立 返回交易日的周}

DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS),NODRAW;{DDD成立,返回DDD日前的GDTS,否则返回GDTS}

GDCS1:=CONST(DINGBUTS),NODRAW;{取DINGBUTS值}

GDCS13:=CONST(REF(HIGH,GDCS1-1));

DINGBUTS1:=REF(DINGBUTS,DDD+1),NODRAW;

GDCS2:=CONST(DINGBUTS1);

GDCS23:=CONST(REF(HIGH,DINGBUTS1-1));

XG1:=BACKSET(ISLASTBAR,GDCS1);{ ISLASTBAR 判断是否为最后一个周期}

XG2:=BACKSET(ISLASTBAR,DINGBUTS1);

STICKLINE(XG2,GDCS23,GDCS23,0.5,1),COLORWHITE,LINETHICK3;{白线}

STICKLINE(XG1,GDCS13,GDCS13,0.5,1),COLORYELLOW,LINETHICK3;{黄线}

{谷线}

AA1:=REF(L,N1)=LLV(L,2*N1+1);

QY1:=BACKSET(AA1,N1+1);

CC1:=FILTER(QY1,N1) AND L=LLV(L,N1+1);

DD1:=BARSLAST(CC1);

DDTS:=IF(CC1,CURRBARSCOUNT,0);

DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);

DDCS1:=CONST(DDTS1);

DDCS13:=CONST(REF(L,DDCS1-1));

DDTS2:=REF(DDTS1,DD1+1);

DDCS2:=CONST(DDTS2);

DDCS23:=CONST(REF(L,DDTS2-1));

XD1:=BACKSET(ISLASTBAR,DDCS1);

XD2:=BACKSET(ISLASTBAR,DDTS2);

STICKLINE(XD2,DDCS23,DDCS23,0.5,1),COLORMAGENTA,LINETHICK3;

STICKLINE(XD1,DDCS13,DDCS13,0.5,1),COLORCYAN,LINETHICK3;

{压力支撑}

M:=INTPART(3*N2/5);{压力线取}

AAA:=REF(H,M)=HHV(H,2*M+1);

QYY:=BACKSET(AAA,M+1);

CCC:=FILTER(QYY,M) AND H=HHV(H,M+1);

DDDD:=BARSLAST(CCC),NODRAW;

GDTSS:=IF(CCC,CURRBARSCOUNT,0),NODRAW;

DINGBUTSS:=IF(DDDD,REF(GDTSS,DDDD),GDTSS),NODRAW;

GDCS11:=CONST(DINGBUTSS),NODRAW;

DINGBUTS11:REF(DINGBUTSS,DDDD+1),NODRAW;

GDCS22:=CONST(DINGBUTS11);

高点压力M:DRAWLINE(CURRBARSCOUNT=GDCS22,H,CURRBARSCOUNT=GDCS11,H,1),COLORBB8000,LINETHICK2;

W:=INTPART(3*N3/5);

AA11:=REF(L,W)=LLV(L,2*W+1);

QY11:=BACKSET(AA11,W+1);

CC11:=FILTER(QY11,W) AND L=LLV(L,W+1);

DD11:=BARSLAST(CC11);

DDTSS:=IF(CC11,CURRBARSCOUNT,0);

DDTS11:=IF(DD11,REF(DDTSS,DD11),DDTSS);

DDCS11:=CONST(DDTS11);

DDTS22:=REF(DDTS11,DD11+1);

DDCS22:=CONST(DDTS22);

低点支撑M:DRAWLINE(CURRBARSCOUNT=DDCS22,L,CURRBARSCOUNT=DDCS11,L,1),COLORMAGENTA,LINETHICK2;

{

ZGSTAR:=(高点压力M+低点支撑M)/2;

ZGEND:=CONST((高点压力M+低点支撑M)/2);

STARDAY:=IF(DDCS2GDCS2,DDCS2,GDCS2);

中轨:DRAWLINE(CURRBARSCOUNT=STARDAY,ZGSTAR,ISLASTBAR,ZGEND,1),COLORFF55BB,LINETHICK2;

}

{DRAWKLINE(H,O,L,C);}

{主图中的倍量K线如何变黄色}

V2V:=V/REF(V,1)=1.9 AND CREF(C,1);

STICKLINE(V2V,O,C,-1,0),COLORYELLOW;

{涨停}

ZT:=C/REF(C,1)1.097;

STICKLINE(ZT,O,C,-1,0),COLORMAGENTA;

ZZ:=(O+H+L)/3;

黄金买点:EMA(ZZ,7),COLORGREEN,LINETHICK1;

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);

BB1:=LAA1*0.9;

EE1:=VOLMA(V,5)*1.5;

FF1:=BB1 AND CC1 AND DD1 AND EE1;

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

P1:=IF(CREF(O,1) AND F0,1,0);

P2:=IF(CREF(O,2) AND F0,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(CLOSE,TT1)AND J55,LOW,'买'),COLORRED;

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

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

A1:=EMA(C,14)COLORWHITE,LINETHICK1;

A1X:=(A1-REF(A1,1))/REF(A1,1)*100,NODRAW;

出击:IF(A1X=0,REF(EMA(C,14),BARSLAST(CROSS(A1X,0))+1),DRAWNULL)COLORRED,LINETHICK1;

休假:IF(A1X0,REF(EMA(C,14),BARSLAST(CROSS(0,A1X))+1),DRAWNULL)COLORGREEN,LINETHICK1;

STICKLINE(CROSS(A1X,0),C,O,2,0)COLORYELLOW;

STICKLINE(CROSS(0,A1X),C,O,2,0)COLORGREEN;

STICKLINE(CROSS(A1X,0)OR CROSS(0,A1X),REF(EMA(C,14),1),REF(EMA(C,14),1)*0.998,2,0)COLORWHITE;

STICKLINE(ISLASTBAR,REF(EMA(C,14),1),REF(EMA(C,14),1)*0.998,5,0)COLORWHITE;

求通达信缠论精确笔主图画线公式

{精确缠论中枢公式}

 

{N1:1,100,10;N2:1,100,10;DISP:=1,3,2};

n1:=10;

n2:=10;

DISP:=2;

N1:=10;N2:=10;DISP:=2;

K:=IF(PERIOD=5,1,{日}

IF(PERIOD=6,1,{周}

IF(PERIOD=7,1,{月}

IF(PERIOD=8,1,{多分钟}

IF(PERIOD=9,1,{多日}

IF(PERIOD=10,1,{季}

IF(PERIOD=11,2,{年}

IF(PERIOD=4,1,{60F}

IF(PERIOD=3,1,{30F}

IF(PERIOD=2,1,{15F}

IF(PERIOD=1,1{5F},1{1F})))))))))))/10;

P1:=PEAK(1,K*N1,1);

P2:=PEAK(1,K*N1,2);

WP1:=PEAKBARS(1,K*N1,1);

WP2:=PEAKBARS(1,K*N1,2);

T1:=TROUGH(2,K*N2,1);

T2:=TROUGH(2,K*N2,2);

WT1:=TROUGHBARS(2,K*N2,1);

WT2:=TROUGHBARS(2,K*N2,2);

TJ1:=P1T1 AND P2T2 ;

ZD:=MAX(T1,T2);

ZG:=MIN(P1,P2);

LL:=MIN(T1,T2);

HH:=MAX(P1,P2);

TJ2:=FILTER(ZGZD,2);

TJ3:=ZG=REF(ZG,BARSLAST(TJ2)) OR ZD=REF(ZD,BARSLAST(TJ2));

TJ4:=TJ1TJ2NOT(TJ3);

TJ5:=BETWEEN(ZD,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,REF(BARSLAST(TJ4),1)));

TJ6:=BETWEEN(ZG,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,REF(BARSLAST(TJ4),1)));

TJ7:=ZGREF(ZG,REF(BARSLAST(TJ4),1))ZDREF(ZD,REF(BARSLAST(TJ4),1));

TJ8:=TJ4NOT(TJ5 OR TJ6 OR TJ7);

ZSD:=IF(TJ8,ZD,DRAWNULL);

ZSG:=IF(TJ8,ZG,DRAWNULL);

ZSH:=IF(TJ8,HH,DRAWNULL);

ZSL:=IF(TJ8,LL,DRAWNULL);

STICKLINE(TJ8,ZSH,ZSL,0,-1),COLORMAGENTA;

STICKLINE(TJ8,ZSD,ZSG,IF(DISP=1,3,0),1),COLORMAGENTA;

DRAWTEXT(DISP=2,ZSH,'中枢'),COLORWHITE;

中枢高:PLOYLINE(DISP=2,REF(ZSD,BARSLAST(TJ8))),CIRCLEDOT,COLORLIRED;

中枢低:PLOYLINE(DISP=2,REF(ZSG,BARSLAST(TJ8))),CIRCLEDOT,COLORLIGREEN;

{中枢最高:PLOYLINE(DISP=2,REF(ZSH,BARSLAST(TJ8))),POINTDOT,COLORRED;

中枢最低:PLOYLINE(DISP=2,REF(ZSL,BARSLAST(TJ8))),POINTDOT,COLORGREEN;}

趋势高:PLOYLINE(DISP=3,ZIG(1,K*N1)),COLORLIBLUE;

趋势低:PLOYLINE(DISP=3,ZIG(2,K*N2)),COLORLIBLUE;

局部低点预选A:=BACKSET(LLV(L,5)REF(LLV(L,4),1),4);

局部低点预选B:=BACKSET(局部低点预选A=0 AND REF(局部低点预选A,1)=1,2);

局部低点预选C:=IF(局部低点预选B=1 AND REF(局部低点预选B,1)=0,-1,0);

局部高点预选A:=BACKSET(HHV(H,5)REF(HHV(H,4),1),4);

局部高点预选B:=BACKSET(局部高点预选A=0 AND REF(局部高点预选A,1)=1,2);

局部高点预选C:=IF(局部高点预选B=1 AND REF(局部高点预选B,1)=0,1,0);

缺口判断:=IF(LREF(H,1),1,IF(HREF(L,1),-1,0));

距前高天:=BARSLAST(局部高点预选C=1);

距前低天:=BARSLAST(局部低点预选C=-1);

小值周期:=LOWRANGE(L);

大值周期:=TOPRANGE(H);

低保留AA:=IF(局部低点预选C=-1 AND REF(距前高天,1)REF(距前低天,1) AND LLV(L,距前高天+1)REF(LLV(L,距前高天+1),1),-1,0);

低保留AB:=IF(局部低点预选C=-1 AND REF(距前高天,1)=REF(距前低天,1) AND (距前高天=4 OR LLV(缺口判断,距前高天)=-1 OR LLV(L,距前低天+2)REF(LLV(L,距前低天+1),1)),-1,0);

低保留S:=IF((低保留AA=-1 OR 低保留AB=-1) AND LREF(H,距前高天+1),-1,0);

预判:=IF((距前低天4 AND HHV(缺口判断,距前低天)!=1) OR REF(低保留S,距前低天)=0,1,0);

判断:=IF(局部高点预选C=1 AND REF(距前低天,1)=REF(距前高天,1) AND 预判=1 AND 大值周期REF(小值周期,距前低天+1) AND 大值周期REF(小值周期,距前低天) AND 大值周期REF(大值周期,距前高天),1,0);

高保留A:=IF(局部高点预选C=1 AND REF(距前低天,1)REF(距前高天,1) AND HHV(H,距前低天+1)REF(HHV(H,距前低天+1),1),1,0);

高保留B:=IF(局部高点预选C=1 AND REF(距前低天,1)=REF(距前高天,1) AND REF(低保留S,距前低天)=-1 AND (距前低天=4 OR HHV(缺口判断,距前低天)=1),1,0);

高保留:=IF((高保留A=1 OR 高保留B=1 OR 判断=1) AND HREF(L,距前低天+1),1,0);

预判A:=IF((距前高天4 AND HHV(缺口判断,距前高天)!=1) OR REF(高保留,距前高天)=0,1,0);

判断A:=IF(局部低点预选C=-1 AND REF(距前高天,1)=REF(距前低天,1) AND 预判A=1 AND 小值周期REF(大值周期,距前高天+1) AND 小值周期REF(大值周期,距前高天) AND 小值周期REF(小值周期,距前低天),-1,0);

低保留A:=IF(局部低点预选C=-1 AND REF(距前高天,1)REF(距前低天,1) AND LLV(L,距前高天+1)REF(LLV(L,距前高天+1),1),-1,0);

低保留B:=IF(局部低点预选C=-1 AND REF(距前高天,1)=REF(距前低天,1) AND (距前高天=4 OR LLV(缺口判断,距前高天)=-1 OR 判断A=-1),-1,0);

低保留:=IF((低保留A=-1 OR 低保留B=-1) AND LREF(H,距前高天+1),-1,0);

距前高天A:=BARSLAST(高保留=1);

距前低天A:=BARSLAST(低保留=-1);

预判X:=IF((距前低天A4 AND HHV(缺口判断,距前低天A)!=1) OR REF(低保留,距前低天A)=0,1,0);

判断X:=IF(局部高点预选C=1 AND REF(距前低天A,1)=REF(距前高天A,1) AND 预判X=1 AND 大值周期REF(小值周期,距前低天A+1) AND 大值周期REF(小值周期,距前低天A) AND 大值周期REF(大值周期,距前高天A),1,0);

高保留XA:=IF(局部高点预选C=1 AND REF(距前低天A,1)REF(距前高天A,1) AND HHV(H,距前低天A+1)REF(HHV(H,距前低天A+1),1),1,0);

高保留XB:=IF(局部高点预选C=1 AND REF(距前低天A,1)=REF(距前高天A,1) AND REF(低保留,距前低天A)=-1 AND (距前低天A=4 OR HHV(缺口判断,距前低天A)=1),1,0);

高保留X:=IF((高保留XA=1 OR 高保留XB=1 OR 判断X=1) AND HREF(L,距前低天A+1),1,0);

预判XA:=IF((距前高天A4 AND HHV(缺口判断,距前高天A)!=1) OR REF(高保留XA,距前高天A)=0,1,0);

判断XA:=IF(局部低点预选C=-1 AND REF(距前高天A,1)=REF(距前低天A,1) AND 预判XA=1 AND 小值周期REF(大值周期,距前高天A+1) AND 小值周期REF(大值周期,距前高天A) AND 小值周期REF(小值周期,距前低天A),-1,0);

低保留XA:=IF(局部低点预选C=-1 AND REF(距前高天A,1)REF(距前低天A,1) AND LLV(L,距前高天A+1)REF(LLV(L,距前高天A+1),1),-1,0);

低保留XB:=IF(局部低点预选C=-1 AND REF(距前高天A,1)=REF(距前低天A,1) AND (距前高天A=4 OR LLV(缺口判断,距前高天A)=-1 OR 判断XA=-1),-1,0);

低保留X:=IF((低保留XA=-1 OR 低保留XB=-1) AND LREF(H,距前高天A+1),-1,0);

距前高天YA:=BARSLAST(高保留X=1);

距前低天YA:=BARSLAST(低保留X=-1);

预判YX:=IF((距前低天YA4 AND HHV(缺口判断,距前低天YA)!=1) OR REF(低保留X,距前低天YA)=0,1,0);

判断YX:=IF(局部高点预选C=1 AND REF(距前低天YA,1)=REF(距前高天YA,1) AND 预判YX=1 AND 大值周期REF(小值周期,距前低天YA+1) AND 大值周期REF(小值周期,距前低天YA) AND 大值周期REF(大值周期,距前高天YA),1,0);

高保留YXA:=IF(局部高点预选C=1 AND REF(距前低天YA,1)REF(距前高天YA,1) AND HHV(H,距前低天YA+1)REF(HHV(H,距前低天YA+1),1),1,0);

高保留YXB:=IF(局部高点预选C=1 AND REF(距前低天YA,1)=REF(距前高天YA,1) AND REF(低保留X,距前低天YA)=-1 AND (距前低天YA=4 OR HHV(缺口判断,距前低天YA)=1),1,0);

高保留YX:=IF((高保留YXA=1 OR 高保留YXB=1 OR 判断YX=1) AND HREF(L,距前低天YA+1),1,0);

预判YXA:=IF((距前高天YA4 AND HHV(缺口判断,距前高天YA)!=1) OR REF(高保留YXA,距前高天YA)=0,1,0);

判断YXA:=IF(局部低点预选C=-1 AND REF(距前高天YA,1)=REF(距前低天YA,1) AND 预判YXA=1 AND 小值周期REF(大值周期,距前高天YA+1) AND 小值周期REF(大值周期,距前高天YA) AND 小值周期REF(小值周期,距前低天YA),-1,0);

低保留YXA:=IF(局部低点预选C=-1 AND REF(距前高天YA,1)REF(距前低天YA,1) AND LLV(L,距前高天YA+1)REF(LLV(L,距前高天YA+1),1),-1,0);

低保留YXB:=IF(局部低点预选C=-1 AND REF(距前高天YA,1)=REF(距前低天YA,1) AND (距前高天YA=4 OR LLV(缺口判断,距前高天YA)=-1 OR 判断YXA=-1),-1,0);

低保留YX:=IF((低保留YXA=-1 OR 低保留YXB=-1) AND LREF(H,距前高天YA+1),-1,0);

AAAD:=IF(高保留YX=1 AND 低保留YX=-1 AND HREF(H,REF(距前高天YA,1)+2),1,IF(高保留YX=1 AND 低保留YX=-1 AND LREF(L,REF(距前低天YA,1)+2),-1,0));

极点保留:=IF(AAAD=0,高保留YX+低保留YX,AAAD);

局部极点:IF(极点保留=-1,L,IF(极点保留=1,H,DRAWNULL)) CIRCLEDOT COLORYELLOW;

DRAWLINE(极点保留=-1,局部极点,极点保留=1,局部极点,0)COLORLIRED;

DRAWLINE(极点保留=1,局部极点,极点保留=-1,局部极点,0)COLORYELLOW;

DD1:=BARSLAST(ABS(极点保留)!=1);{

DRAWTEXT(极点保留=1,局部极点,'卖'),COLORGREEN;

DRAWTEXT(极点保留=-1,局部极点,'买'),COLORRED;}

MA5:MA(CLOSE,5),COLORFF00FF,LINETHICK2;判:IF(MA5REF(MA5,1),MA5,DRAWNULL),COLORWHITE,LINETHICK2;

123法则的介绍

辨别趋势、追随趋势,是每一个技术分析人士的追求,维克多·斯波朗迪依据道氏理论,将趋势识别这项复杂艰巨的任务,简化为123法则。123法则是相当于道氏理论对于趋势发生转变的定义,包括:1.首先趋势线被突破;2.上升趋势不再创新高,或下降趋势不再创新低(即只发生试探前期高低点行为);3.下降趋势中,价格向上突破前期反弹高点,或上升趋势中,价格向下穿越先前的短期回档低点。这三点按不同的顺序的组合,优点是简单有效;缺点是其入场点较晚,通常已经错失一段相当大的行情。123法则出自维克多·斯波朗迪《专业投机原理》第68-69页。2B法则出现在第73页。123法则与2B法则

3条大神的评论

  • avatar
    访客 2022-07-02 下午 10:29:14

    天,1)REF(距前低天,1) AND LLV(L,距前高天+1)REF(LLV(L,距前高天+1),1),-1,0);低保留AB:=IF(局部低点预选C=-1 AND REF(距前高天,1)=REF(距前低天,1) AND (距前高天=4 OR LLV(缺口判断,距前高天)=-1 OR LLV(L

  • avatar
    访客 2022-07-03 上午 05:37:32

    OR 低保留YXB=-1) AND LREF(H,距前高天YA+1),-1,0);AAAD:=IF(高保留YX=1 AND 低保留YX=-1 AND HREF(H,REF(距前高天YA,1)+2),1,IF(高保留YX=1 AND 低保留YX=-1 AND L

  • avatar
    访客 2022-07-03 上午 08:33:52

    ERIOD=9,1,{多日}IF(PERIOD=10,1,{季}IF(PERIOD=11,2,{年}IF(PERIOD=4,1,{60F}IF(PERIOD=3,1,{30F}IF(PERIOD=2,1,{15F}IF(PER

发表评论