通达信【预测模型】主图指标 缠论自动划箱体 看透压力支撑对趋势胸有成竹 源码
{预测模型主图}
N:=3;{逻辑周期参数调整为3} A1:=REF(HIGH,N)=HHV(HIGH,2*N+1);
B1:=FILTER(A1,N);
C1:=BACKSET(B1,N+1);
D1:=FILTER(C1,N);
A2:=REF(LOW,N)=LLV(LOW,2*N+1);
B2:=FILTER(A2,N);
C2:=BACKSET(B2,N+1);
D2:=FILTER(C2,N);
E1:=(REF(LLV(LOW,2*N),1)+REF(HHV(HIGH,2*N),1))/2;
E2:=(HIGH+LOW)/2;
H1:=(D1 AND NOT(D2 AND E1>=E2)) OR ISLASTBAR OR BARSCOUNT(CLOSE)=1;
L1:=(D2 AND NOT(D1 AND E1< E2));
H2:=(D1 AND NOT(D2 AND E1>=E2));
X1:=REF(BARSLAST(H1),1)+1;
F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,LOW,10000),X1));
G1:=F1>REF(F1,1);
I1:=BACKSET(G1,2);
LD:=I1>REF(I1,1);
L2:=LD OR ISLASTBAR OR BARSCOUNT(CLOSE)=1;
X2:=REF(BARSLAST(L2),1)+1;
F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,HIGH,0),X2));
G2:=F2>REF(F2,1);
I2:=BACKSET(G2,2);
HD:=I2>REF(I2,1);
J1:=BACKSET(ISLASTBAR,MIN(BARSLAST(HD),BARSLAST(LD))+1);
J2:=J1>REF(J1,1);
A3:=H< REF(H,REF(BARSLAST(HD),1)+1);
B3:=REF(H,REF(BARSLAST(HD),1)+1)>REF(H,REF(BARSLAST(HD),1)+2+REF(BARSLAST(HD),REF(BARSLAST(HD),1)+2));
D3:=A3 AND B3 AND HD;
E3:=BACKSET(D3,REF(BARSLAST(HD),1)+2);
HH:=E3>REF(E3,1);
A4:=L>REF(L,REF(BARSLAST(LD),1)+1);
B4:=REF(L,REF(BARSLAST(LD),1)+1)< REF(L,REF(BARSLAST(LD),1)+2+REF(BARSLAST(LD),REF(BARSLAST(LD),1)+2));
D4:=A4 AND B4 AND LD;
E4:=BACKSET(D4,REF(BARSLAST(LD),1)+2);
LL:=E4>REF(E4,1);
H3:=HH OR ISLASTBAR OR BARSCOUNT(C)=1;
X3:=REF(BARSLAST(H3),1)+1;
F3:=BACKSET(H3 AND COUNT(LL,X3)>0,LLVBARS(IF(LL,L,POW(10,20)),X3));
G3:=F3>REF(F3,1);
I3:=BACKSET(G3,2);
LZ:=I3>REF(I3,1);
L4:=LZ OR ISLASTBAR OR BARSCOUNT(C)=1;
X4:=REF(BARSLAST(L4),1)+1;
F4:=BACKSET(L4 AND COUNT(HH,X4)>0,HHVBARS(IF(HH,H,-POW(10,20)),X4));
G4:=F4>REF(F4,1);
I4:=BACKSET(G4,2);
HZ:=I4>REF(I4,1);
K1:=BACKSET(ISLASTBAR,MIN(BARSLAST(HZ),BARSLAST(LZ))+1);
K2:=K1>REF(K1,1);
UU:=BACKSET(ISLASTBAR,BARSLAST(LD)+1);
VV:=UU>REF(UU,1);
WW:=BACKSET(VV,REF(BARSLAST(LD),1)+2);
XX:=WW>REF(WW,1);
UU2:=BACKSET(ISLASTBAR,BARSLAST(HD)+1);
VV2:=UU2>REF(UU2,1);
WW2:=BACKSET(VV2,REF(BARSLAST(HD),1)+2);
XX2:=WW2>REF(WW2,1);
YY:=BACKSET(XX,REF(BARSLAST(LD),1)+2);
ZZ:=YY>REF(YY,1);{前三低天数}
YY2:=BACKSET(XX2,REF(BARSLAST(HD),1)+2);
ZZ2:=YY2>REF(YY2,1);{前三高天数}
前一低:=REF(L,BARSLAST(VV));
前二低:=REF(L,BARSLAST(XX));
前一高:=REF(H,BARSLAST(VV2));
前二高:=REF(H,BARSLAST(XX2));
前三低:=REF(L,BARSLAST(ZZ));
前三高:=REF(H,BARSLAST(ZZ2));
DQD1:CONST(BARSLAST(VV)),NODRAW;
DQD2:=CONST(BARSLAST(XX));
DQH1:CONST(BARSLAST(VV2)),NODRAW;
DQH2:=CONST(BARSLAST(XX2));
DQH3:=CONST(BARSLAST(ZZ2));
DQD3:=CONST(BARSLAST(ZZ2));
HQD1:=REF(L,BARSLAST(VV));
HQD2:=REF(L,BARSLAST(XX));
HQH1:=REF(H,BARSLAST(VV2));
HQH2:=REF(H,BARSLAST(XX2));
HQH3:=REF(H,BARSLAST(ZZ2));
HQD3:=REF(L,BARSLAST(ZZ));
{-----通用模块-缠论笔画连线---}
XAA1:DRAWLINE(CURRBARSCOUNT=(IF(DQH1>DQD1,CONST(BARSLAST(XX2)+1),CONST(BARSLAST(XX))+1)),(IF(DQH1>DQD1,前二高,前二低)),CURRBARSCOUNT=IF(DQH1>DQD1,CONST(BARSLAST(XX))+1,CONST(BARSLAST(XX2))+1),(IF(DQH1>DQD1,前二低,前二高)),0),COLORRED,LINETHICK1;{前一高一低连线}
XAA2:DRAWLINE(CURRBARSCOUNT=(IF(DQH1>DQD1,CONST(BARSLAST(XX)+1),CONST(BARSLAST(XX2))+1)),(IF(DQH1>DQD1,前二低,前二高)),CURRBARSCOUNT=IF(DQH1>DQD1,CONST(BARSLAST(VV2))+1,CONST(BARSLAST(VV))+1),(IF(DQH1>DQD1,前一高,前一低)),0),COLORRED,LINETHICK1;{前一高一低连线}
XAA3:DRAWLINE(CURRBARSCOUNT=(IF(DQH1>DQD1,CONST(BARSLAST(VV2)+1),CONST(BARSLAST(VV))+1)),(IF(DQH1>DQD1,前一高,前一低)),CURRBARSCOUNT=IF(DQH1>DQD1,CONST(BARSLAST(VV))+1,CONST(BARSLAST(VV2))+1),(IF(DQH1>DQD1,前一低,前一高)),1),DOTLINE,COLORRED;{前一高一低连线}
XAA4:DRAWLINE(CURRBARSCOUNT=(IF(DQH1>DQD1,CONST(BARSLAST(VV2)+1),CONST(BARSLAST(VV))+1)),(IF(DQH1>DQD1,前一高,前一低)),CURRBARSCOUNT=IF(DQH1>DQD1,CONST(BARSLAST(VV))+1,CONST(BARSLAST(VV2))+1),(IF(DQH1>DQD1,前一低,前一高)),0),COLORRED,LINETHICK3;{前一高一低连线}{********最后一笔逻辑判断提示****开始*****}
DRAWTEXT_FIX(ISLASTBAR AND DQH1>DQD1,0.02,0.01,0,STRCAT('【最后一笔主形态】','【**下跌**】')),COLORMAGENTA;
DRAWTEXT_FIX(ISLASTBAR AND DQH1<DQD1,0.02,0.01,0,STRCAT('【最后一笔主形态】','【**上升**】')),COLORMAGENTA;{********最后一笔逻辑判断提示****结束*****}{HTTPS://T.1YB.CO/L3RI}{********最后形态识别提示***开始******}{---下跌反弹测卖箱体模型形态识别-操盘策略-预测模型---}
DRAWTEXT_FIX(ISLASTBAR AND DQH1>DQD1 AND BETWEEN(C,CONST(HQH1),CONST(HQD1)),0.02,0.08,0,STRCAT('【形态识别】:【收盘价未突破箱体】',' ')),COLORGREEN;
DRAWTEXT_FIX(ISLASTBAR AND DQH1>DQD1 AND BETWEEN(C,CONST(HQH1),CONST(HQD1)),0.02,0.15,0,STRCAT('【操盘策略】:【短线看跌】',' ')),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR AND DQH1>DQD1 AND BETWEEN(C,CONST(HQH1),CONST(HQD1)),0.02,0.22,0,STRCAT('【适用模型】:','【下跌反弹测卖点】')),COLORRED;{---下跌反转突破测卖箱体模型形态识别-操盘策略-预测模型---}
DRAWTEXT_FIX(ISLASTBAR AND DQH1>DQD1 AND C>CONST(HQH1),0.02,0.08,0,STRCAT('【形态识别】:【收盘价破前高点】',' ')),COLORGREEN;
DRAWTEXT_FIX(ISLASTBAR AND DQH1>DQD1 AND C>CONST(HQH1),0.02,0.15,0,STRCAT('【操盘策略】:【短线看涨】',' ')),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR AND DQH1>DQD1 AND C>CONST(HQH1),0.02,0.22,0,STRCAT('【预测模型】:','【下跌转涨测卖点】')),COLORRED;{---下跌跌破箱底测买箱体模型形态识别-操盘策略-预测模型---}
DRAWTEXT_FIX(ISLASTBAR AND DQH1>DQD1 AND C<CONST(HQD1),0.02,0.08,0,STRCAT('【形态识别】:【收盘价破前低点】',' ')),COLORGREEN;
DRAWTEXT_FIX(ISLASTBAR AND DQH1>DQD1 AND C<CONST(HQD1),0.02,0.15,0,STRCAT('【操盘策略】:【短线看跌】',' ')),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR AND DQH1>DQD1 AND C<CONST(HQD1),0.02,0.22,0,STRCAT('【预测模型】:','【下跌寻底测买点】')),COLORRED;{---上升回调测买箱体模型形态识别-操盘策略-预测模型---}
DRAWTEXT_FIX(ISLASTBAR AND DQH1<DQD1 AND BETWEEN(C,CONST(HQH1),CONST(HQD1)),0.02,0.08,0,STRCAT('【形态识别】:【收盘价未破高低点】',' ')),COLORGREEN;
DRAWTEXT_FIX(ISLASTBAR AND DQH1<DQD1 AND BETWEEN(C,CONST(HQH1),CONST(HQD1)),0.02,0.15,0,STRCAT('【操盘策略】:【短线看跌】',' ')),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR AND DQH1<DQD1 AND BETWEEN(C,CONST(HQH1),CONST(HQD1)),0.02,0.22,0,STRCAT('【预测模型】:','【上升回调测买点】')),COLORRED;{---上升突破测卖箱体模型形态识别-操盘策略-预测模型---}
DRAWTEXT_FIX(ISLASTBAR AND DQH1<DQD1 AND C>CONST(HQH1),0.02,0.08,0,STRCAT('【形态识别】:【收盘价突破前高点】',' ')),COLORGREEN;
DRAWTEXT_FIX(ISLASTBAR AND DQH1<DQD1 AND C>CONST(HQH1),0.02,0.15,0,STRCAT('【操盘策略】:【短线看涨】',' ')),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR AND DQH1<DQD1 AND C>CONST(HQH1),0.02,0.22,0,STRCAT('【预测模型】:','【突破上涨测卖点】')),COLORRED;
{---上升反转下跌测买箱体模型形态识别-操盘策略-预测模型---}
DRAWTEXT_FIX(ISLASTBAR AND DQH1<DQD1 AND C<CONST(HQD1),0.02,0.08,0,STRCAT('【形态识别】:【收盘价破前低点】',' ')),COLORGREEN;
DRAWTEXT_FIX(ISLASTBAR AND DQH1<DQD1 AND C<CONST(HQD1),0.02,0.15,0,STRCAT('【操盘策略】:【短线看跌】',' ')),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR AND DQH1<DQD1 AND C<CONST(HQD1),0.02,0.22,0,STRCAT('【预测模型】:','【上升转跌测买点】')),COLORRED;
{********最后形态识别提示***结束******}{********通用模块-画出回或反弹的矩形图******开始*********}
GDH8:=CONST(HQH1),NODRAW;{最近一笔的高点}
DDL8:=CONST(HQD1),NODRAW;{最近一笔的低点}
MIMA8:=GDH8/DDL8;GH801:=SQRT(MIMA8);
GH802:=SQRT(GH801);GH803:=(GH801+GH802-1);
{---画出预测上升或回调的点位---}
XHTCS1:=IF(DQD1>DQH1,CONST(GDH8/GH801),CONST(DDL8*GH801));{上升回调或下跌反弹计算反弹1号位置}
XHTCS2:=IF(DQD1>DQH1,CONST(GDH8/GH802),CONST(DDL8*GH802));{上升回调或下跌反弹计算反弹2号位置}
XHTCS3:=IF(DQD1>DQH1,CONST(GDH8/GH803),CONST(DDL8*GH803));{上升回调或下跌反弹计算反弹3号位置}{--通用模块--画出压力线和支撑线--}
SZHTW0:DRAWLINE(CURRBARSCOUNT=IF(DQD1<DQH1,CONST(DQD2)+1,CONST(DQH2)+1),CONST(HQH1),CURRBARSCOUNT=ISLASTBAR,CONST(HQH1),1),COLORMAGENTA;{画压力线}
SZHTW4:DRAWLINE(CURRBARSCOUNT=IF(DQD1<DQH1,CONST(DQD2)+1,CONST(DQH2)+1),CONST(HQD1),CURRBARSCOUNT=ISLASTBAR,CONST(HQD1),1),COLORMAGENTA;{画支撑线}{--通用模块-画出回调或反弹的水平线--}
SZHTW1:DRAWLINE(CURRBARSCOUNT=IF(DQD1<DQH1,CONST(DQD2)+1,CONST(DQH2)+1),CONST(XHTCS1),CURRBARSCOUNT=ISLASTBAR,CONST(XHTCS1),1),COLORRED;{画回调或反弹水平线}
SZHTW2:DRAWLINE(CURRBARSCOUNT=IF(DQD1<DQH1,CONST(DQD2)+1,CONST(DQH2)+1),CONST(XHTCS2),CURRBARSCOUNT=ISLASTBAR,CONST(XHTCS2),1),COLORRED;{画回调或反弹水平线}
SZHTW3:DRAWLINE(CURRBARSCOUNT=IF(DQD1<DQH1,CONST(DQD2)+1,CONST(DQH2)+1),CONST(XHTCS3),CURRBARSCOUNT=ISLASTBAR,CONST(XHTCS3),1),COLORRED;{画回调或反弹水平线}
{---通用模块-标注矩形左-中-右三个竖线---}
STICKLINE(CURRBARSCOUNT=IF(DQD1<DQH1,CONST(DQD2)+1,CONST(DQH2)+1),CONST(HQH1),CONST(HQD1),0,0),COLORRED;{矩形左竖线}
STICKLINE(ISLASTBAR,CONST(HQH1),CONST(HQD1),0,0),COLORRED;{矩形右竖线}
STICKLINE(CURRBARSCOUNT=IF(DQD1<DQH1,CONST(DQD1)+1,CONST(DQH1)+1),IF(DQD1<DQH1,CONST(HQD1),CONST(HQH1)),CONST(HQD1),0,1),COLORRED;
{矩形中间竖线}{********通用模块画回调矩形******结束*********}
{********通用模块****主图画K线提示***开始******}
STICKLINE(C>O,C,O,2.5,0),COLORRED;{上涨}
STICKLINE(C<O,C,O,2.5,0),COLORGRAY;{下跌}
STICKLINE(C=O,C,O,2.5,0),COLORWHITE;{**变盘点**}
STICKLINE(C>O,H,L,0,0),COLORRED;{上涨}
STICKLINE(C<O,H,L,0,0),COLORGRAY;{下跌}
STICKLINE(C=O,H,L,0,0),COLORWHITE;{变盘}
HTBZ01:=STRCAT('压力位:',CON2STR(CONST(HQH1),2));{标注点位及数值}
HTBZ02:=STRCAT('回调位:',CON2STR(CONST(XHTCS1),2));{标注点位及数值}
HTBZ03:=STRCAT('弱回调:',CON2STR(CONST(XHTCS2),2));{标注点位及数值}
HTBZ04:=STRCAT('强回调:',CON2STR(CONST(XHTCS3),2));{标注点位及数值}
HTBZ05:=STRCAT('支撑位:',CON2STR(CONST(HQD1),2));{标注点位及数值}
DRAWTEXT(CURRBARSCOUNT=IF(DQD1<DQH1,CONST(DQD2)+5,CONST(DQH2)+5),CONST(HQH1),HTBZ01),COLORRED,DRAWABOVE;{画点}
DRAWTEXT(CURRBARSCOUNT=IF(DQD1<DQH1,CONST(DQD2)+5,CONST(DQH2)+5),CONST(XHTCS1),HTBZ02),COLORMAGENTA,DRAWABOVE;{画点}
DRAWTEXT(CURRBARSCOUNT=IF(DQD1<DQH1,CONST(DQD2)+5,CONST(DQH2)+5),CONST(XHTCS2),HTBZ03),COLORWHITE,DRAWABOVE;{画点}
DRAWTEXT(CURRBARSCOUNT=IF(DQD1<DQH1,CONST(DQD2)+5,CONST(DQH2)+5),CONST(XHTCS3),HTBZ04),COLORGREEN,DRAWABOVE;{画点}
DRAWTEXT(CURRBARSCOUNT=IF(DQD1<DQH1,CONST(DQD2)+5,CONST(DQH2)+5),CONST(HQD1),HTBZ05),COLORRED,DRAWABOVE;{画点};
{---通用模块-左侧支撑压力位标注--结束-}{********通用模块-最近4个高低点******开始*********}
DDD1:=STRCAT('买1:',CON2STR(CONST(HQD1),2));{标注最近一低点位置及数值}
DDD2:=STRCAT('买2:',CON2STR(CONST(HQD2),2));{标注最近二低点位置及数值}
HHH1:=STRCAT('卖1:',CON2STR(CONST(HQH1),2));{标注最近一高点位置及数值}
HHH2:=STRCAT('卖2:',CON2STR(CONST(HQH2),2));{标注最近二高点位置及数值}
DRAWTEXT(CURRBARSCOUNT=CONST(DQD1)+1,L*0.99,DDD1),COLORYELLOW;{标注最近一底点位置及数值}{DRAWTEXT(CURRBARSCOUNT=CONST(DQD2)+1,L*0.99,DDD2),COLORYELLOW;}{标注最近二底点位置及数值}
DRAWTEXT(CURRBARSCOUNT=CONST(DQH1)+1,H*1.01,HHH1),COLORGREEN;{标注最近一高点位置及数值}{DRAWTEXT(CURRBARSCOUNT=CONST(DQH2)+1,H*1.01,HHH2),COLORGREEN;}
{标注最近二高点位置及数值}{********通用模块-最近4个高低点******结束*********};{*****创新高-点位测算****分析家公式网HTTP://WWW.70822.COM}
CXGDW01:=CONST(HQD1)*(2*CONST(GH801)*CONST(GH801)-1),NODRAW;{台阶模型预测}
CXGDW011:=CONST(HQD1)*(2*CONST(GH802)*CONST(GH802)-1),NODRAW;{台阶模型预测}
CXGDW012:=CONST(HQD1)*(2*CONST(GH803)*CONST(GH803)-1),NODRAW;{台阶模型预测}
CXGDW03:=IF(CONST(DQD1)>CONST(DQH1),CONST(HQH2),CONST(HQH1))*CONST(HQD1)/CONST(HQD2),NODRAW;{近四边形预测}
CXGDW04:=IF(CONST(DQD1)>CONST(DQH1),CONST(HQH3),CONST(HQH2))*CONST(HQD1)/CONST(HQD2),NODRAW;{远四边形预测};
适用条件:IF(ISLASTBAR AND H>CONST(HQH1),1,0),NODRAW;
台阶预测1:=IF(适用条件>0 AND CXGDW01>CONST(HQH1),CXGDW01,DRAWNULL),NODRAW;
台阶预测2:=IF(适用条件>0 AND CXGDW011>CONST(HQH1),CXGDW011,DRAWNULL),NODRAW;
台阶预测3:=IF(适用条件>0 AND CXGDW012>CONST(HQH1),CXGDW012,DRAWNULL),NODRAW;
四边形预测1:=IF(适用条件>0 AND CXGDW03>CONST(HQH1),CXGDW03,DRAWNULL),NODRAW;
四边形预测2:=IF(适用条件>0 AND CXGDW04>CONST(HQH1),CXGDW04,DRAWNULL),NODRAW;
TTT:=IF(适用条件>0,MAX(CXGDW01,MAX(CXGDW011,MAX(CXGDW012,MAX(CXGDW03,CXGDW04)))),DRAWNULL);
STICKLINE(CURRBARSCOUNT=CONST(DQD1)+1,CONST(HQD1),CONST(TTT),0,1),COLORRED;{画上升竖线}
正常位:DRAWLINE(CURRBARSCOUNT=CONST(DQD1)+1,CONST(台阶预测1),ISLASTBAR,CONST(台阶预测1),0),COLORRED;{预测高点位}
弱势位:DRAWLINE(CURRBARSCOUNT=CONST(DQD1)+1,CONST(台阶预测2),ISLASTBAR,CONST(台阶预测2),0),COLORRED;{预测高点位}
强势位:DRAWLINE(CURRBARSCOUNT=CONST(DQD1)+1,CONST(台阶预测3),ISLASTBAR,CONST(台阶预测3),0),COLORRED;{预测高点位}
小四位:DRAWLINE(CURRBARSCOUNT=CONST(DQD1)+1,CONST(四边形预测1),ISLASTBAR,CONST(四边形预测1),0),COLORRED;{预测高点位}
大四位:DRAWLINE(CURRBARSCOUNT=CONST(DQD1)+1,CONST(四边形预测2),ISLASTBAR,CONST(四边形预测2),0),COLORRED;{预测高点位}
TJYC02:=STRCAT('目标位:',CON2STR(CONST(正常位),2));{标注点位及数值}
TJYC03:=STRCAT('弱势位:',CON2STR(CONST(弱势位),2));{标注点位及数值}
TJYC01:=STRCAT('强势位:',CON2STR(CONST(强势位),2));{标注点位及数值}
HDYC01:=STRCAT('右低翅:',CON2STR(CONST(小四位),2));{标注点位及数值}
HDYC02:=STRCAT('右高翅:',CON2STR(CONST(大四位),2));{标注点位及数值}
DRAWTEXT(CURRBARSCOUNT=CONST(DQD1)+1 AND 正常位>0,正常位*0.99,TJYC02),COLORRED;{画点}
DRAWTEXT(CURRBARSCOUNT=CONST(DQD1)+1 AND 弱势位>0,弱势位*0.99,TJYC03),COLORGREEN;{画点}
DRAWTEXT(CURRBARSCOUNT=CONST(DQD1)+1 AND 强势位>0,强势位*0.99,TJYC01),COLORYELLOW;{画点}
DRAWTEXT(CURRBARSCOUNT=CONST(DQD1)+1 AND 小四位>0,小四位*0.99,HDYC01),COLORMAGENTA;{画点}
DRAWTEXT(CURRBARSCOUNT=CONST(DQD1)+1 AND 大四位>0,大四位*0.99,HDYC02),COLORWHITE;{画点};
上升斜线:DRAWLINE(CURRBARSCOUNT=CONST(DQD1)+1,CONST(HQD1),ISLASTBAR,CONST(TTT),0),COLORWHITE,DOTLINE,LINETHICK1;{上升斜线};
未来函数检测结果如下:
该公式包含未来函数:BACKSET
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
{预测模型主图}
N赋值:3
{逻辑周期参数调整为3} A1赋值:N日前的最高价=2*N+1日内最高价最高值
B1赋值:A1的N过滤
C1赋值:BACKSET(B1,N+1)
D1赋值:C1的N过滤
A2赋值:N日前的最低价=2*N+1日内最低价最低值
B2赋值:A2的N过滤
C2赋值:BACKSET(B2,N+1)
D2赋值:C2的N过滤
E1赋值:(REF(2*N日内最低价最低值,1)+REF(2*N日内最高价最高值,1))/2
E2赋值:(最高价+最低价)/2
H1赋值:(D1 AND NOT(D2 AND E1>=E2)) OR ISLASTBAR OR 收盘价的有效数据周期数=1
L1赋值:(D2 AND NOT(D1 AND E1< E2))
H2赋值:(D1 AND NOT(D2 AND E1>=E2))
X1赋值:REF(上次H1距今天数,1)+1
如果L1返回最低价否则返回10000
G1赋值:F1>1日前的F1
I1赋值:BACKSET(G1,2)
LD赋值:I1>1日前的I1
L2赋值:LD OR ISLASTBAR OR 收盘价的有效数据周期数=1
X2赋值:REF(上次L2距今天数,1)+1
如果H2返回最高价否则返回0
G2赋值:F2>1日前的F2
I2赋值:BACKSET(G2,2)
HD赋值:I2>1日前的I2
J1赋值:BACKSET(ISLASTBAR,MIN(上次HD距今天数,BARSLAST(LD))+1)
J2赋值:J1>1日前的J1
A3赋值:H< REF(H,REF(上次HD距今天数,1)+1)
B3赋值:REF(H,REF(上次HD距今天数,1)+1)>REF(H,REF(上次HD距今天数,1)+2+REF(上次HD距今天数,REF(上次HD距今天数,1)+2))
D3赋值:A3 AND B3 AND HD
E3赋值:BACKSET(D3,REF(上次HD距今天数,1)+2)
HH赋值:E3>1日前的E3
A4赋值:L>REF(L,REF(上次LD距今天数,1)+1)
B4赋值:REF(L,REF(上次LD距今天数,1)+1)< REF(L,REF(上次LD距今天数,1)+2+REF(上次LD距今天数,REF(上次LD距今天数,1)+2))
D4赋值:A4 AND B4 AND LD
E4赋值:BACKSET(D4,REF(上次LD距今天数,1)+2)
LL赋值:E4>1日前的E4
H3赋值:HH OR ISLASTBAR OR C的有效数据周期数=1
X3赋值:REF(上次H3距今天数,1)+1
F3赋值:BACKSET(H3 AND 统计X3日满足LL的天数>0,LLVBARS(IF(LL,L,POW(10,20)),X3))
G3赋值:F3>1日前的F3
I3赋值:BACKSET(G3,2)
LZ赋值:I3>1日前的I3
L4赋值:LZ OR ISLASTBAR OR C的有效数据周期数=1
X4赋值:REF(上次L4距今天数,1)+1
F4赋值:BACKSET(L4 AND 统计X4日满足HH的天数>0,HHVBARS(IF(HH,H,-POW(10,20)),X4))
G4赋值:F4>1日前的F4
I4赋值:BACKSET(G4,2)
HZ赋值:I4>1日前的I4
K1赋值:BACKSET(ISLASTBAR,MIN(上次HZ距今天数,BARSLAST(LZ))+1)
K2赋值:K1>1日前的K1
UU赋值:BACKSET(ISLASTBAR,上次LD距今天数+1)
VV赋值:UU>1日前的UU
WW赋值:BACKSET(VV,REF(上次LD距今天数,1)+2)
XX赋值:WW>1日前的WW
UU2:=BACKSET(ISLASTBAR,上次HD距今天数+1)
VV2:=UU2>1日前的UU2
WW2:=BACKSET(VV2,REF(上次HD距今天数,1)+2)
493154432115763143X2赋值:WW2>1日前的WW2
YY赋值:BACKSET(XX,REF(上次LD距今天数,1)+2)
ZZ赋值:YY>1日前的YY
{前三低天数}
YY2:=BACKSET(493154432115763143X2,REF(上次HD距今天数,1)+2)
ZZ2:=YY2>1日前的YY2
{前三高天数}
前一低赋值:REF(L,上次VV距今天数)
前二低赋值:REF(L,上次XX距今天数)
前一高赋值:REF(H,上次VV2距今天数)
前二高赋值:REF(H,上次493154432115763143X2距今天数)
前三低赋值:REF(L,上次ZZ距今天数)
前三高赋值:REF(H,上次ZZ2距今天数)
DQ输出D1:CONST(上次VV距今天数),NODRAW
DQD2赋值:CONST(上次XX距今天数)
DQ输出H1:CONST(上次VV2距今天数),NODRAW
DQH2赋值:CONST(上次493154432115763143X2距今天数)
DQH3赋值:CONST(上次ZZ2距今天数)
DQD3赋值:CONST(上次ZZ2距今天数)
HQD1赋值:REF(L,上次VV距今天数)
HQD2赋值:REF(L,上次XX距今天数)
HQH1赋值:REF(H,上次VV2距今天数)
HQH2赋值:REF(H,上次493154432115763143X2距今天数)
HQH3赋值:REF(H,上次ZZ2距今天数)
HQD3赋值:REF(L,上次ZZ距今天数)
输出{-----通用模块-缠论笔画连线---}
XAA1:DRAWLINE( 到最后交易的周期=(IF(DQH1>DQD1,CONST(上次493154432115763143X2距今天数+1),CONST(BARSLAST(XX))+1)),(IF(DQH1>DQD1,前二高,前二低)), 到最后交易的周期=IF(DQH1>DQD1,CONST(BARSLAST(XX))+1,CONST(上次493154432115763143X2距今天数)+1),(IF(DQH1>DQD1,前二低,前二高)),0),画红色,LINETHICK1
{前一高一低连线}
XA输出A2:DRAWLINE( 到最后交易的周期=(IF(DQH1>DQD1,CONST(上次XX距今天数+1),CONST(BARSLAST(493154432115763143X2))+1)),(IF(DQH1>DQD1,前二低,前二高)), 到最后交易的周期=IF(DQH1>DQD1,CONST(BARSLAST(VV2))+1,CONST(BARSLAST(VV))+1),(IF(DQH1>DQD1,前一高,前一低)),0),画红色,LINETHICK1
{前一高一低连线}
XA输出A3:DRAWLINE( 到最后交易的周期=(IF(DQH1>DQD1,CONST(上次VV2距今天数+1),CONST(BARSLAST(VV))+1)),(IF(DQH1>DQD1,前一高,前一低)), 到最后交易的周期=IF(DQH1>DQD1,CONST(BARSLAST(VV))+1,CONST(上次VV2距今天数)+1),(IF(DQH1>DQD1,前一低,前一高)),1),DOTLINE,画红色
{前一高一低连线}
XA输出A4:DRAWLINE( 到最后交易的周期=(IF(DQH1>DQD1,CONST(上次VV2距今天数+1),CONST(BARSLAST(VV))+1)),(IF(DQH1>DQD1,前一高,前一低)), 到最后交易的周期=IF(DQH1>DQD1,CONST(BARSLAST(VV))+1,CONST(上次VV2距今天数)+1),(IF(DQH1>DQD1,前一低,前一高)),0),画红色, 线宽为3
{前一高一低连线}{********最后一笔逻辑判断提示****开始*****}
DRAWTEXT_FIX(ISLASTBAR AND DQH1>DQD1,0.02,0.01,0,STRCAT('【最后一笔主形态】','【**下跌**】')),画洋红色
DRAWTEXT_FIX(ISLASTBAR AND DQH1{********最后一笔逻辑判断提示****结束*****}{HTTPS://T.1YB.CO/L3RI}{********最后形态识别提示***开始******}{---下跌反弹测卖箱体模型形态识别-操盘策略-预测模型---}
DRAWTEXT_FIX(ISLASTBAR AND DQH1>DQD1 AND BETWEEN(C,CONST(HQH1),CONST(HQD1)),0.02,0.08,0,STRCAT('【形态识别】:【收盘价未突破箱体】',' ')),画绿色
DRAWTEXT_FIX(ISLASTBAR AND DQH1>DQD1 AND BETWEEN(C,CONST(HQH1),CONST(HQD1)),0.02,0.15,0,STRCAT('【操盘策略】:【短线看跌】',' ')),COLORYELLOW
DRAWTEXT_FIX(ISLASTBAR AND DQH1>DQD1 AND BETWEEN(C,CONST(HQH1),CONST(HQD1)),0.02,0.22,0,STRCAT('【适用模型】:','【下跌反弹测卖点】')),画红色
{---下跌反转突破测卖箱体模型形态识别-操盘策略-预测模型---}
DRAWTEXT_FIX(ISLASTBAR AND DQH1>DQD1 AND C>CONST(HQH1),0.02,0.08,0,STRCAT('【形态识别】:【收盘价破前高点】',' ')),画绿色
DRAWTEXT_FIX(ISLASTBAR AND DQH1>DQD1 AND C>CONST(HQH1),0.02,0.15,0,STRCAT('【操盘策略】:【短线看涨】',' ')),COLORYELLOW
DRAWTEXT_FIX(ISLASTBAR AND DQH1>DQD1 AND C>CONST(HQH1),0.02,0.22,0,STRCAT('【预测模型】:','【下跌转涨测卖点】')),画红色
{---下跌跌破箱底测买箱体模型形态识别-操盘策略-预测模型---}
DRAWTEXT_FIX(ISLASTBAR AND DQH1>DQD1 AND C
DRAWTEXT_FIX(ISLASTBAR AND DQH1>DQD1 AND C
DRAWTEXT_FIX(ISLASTBAR AND DQH1>DQD1 AND C{---上升回调测买箱体模型形态识别-操盘策略-预测模型---}
DRAWTEXT_FIX(ISLASTBAR AND DQH1
DRAWTEXT_FIX(ISLASTBAR AND DQH1
DRAWTEXT_FIX(ISLASTBAR AND DQH1{---上升突破测卖箱体模型形态识别-操盘策略-预测模型---}
DRAWTEXT_FIX(ISLASTBAR AND DQH1CONST(HQH1),0.02,0.08,0,STRCAT('【形态识别】:【收盘价突破前高点】',' ')),画绿色
DRAWTEXT_FIX(ISLASTBAR AND DQH1CONST(HQH1),0.02,0.15,0,STRCAT('【操盘策略】:【短线看涨】',' ')),COLORYELLOW
DRAWTEXT_FIX(ISLASTBAR AND DQH1CONST(HQH1),0.02,0.22,0,STRCAT('【预测模型】:','【突破上涨测卖点】')),画红色
{---上升反转下跌测买箱体模型形态识别-操盘策略-预测模型---}
DRAWTEXT_FIX(ISLASTBAR AND DQH1
DRAWTEXT_FIX(ISLASTBAR AND DQH1
DRAWTEXT_FIX(ISLASTBAR AND DQH1
{********最后形态识别提示***结束******}{********通用模块-画出回或反弹的矩形图******开始*********}
GDH8赋值:CONST(HQH1),NODRAW
{最近一笔的高点}
DDL8赋值:CONST(HQD1),NODRAW
{最近一笔的低点}
MIMA8赋值:GDH8/DDL8
GH801赋值:SQRT(MIMA8)
GH802赋值:SQRT(GH801)
GH803赋值:(GH801+GH802-1)
{---画出预测上升或回调的点位---}
XHTCS1赋值:IF(DQD1>DQH1,CONST(GDH8/GH801),CONST(DDL8*GH801))
{上升回调或下跌反弹计算反弹1号位置}
XHTCS2赋值:IF(DQD1>DQH1,CONST(GDH8/GH802),CONST(DDL8*GH802))
{上升回调或下跌反弹计算反弹2号位置}
XHTCS3赋值:IF(DQD1>DQH1,CONST(GDH8/GH803),CONST(DDL8*GH803))
输出{上升回调或下跌反弹计算反弹3号位置}{--通用模块--画出压力线和支撑线--}
SZHTW0:DRAWLINE( 到最后交易的周期=IF(DQD1输出{画压力线}
SZHTW4:DRAWLINE( 到最后交易的周期=IF(DQD1输出{画支撑线}{--通用模块-画出回调或反弹的水平线--}
SZHTW1:DRAWLINE( 到最后交易的周期=IF(DQD1输出{画回调或反弹水平线}
SZHTW2:DRAWLINE( 到最后交易的周期=IF(DQD1输出{画回调或反弹水平线}
SZHTW3:DRAWLINE( 到最后交易的周期=IF(DQD1{画回调或反弹水平线}
{---通用模块-标注矩形左-中-右三个竖线---}
STICKLINE( 到最后交易的周期=IF(DQD1{矩形左竖线}
STICKLINE(ISLASTBAR,CONST(HQH1),CONST(HQD1),0,0),画红色
{矩形右竖线}
STICKLINE( 到最后交易的周期=IF(DQD1当满足条件C>O时,在C和O之间画柱状线
当满足条件C当满足条件C=O时,在C和O之间画柱状线
当满足条件C>O时,在H和L之间画柱状线
当满足条件C当满足条件C=O时,在H和L之间画柱状线
{变盘}
HTBZ01:=STRCAT('压力位:',CON2STR(CONST(HQH1),2))
{标注点位及数值}
HTBZ02:=STRCAT('回调位:',CON2STR(CONST(XHTCS1),2))
{标注点位及数值}
HTBZ03:=STRCAT('弱回调:',CON2STR(CONST(XHTCS2),2))
{标注点位及数值}
HTBZ04:=STRCAT('强回调:',CON2STR(CONST(XHTCS3),2))
{标注点位及数值}
HTBZ05:=STRCAT('支撑位:',CON2STR(CONST(HQD1),2))
{标注点位及数值}
DRAWTEXT( 到最后交易的周期=IF(DQD1{画点}
DRAWTEXT( 到最后交易的周期=IF(DQD1{画点}
DRAWTEXT( 到最后交易的周期=IF(DQD1{画点}
DRAWTEXT( 到最后交易的周期=IF(DQD1{画点}
DRAWTEXT( 到最后交易的周期=IF(DQD1{画点}
{---通用模块-左侧支撑压力位标注--结束-}{********通用模块-最近4个高低点******开始*********}
DDD1赋值:STRCAT('买1:',CON2STR(CONST(HQD1),2))
{标注最近一低点位置及数值}
DDD2赋值:STRCAT('买2:',CON2STR(CONST(HQD2),2))
{标注最近二低点位置及数值}
HHH1赋值:STRCAT('卖1:',CON2STR(CONST(HQH1),2))
{标注最近一高点位置及数值}
HHH2赋值:STRCAT('卖2:',CON2STR(CONST(HQH2),2))
{标注最近二高点位置及数值}
DRAWTEXT( 到最后交易的周期=CONST(DQD1)+1,L*0.99,DDD1),COLORYELLOW
{标注最近一底点位置及数值}{DRAWTEXT( 到最后交易的周期=CONST(DQD2)+1,L*0.99,DDD2),COLORYELLOW
}{标注最近二底点位置及数值}
DRAWTEXT( 到最后交易的周期=CONST(DQH1)+1,H*1.01,HHH1),画绿色
{标注最近一高点位置及数值}{DRAWTEXT( 到最后交易的周期=CONST(DQH2)+1,H*1.01,HHH2),画绿色
}
{标注最近二高点位置及数值}{********通用模块-最近4个高低点******结束*********}
{*****创新高-点位测算****分析家公式网HTTP://WWW.70822.COM}
CXGDW01:=CONST(HQD1)*(2*CONST(GH801)*CONST(GH801)-1),NODRAW
{台阶模型预测}
CXGDW011赋值:CONST(HQD1)*(2*CONST(GH802)*CONST(GH802)-1),NODRAW
{台阶模型预测}
CXGDW012赋值:CONST(HQD1)*(2*CONST(GH803)*CONST(GH803)-1),NODRAW
{台阶模型预测}
CXGDW03赋值:IF(CONST(DQD1)>CONST(DQH1),CONST(HQH2),CONST(HQH1))*CONST(HQD1)/CONST(HQD2),NODRAW
{近四边形预测}
CXGDW04赋值:IF(CONST(DQD1)>CONST(DQH1),CONST(HQH3),CONST(HQH2))*CONST(HQD1)/CONST(HQD2),NODRAW
{远四边形预测}
输出适用条件:IF(ISLASTBAR AND H>CONST(HQH1),1,0),NODRAW
台阶预测1赋值:IF(适用条件>0 AND CXGDW01>CONST(HQH1),CXGDW01,DRAWNULL),NODRAW
台阶预测2赋值:IF(适用条件>0 AND CXGDW011>CONST(HQH1),CXGDW011,DRAWNULL),NODRAW
台阶预测3赋值:IF(适用条件>0 AND CXGDW012>CONST(HQH1),CXGDW012,DRAWNULL),NODRAW
四边形预测1赋值:IF(适用条件>0 AND CXGDW03>CONST(HQH1),CXGDW03,DRAWNULL),NODRAW
四边形预测2赋值:IF(适用条件>0 AND CXGDW04>CONST(HQH1),CXGDW04,DRAWNULL),NODRAW
TTT赋值:IF(适用条件>0,MAX(CXGDW01,MAX(CXGDW011,MAX(CXGDW012,MAX(CXGDW03,CXGDW04)))),DRAWNULL)
STICKLINE( 到最后交易的周期=CONST(DQD1)+1,CONST(HQD1),CONST(TTT),0,1),画红色
输出{画上升竖线}
正常位:DRAWLINE( 到最后交易的周期=CONST(DQD1)+1,CONST(台阶预测1),ISLASTBAR,CONST(台阶预测1),0),画红色
输出{预测高点位}
弱势位:DRAWLINE( 到最后交易的周期=CONST(DQD1)+1,CONST(台阶预测2),ISLASTBAR,CONST(台阶预测2),0),画红色
输出{预测高点位}
强势位:DRAWLINE( 到最后交易的周期=CONST(DQD1)+1,CONST(台阶预测3),ISLASTBAR,CONST(台阶预测3),0),画红色
输出{预测高点位}
小四位:DRAWLINE( 到最后交易的周期=CONST(DQD1)+1,CONST(四边形预测1),ISLASTBAR,CONST(四边形预测1),0),画红色
输出{预测高点位}
大四位:DRAWLINE( 到最后交易的周期=CONST(DQD1)+1,CONST(四边形预测2),ISLASTBAR,CONST(四边形预测2),0),画红色
{预测高点位}
TJYC02:=STRCAT('目标位:',CON2STR(CONST(正常位),2))
{标注点位及数值}
TJYC03:=STRCAT('弱势位:',CON2STR(CONST(弱势位),2))
{标注点位及数值}
TJYC01:=STRCAT('强势位:',CON2STR(CONST(强势位),2))
{标注点位及数值}
HDYC01:=STRCAT('右低翅:',CON2STR(CONST(小四位),2))
{标注点位及数值}
HDYC02:=STRCAT('右高翅:',CON2STR(CONST(大四位),2))
{标注点位及数值}
DRAWTEXT( 到最后交易的周期=CONST(DQD1)+1 AND 正常位>0,正常位*0.99,TJYC02),画红色
{画点}
DRAWTEXT( 到最后交易的周期=CONST(DQD1)+1 AND 弱势位>0,弱势位*0.99,TJYC03),画绿色
{画点}
DRAWTEXT( 到最后交易的周期=CONST(DQD1)+1 AND 强势位>0,强势位*0.99,TJYC01),COLORYELLOW
{画点}
DRAWTEXT( 到最后交易的周期=CONST(DQD1)+1 AND 小四位>0,小四位*0.99,HDYC01),画洋红色
{画点}
DRAWTEXT( 到最后交易的周期=CONST(DQD1)+1 AND 大四位>0,大四位*0.99,HDYC02),画白色
{画点}
输出上升斜线:DRAWLINE( 到最后交易的周期=CONST(DQD1)+1,CONST(HQD1),ISLASTBAR,CONST(TTT),0),画白色,DOTLINE,LINETHICK1
{上升斜线}