缠论中枢主图公式源码_缠论中枢代码

hacker|
121

文章目录:

求一个通达信可显示缠论中枢的主图公式!

给你,下载后直接在通达信软件里安装,从功能=专家系统=公式管理器=导入公式,选择要导入的公式xt即可

求缠论中枢公式

因为缠师的中枢,是包含各种结构的,比如30分钟的中枢,就是5分钟的三段形成的,5分钟的中枢又是1分钟的三段组成的,数学公式肯定不能严谨表达出来,需要自己去找分型,画笔,画线段,画中枢。所以要么就扎扎实实的画,力求精确。要么,就用最简单的平行线去画一个大概范围,在大级别上,做模糊操作。

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

{精确缠论中枢公式}

 

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

缠论中枢画线公式

G:=MA(C,5);

D:=MA(C,10);

HH:=REF(H,5)=HHV(H,11);

LL:=REF(L,5)=LLV(L,11);

FG01:=BACKSET(HH,6)BACKSET(HH,5) ;

FD01:=BACKSET(LL,6)BACKSET(LL,5) ;

FG02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND GD,FG01,

IF(BARSLAST(FD01)BARSLAST(FG01),FG01,0));

FD02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND DG,FD01,

IF(BARSLAST(FG01)BARSLAST(FD01),FD01,0));

FG0:=FG02 AND H=HHV(H,BARSLAST(FD02));

FD0:=FD02 AND L=LLV(L,BARSLAST(FG02));

GP:=IF(FG0,H,DRAWNULL),CIRCLEDOT,COLORCYAN;

DP:=IF(FD0,L,DRAWNULL),CIRCLEDOT,COLORCYAN;

GQ:=LREF(H,1) AND DAY!=REF(DAY,1);

DQ:=HREF(L,1) AND DAY!=REF(DAY,1);

GQL:=REF(L,BARSLAST(GQ));

DQH:=REF(H,BARSLAST(DQ));

FGH:=REF(H,BARSLAST(FG0));

FGL:=REF(L,BARSLAST(FG0));

FGH1:=REF(H,BARSLAST(FG0)+1);

FGL1:=REF(L,BARSLAST(FG0)+1);

FGH2:=REF(H,BARSLAST(FG0)+2);

FGL2:=REF(L,BARSLAST(FG0)+2);

FDH:=REF(H,BARSLAST(FD0));

FDL:=REF(L,BARSLAST(FD0));

FDH1:=REF(H,BARSLAST(FD0)+1);

FDL1:=REF(L,BARSLAST(FD0)+1);

FDH2:=REF(H,BARSLAST(FD0)+2);

FDL2:=REF(L,BARSLAST(FD0)+2);

FGZH:=IF(FGL=FGL1,FGH2,FGH1);

FGZL:=IF(FGH1FGL,FGL,IF(FGL=FGL1,FGL2,FGL1));

FDZH:=IF(FDL1FDH,FDH,IF(FDH=FDH1,FDH2,FDH1));

FDZL:=IF(FDH=FDH1,FDL2,FDL1);

FG1:=FGHFDZH AND FG0;

FD1:=FDLFGZL AND FD0;

FG:=FG1 AND FGHFDH AND FGLFDL AND FGL1FDL;

FD:=FD1 AND FDLFGL AND FDHFGH AND FDH1FGH;

BH0:=(H=REF(H,1) AND L=REF(L,1)) OR (H=REF(H,1) AND L=REF(L,1));

BHG:=COUNT(BH0,BARSLAST(FD0));

BHD:=COUNT(BH0,BARSLAST(FG0));

BGQ:=COUNT(GQ,BARSLAST(FD0));

BDQ:=COUNT(DQ,BARSLAST(FG0));

BK0:=IF(BHG0,BHG+2+1,IF(BHD,BHD+2+1,3));

BK:=IF(BGQ,BK0-BGQ,IF(BDQ,BK0-BDQ,BK0));

G1X:=(FG AND BARSLAST(FD)BK);

D1X:=(FD AND BARSLAST(FG)BK);

G1:=(FG0 AND REF(H,BARSLAST(FG0))=REF(H,BARSLAST(G1X)) AND BARSLAST(D1X)BARSLAST(G1X))

OR (FG1 AND COUNT(GQ,BARSLAST(FD1))0 AND REF(H,BARSLAST(FG1))REF(H,BARSLAST(G1X)));

D1:=(FD0 AND REF(L,BARSLAST(FD0))=REF(L,BARSLAST(D1X)) AND BARSLAST(G1X)BARSLAST(D1X))

OR (FD1 AND COUNT(DQ,BARSLAST(FG1))0 AND REF(L,BARSLAST(FD1))REF(H,BARSLAST(D1X)));

G1H:=IF(BARSLAST(D1)BARSLAST(G1),REF(H,BARSLAST(G1)),REF(H,BARSLAST(D1))),;

D1L:=IF(BARSLAST(G1)BARSLAST(D1),REF(L,BARSLAST(D1)),REF(L,BARSLAST(G1)));

