通达信双线战法主图指标公式
TT:=IF(ISLASTBAR,240/FROMOPEN,1);
NN:=120;
HH:=HHV(V*TT,NN);
LL:=LLV(V,NN);
最高:=CONST(HH);
最低:=CONST(LL);
最高2:=CONST(HHV(H,NN));
最低2:=CONST(LLV(L,NN));
PP:=IF((最高2*0.9-(最高2-最低2)*0.5)>CONST(LLV(L,20)),0.9,IF((最高2*0.9-(最高2-最低2)*0.5)>CONST(LLV(L,50)),0.7,0.6)),NODRAW;
RCC1:=最高2*0.9-(最高2-最低2)*PP;
最低3:=MIN(RCC1,最低2);
AB:=最低3;
MA5:=EMA(C,5),NODRAW;
MAR5:=SMA(C,5,1),COLORYELLOW,LINETHICK2;
MA20:MA(C,20),COLORRED,LINETHICK2;
MA55:MA(C,55),COLORFF00FF,LINETHICK2;
DRAWBAND(MAR5,RGB(0,200,200),MA5,RGB(200,0,0));
IF(MA20
IF(MA55
IF(MA20>=REF(MA20,1),AB-0.000*AB,DRAWNULL),COLORRED,LINETHICK8;
IF(MA55>=REF(MA55,1),AB-0.020*AB,DRAWNULL),COLORFF00FF,LINETHICK8;
DRAWICON( CROSS(C,MA20),MA20,5);
DRAWTEXT( CROSS(C,MA20),MA20*0.995,'买入');
DRAWICON( CROSS(MA20,MA55),MA20,23);
DRAWTEXT( CROSS(MA20,MA55),MA20*0.995,'加仓');
AA:=REF(C,1);
大阳线:=IF((C-AA)*100/AA>=5,1,0);
涨停:=IF((C-AA)*100/AA>=(10-0.05*100/AA),1,0);
STICKLINE(大阳线,O,C,-1,0),COLORMAGENTA;
STICKLINE(大阳线,H,L,0,0),COLORMAGENTA;
STICKLINE(涨停,O,C,-1,0),COLOR00AEFF;
STICKLINE(涨停,H,L,0,0),COLOR00AEFF;
A5:=EMA(C,14)COLORRED;
A5X:=(A5-REF(A5,1))/REF(A5,1)*100,NODRAW;
做多:IF(A5X>=0,REF(EMA(C,14),BARSLAST(CROSS(A5X,0))+1),DRAWNULL),COLOR0000FF,DOTLINE;
DRAWTEXT(ISLASTBAR,做多*1.001,' 买多'),COLORRED,LINETHICK1;
P:=7;
豆:=REF(HIGH,P)=HHV(HIGH,2*P+1);
豆豆:=FILTER(豆,P);
豆豆1981:=BACKSET(豆豆,P+1);
豆1981:=FILTER(豆豆1981,P);{高点}
R11:=BACKSET(ISLASTBAR,BARSLAST(豆1981)+1);
S11:=R11>REF(R11,1);
压力轨:DRAWLINE(豆1981,HIGH,S11,HIGH,1),COLORYELLOW;
AA2:=REF(LOW,P)=LLV(LOW,2*P+1);
BB2:=FILTER(AA2,P);
CC2:=BACKSET(BB2,P+1);
DD2:=FILTER(CC2,P);{低点}
T11:=BACKSET(ISLASTBAR,BARSLAST(DD2)+1);
U11:=T11>REF(T11,1);
TY:=L;
A1:=REF(TY,10)=HHV(TY,2*10+1); B5:=FILTER(A1,10);C5:=BACKSET(B5,10+1); HD:=FILTER(C5,10);
A2:=REF(TY,10)=LLV(TY,2*10+1); B6:=FILTER(A2,10);C6:=BACKSET(B6,10+1); LD:=FILTER(C6,10);
{股旁网www.gupang.com}
前期低位:REF(L,BARSLAST(LD)),COLOR00FF00,POINTDOT;
STICKLINE(L,前期低位,前期低位,8,0),COLORRED;
TZ:=H;
A3:=REF(TY,10)=HHV(TY,2*10+1); B7:=FILTER(A1,10);C7:=BACKSET(B5,10+1); MD:=FILTER(C5,10);
A4:=REF(TY,10)=LLV(TY,2*10+1); B8:=FILTER(A2,10);C8:=BACKSET(B6,10+1); ND:=FILTER(C6,10);
前期高位:REF(H,BARSLAST(MD)),COLOR00FF00,POINTDOT;
STICKLINE(H,前期高位,前期高位,8,0),COLORYELLOW;
QA1:=REF(CLOSE,3)=HHV(CLOSE,2*3+1);
QB1:=BACKSET(QA1,3+1);
QC1:=FILTER(QB1,3) AND CLOSE=HHV(CLOSE,3+1);
QD1:=BARSLAST(QC1);
QE1:=IF(QC1,CURRBARSCOUNT,0);
QF1:=IF(QD1,REF(QE1,QD1),QE1);
QG1:=CONST(QF1);
次水平线:DRAWLINE(CURRBARSCOUNT=QG1,CLOSE,ISLASTBAR,REF
(CLOSE,QG1-1),1),COLORYELLOW;
T1B:=CONST(LLVBARS(LOW,10));
T1HIGH:=CONST(REF(HIGH,T1B));
CC1:=CONST(CURRBARSCOUNT);
T2B:=CONST(BARSLAST(CURRBARSCOUNT>CC1+T1B ANDH>T1HIGH));
T2HIGH:=CONST(REF(HIGH,T2B));
T3:=CONST(BARSLAST(CURRBARSCOUNT>CC1+T2B ANDHIGH>T2HIGH));
T3HIGH:=CONST(REF(HIGH,T3));
Z1:=STRCAT(HYBLOCK,' ');
Z2:=STRCAT(Z1,DYBLOCK);
Z3:=STRCAT(Z2,' ');
DRAWTEXT_FIX(ISLASTBAR,0,0,0,STRCAT(Z3,GNBLOCK)),COLOR00FFFF;
必杀线:DRAWLINE(CURRBARSCOUNT=T3+1, T3HIGH, ISLASTBAR, T3HIGH,1),COLORRED,LINETHICK1;