G2:=G1 AND H=HHV(G1H,BARSLAST(D1)+1) AND HREF(H,1) AND BARSLAST(D1)BARSLAST(G1);

D2:=D1 AND L=LLV(D1L,BARSLAST(G1)+1) AND LREF(L,1) AND BARSLAST(G1)BARSLAST(D1);

G3:=G2 OR (FG0 AND REF(H,BARSLAST(FG0))REF(H,BARSLAST(G2)) AND BARSLAST(D2)BARSLAST(G2));

D3:=D2 OR (FD0 AND REF(L,BARSLAST(FD0))REF(L,BARSLAST(D2)) AND BARSLAST(G2)BARSLAST(D2));

GPB:=IF(G1X,H,DRAWNULL),CIRCLEDOT,COLORYELLOW;

DPB:=IF(D1X,L,DRAWNULL),CIRCLEDOT,COLORYELLOW;

{画线}

NN:=G3;

UU:=D3;

L1:DRAWLINE(UU,L,NN, H,0),COLORYELLOW,DOTLINE;

L2:DRAWLINE(NN,H,UU, L,0),COLORWHITE,DOTLINE;

哪位帮忙一下,把通达信的缠论分笔及中枢主图指标公式 改成大智慧也可以用的

同花顺缠论分笔及中枢主图指标公式

KU1:=IF(HIGH=HHV(HIGH,3),1,0);

KD1:=IF(LOW=LLV(LOW,3),1,0);

UL:=IF(REF(KU1,2)=1 AND REF(KU1,1)=0

AND KU1=0,REF(HIGH,2),REF(HIGH,2+BARSLAST(REF(KU1,2)=1

AND REF(KU1,1)=0 AND KU1=0)));

DL:=IF(REF(KD1,2)=1 AND REF(KD1,1)=0 AND KD1=0,REF(LOW,2),REF(LOW,2+BARSLAST(REF(KD1,2)=1

AND REF(KD1,1)=0 AND KD1=0)));

HV:=HUL AND HREF(H,1) ;

LV:=LDL AND LREF(L,1) ;

GP:=BARSLAST(HV);

DP:=BARSLAST(LV);

IP:=IF(GP=0,DP,GP)3;

HV1:=HV AND IP AND H=HHV(H,BARSLAST(LV));

LV1:=LV AND IP AND L=LLV(L,BARSLAST(HV));

DRAWLINE(LV1,LOW,HV1, HIGH,0),coloryellow,LINETHICK2;

DRAWLINE(HV1,HIGH,LV1, LOW,0),colormagenta,LINETHICK2;

///加入中枢判定

//简化版

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

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:=TJ1 AND TJ2 AND NOT(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)) AND ZDREF(ZD,REF(BARSLAST(TJ4),1));

TJ8:=TJ4 AND NOT(TJ5 OR TJ6 OR TJ7);

ZSD:=IF(TJ8,ZD,REF(ZD,1));//,coloryellow;

ZSG:=IF(TJ8,ZG,REF(ZG,1));//,colormagenta;

ZSH:=IF(TJ8,HH,REF(HH,1));//,colorblue;

ZSL:=IF(TJ8,LL,REF(LL,1));//,colorgreen;

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

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

DRAWTEXT(DISP=2,ZSH,),colorwhite;

//中枢高

中枢高:ZSG,colormagenta;

POLYLINE(DISP=2,REF(ZSG,BARSLAST(TJ8))),CIRCLEDOT,colormagenta;

//中枢低:

中枢低:ZSD,coloryellow;

POLYLINE(DISP=2,REF(ZSD,BARSLAST(TJ8))),CIRCLEDOT,coloryellow;

//中枢最高:

中枢最高:ZSH,colorred;

POLYLINE(DISP=2,REF(ZSH,BARSLAST(TJ8))),POINTDOT,colorred;

//中枢最低:

中枢最低:ZSL,colorgreen;

POLYLINE(DISP=2,REF(ZSL,BARSLAST(TJ8))),POINTDOT,colorgreen;

//趋势高:

//QSGD1:POLYLINE(DISP=3,ZIG(1,K*N1)),colorblue;

//趋势低:

//QSDD1:POLYLINE(DISP=3,ZIG(2,K*N2)),colorblue;

MA5:MA(CLOSE,5),COLORFF00FF,Linethick1;

//COLORFF00FF,LINETHICK2;

命真好:=MA5REF(MA5,1);

命真坏:=MA5REF(MA5,1);

//判定:

PARTLINE(MA5,命真好,coloryellow,命真坏,colorblue,MA5,COLORFF00FF),linethick3;

//F1:IF(MA5REF(MA5,1),MA5,NULL),colorwhite,LINETHICK2;

2条大神的评论

  • avatar
    访客 2022-07-12 下午 09:44:19

    );D1X:=(FD AND BARSLAST(FG)BK);G1:=(FG0 AND REF(H,BARSLAST(FG0))=REF(H,BARSLAST(G1

  • avatar
    访客 2022-07-13 上午 04:50:08

    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(局部低点预

发表评论