文华财经boll带多空支撑压力K变色主图指标公式源码:
LHS:=1;
HHHQ1:=IFELSE(H REF(H,1) REF(H,1) REF(H,2),REF(H,2),0);
LLLQ1:=IFELSE(L REF(L,1) REF(L,1) REF(L,2),REF(L,2),0);
HH:=VALUEWHEN(HHHQ1 0,HHHQ1);
LL2:=VALUEWHEN(LLLQ1 0,LLLQ1)
HH8:=HHV(HIGH,1)/10+HHV(HIGH,1)/10+HHV(HIGH,2)/10+HHV(HIGH,2)/10+HHV(HIGH,4)/10+HHV(HIGH,4)/10+HHV(HIGH,8)/10+HHV(HIGH,16)/10+HHV(HIGH,60)/10+HHV(HIGH,80)/10;
LL8:=LLV(LOW,1)/10+LLV(LOW,1)/10+LLV(LOW,2)/10+LLV(LOW,2)/10+LLV(LOW,4)/10+LLV(LOW,4)/10+LLV(LOW,8)/10+LLV(LOW,8)/10+LLV(LOW,60)/10+LLV(LOW,80)/10;
HHQ1:=IFELSE(HH8 REF(HH8,1) LL8 REF(LL8,1) REF(OPEN,1) CLOSE OPEN CLOSE (HHV(OPEN,0)-CLOSE) 0,REF(HH8,2),0);
LQ1:=IFELSE(LL8 REF(LL8,1) HH8 REF(HH8,1) REF(OPEN,1) CLOSE OPEN CLOSE (CLOSE-LLV(OPEN,0)) 0,REF(LL8,2),0);
X:=DATE;
X0:=HHQ1,LINETHICK2;
X00:=LQ1;
XXX0:=O,LINETHICK2;
XXX00:=C;
XXX000:=H;
XXX0000:=L;
H2:=VALUEWHEN(X0 0,X0)*LHS,LINETHICK2;
QL2:=VALUEWHEN(X00 0,X00)*LHS,LINETHICK2;
K1:=IFELSE(CLOSE H2,-3,IFELSE(CLOSE QL2,1,0));
K2:=VALUEWHEN(K1 0,K1);
MID:MA(CLOSE,26),LINETHICK3,COLORWHITE;
TMP2:=STD(CLOSE,26);
TOP:MID+2*TMP2,LINETHICK3,COLORWHITE;
BOTTOM:MID-2*TMP2,LINETHICK3,COLORWHITE;
DRAWCOLORLINE(K2 0,MID,COLORGREEN,COLORRED),LINETHICK3;
DRAWCOLORLINE(K2 0,TOP,COLORGREEN,COLORRED),LINETHICK3;
DRAWCOLORLINE(K2 0,BOTTOM,COLORGREEN,COLORRED),LINETHICK3;
HHX:=HHV(C,30);
LLX:=LLV(C,30);
HH1:=BARSLAST((HHX REF(HHX,1)));
LL1:=BARSLAST((LLX REF(LLX,1)));
T:=IFELSE(HH1 LL1,1,-1);
GX:=IFELSE(HH1 LL1,HHX,LLX);
VARAA:=LLV(LOW,35);
VARBB:=HHV(HIGH,30);
VARCC:=EMA((CLOSE-VARAA)/(VARBB-VARAA)*4,4)*25;
QS:= VARCC,COLORWHITE;
VARD:=87.5;
VARE:=(VARCC-LLV(VARCC,4))/(HHV(VARCC,4)-LLV(VARCC,4))*4*25;
MA60:=MA(C,60),COLORRED;
DRAWCOLORKLINE(HH1 LL1 ISDOWN=0,COLORGREEN,1);
DRAWCOLORKLINE(HH1 LL1 ISDOWN=1,COLORGREEN,0);
DRAWCOLORKLINE(HH1 LL1 ISDOWN=0,COLORRED,1);
DRAWCOLORKLINE(HH1 LL1 ISDOWN=1,COLORRED,0);
RN:=13;
RM:=3.5;
RTR1:=MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));
ATR基准:=(H+L)/2,NODRAW;
波幅:=H-L;
ATR:=MA(RTR1,RN),COLORYELLOW;
RUP:=ATR基准+ATR*RM;
RDN:=ATR基准-ATR*RM;
RL1:=REF(RUP,BARSLAST(RUP =REF(RUP,1)));
RL2:=LLV(RUP,RN*1.5);
RLL:=IF(RL2=REF(RL2,1) AND RL1 REF(RL1,1),RL1,IF(RL1=RL2,RL1,RL2));
RS1:=BARSLAST(CROSS(0.5,RUP=RLL))+1;
RS2:=CROSS(COUNT((CROSS(C,RLL) OR CROSS(C,REF(RLL,2))) AND RUP RLL,RS1),0.5);
RA6:=BARSLAST(RS2);
RB6:=BARSLAST(CROSS(HHV(RDN,RA6+1),C));
RBY:=CROSS(RB6,RA6);
RSL:=CROSS(RA6,RB6);
止损线:IF(RB6 RA6,HHV(RDN,BARSLAST(RBY)+1),LLV(RUP,BARSLAST(RSL)+1)),COLOR00FF00,LINETHICK2;
IF(RB6 RA6,止损线,NULL),COLORBLUE,LINETHICK3;
H11:=HIGH;
L11:=LOW;
A:=IFELSE(HIGH =REF(HIGH,1) HIGH =REF(HIGH,2) HIGH =REF(HIGH,3) HIGH =REF(HIGH,4) HIGH =REF(HIGH,5),LOW,0);
B:=IFELSE(LOW =REF(LOW,1) LOW =REF(LOW,2) LOW =REF(LOW,3) LOW =REF(LOW,4) LOW =REF(LOW,5),HIGH,888888);
P1:=IFELSE(A REF(L11,1),REF(L11,1),0);
P2:=IFELSE(A REF(L11,2) A =REF(L11,1),REF(L,2),0);
P3:=IFELSE(A REF(L11,3) A =REF(L11,1) A =REF(L11,2),REF(L11,3),0);
P4:=IFELSE(A REF(L11,4) A =REF(L11,1) A =REF(L11,2) A =REF(L11,3),REF(L11,4),0);
P5:=IFELSE(A REF(L11,5) A =REF(L11,1) A =REF(L11,2) A =REF(L11,3) A =REF(L11,4),REF(L11,5),0);
P6:=IFELSE(A REF(L11,6) A =REF(L11,1) A =REF(L11,2) A =REF(L11,3) A =REF(L11,4) A =REF(L11,5),REF(L11,6),0);
P7:=IFELSE(A REF(L11,7) A =REF(L11,1) A =REF(L11,2) A =REF(L11,3) A =REF(L11,4) A =REF(L11,5) A =REF(L11,6),REF(L11,7),0);
P8:=IFELSE(A REF(L11,8) A =REF(L11,1) A =REF(L11,2) A =REF(L11,3) A =REF(L11,4) A =REF(L11,5) A =REF(L11,6) A =REF(L11,7),REF(L11,8),0);
P9:=IFELSE(A REF(L11,9) A =REF(L11,1) A =REF(L11,2) A =REF(L11,3) A =REF(L11,4) A =REF(L11,5) A =REF(L11,6) A =REF(L11,7) A =REF(L11,8),REF(L11,9),0);
P10:=IFELSE(A REF(L11,10) A =REF(L11,1) A =REF(L11,2) A =REF(L11,3) A =REF(L11,4) A =REF(L11,5) A =REF(L11,6) A =REF(L11,7) A =REF(L11,8) A =REF(L11,9),REF(L11,10),0);
AA:=P1+P2+P3+P4+P5+P6+P7+P8+P9+P10;
PP1:=IFELSE(AA REF(L11,1),REF(L11,1),0);
PP2:=IFELSE(AA REF(L11,2) AA =REF(L11,1),REF(L11,2),0);
PP3:=IFELSE(AA REF(L11,3) AA =REF(L11,1) AA =REF(L11,2),REF(L11,3),0);
PP4:=IFELSE(AA REF(L11,4) AA =REF(L11,1) AA =REF(L11,2) AA =REF(L11,3),REF(L11,4),0);
PP5:=IFELSE(AA REF(L11,5) AA =REF(L11,1) AA =REF(L11,2) AA =REF(L11,3) AA =REF(L11,4),REF(L11,5),0);
PP6:=IFELSE(AA REF(L11,6) AA =REF(L11,1) AA =REF(L11,2) AA =REF(L11,3) AA =REF(L11,4) AA =REF(L11,5),REF(L11,6),0);
PP7:=IFELSE(AA REF(L11,7) AA =REF(L11,1) AA =REF(L11,2) AA =REF(L11,3) AA =REF(L11,4) AA =REF(L11,5) AA =REF(L11,6),REF(L11,7),0);
PP8:=IFELSE(AA REF(L11,8) AA =REF(L11,1) AA =REF(L11,2) AA =REF(L11,3) AA =REF(L11,4) AA =REF(L11,5) AA =REF(L11,6) AA =REF(L11,7),REF(L11,8),0);
PP9:=IFELSE(AA REF(L11,9) AA =REF(L11,1) AA =REF(L11,2) AA =REF(L11,3) AA =REF(L11,4) AA =REF(L11,5) AA =REF(L11,6) AA =REF(L11,7) AA =REF(L11,8),REF(L11,9),0);
PP10:=IFELSE(AA REF(L11,10) AA =REF(L11,1) AA =REF(L11,2) AA =REF(L11,3) AA =REF(L11,4) AA =REF(L11,5) AA =REF(L11,6) AA =REF(L11,7) AA =REF(L11,8) AA =REF(L11,9),REF(L11,10),0);
AAA:=PP1+PP2+PP3+PP4+PP5+PP6+PP7+PP8+PP9+PP10;
C11:=VALUEWHEN(AAA 0,AAA);
T1:=IFELSE(B REF(H11,1),REF(H11,1),0);
T2:=IFELSE(B REF(H11,2) B =REF(H11,1),REF(H11,2),0);
T3:=IFELSE(B REF(H11,3) B =REF(H11,1) B =REF(H11,2),REF(H11,3),0);
T4:=IFELSE(B REF(H11,4) B =REF(H11,1) B =REF(H11,2) B =REF(H11,3),REF(H11,4),0);
T5:=IFELSE(B REF(H11,5) B =REF(H11,1) B =REF(H11,2) B =REF(H11,3) B =REF(H11,4),REF(H11,5),0);
T6:=IFELSE(B REF(H11,6) B =REF(H11,1) B =REF(H11,2) B =REF(H11,3) B =REF(H11,4) B =REF(H11,5),REF(H11,6),0);
T7:=IFELSE(B REF(H11,7) B =REF(H11,1) B =REF(H11,2) B =REF(H11,3) B =REF(H11,4) B =REF(H11,5) B =REF(H11,6),REF(H11,7),0);
T8:=IFELSE(B REF(H11,8) B =REF(H11,1) B =REF(H11,2) B =REF(H11,3) B =REF(H11,4) B =REF(H11,5) B =REF(H11,6) B =REF(H11,7),REF(H11,8),0);
T9:=IFELSE(B REF(H11,9) B =REF(H11,1) B =REF(H11,2) B =REF(H11,3) B =REF(H11,4) B =REF(H11,5) B =REF(H11,6) B =REF(H11,7) B =REF(H11,8),REF(H11,9),0);
T10:=IFELSE(B REF(H11,10) B =REF(H11,1) B =REF(H11,2) B =REF(H11,3) B =REF(H11,4) B =REF(H11,5) B =REF(H11,6) B =REF(H11,7) B =REF(H11,8) B =REF(H11,9),REF(H11,10),0);
BB:=IFELSE((T1+T2+T3+T4+T5+T6+T7+T8+T9+T10)=0,888888,T1+T2+T3+T4+T5+T6+T7+T8+T9+T10);
TT1:=IFELSE(BB REF(H11,1),REF(H11,1),0);
TT2:=IFELSE(BB REF(H11,2) BB =REF(H11,1),REF(H11,2),0);
TT3:=IFELSE(BB REF(H11,3) BB =REF(H11,1) BB =REF(H11,2),REF(H11,3),0);
TT4:=IFELSE(BB REF(H11,4) BB =REF(H11,1) BB =REF(H11,2) BB =REF(H11,3),REF(H11,4),0);
TT5:=IFELSE(BB REF(H11,5) BB =REF(H11,1) BB =REF(H11,2) BB =REF(H11,3) BB =REF(H11,4),REF(H11,5),0);
TT6:=IFELSE(BB REF(H11,6) BB =REF(H11,1) BB =REF(H11,2) BB =REF(H11,3) BB =REF(H11,4) BB =REF(H11,5),REF(H11,6),0);
TT7:=IFELSE(BB REF(H11,7) BB =REF(H11,1) BB =REF(H11,2) BB =REF(H11,3) BB =REF(H11,4) BB =REF(H11,5) BB =REF(H11,6),REF(H11,7),0);
TT8:=IFELSE(BB REF(H11,8) BB =REF(H11,1) BB =REF(H11,2) BB =REF(H11,3) BB =REF(H11,4) BB =REF(H11,5) BB =REF(H11,6) BB =REF(H11,7),REF(H11,8),0);
TT9:=IFELSE(BB REF(H11,9) BB =REF(H11,1) BB =REF(H11,2) BB =REF(H11,3) BB =REF(H11,4) BB =REF(H11,5) BB =REF(H11,6) BB =REF(H11,7) BB =REF(H11,8),REF(H11,9),0);
TT10:=IFELSE(BB REF(H11,10) BB =REF(H11,1) BB =REF(H11,2) BB =REF(H11,3) BB =REF(H11,4) BB =REF(H11,5) BB =REF(H11,6) BB =REF(H11,7) BB =REF(H11,8) BB =REF(H11,9),REF(H11,10),0);
BBB:=TT1+TT2+TT3+TT4+TT5+TT6+TT7+TT8+TT9+TT10;
D:=VALUEWHEN(BBB 0,BBB);
UD:=IFELSE(CLOSE D REF(CLOSE,1) =D,1,IFELSE(CLOSE C11 REF(CLOSE,1) =C11,-3,0));
K:=VALUEWHEN(UD 0,UD);
G:=IFELSE(K=1,C11,D),COLORBLUE;
//POLYLINE(LOW 0,G,RGB(255,255,0)),DOT;
DRAWLASTBARNUMBER(G,G,0,RGB(128,0,0));
TMP:=-K;
/*
DRAWLINE(TMP 0.00001,HIGH,TMP 0.00001,OPEN,COLORGREEN);
DRAWLINE(TMP 0.00001,LOW,TMP 0.00001,CLOSE,COLORGREEN);
DRAWLINE(TMP -0.00001,HIGH,TMP -0.00001,CLOSE,COLORRED);
DRAWLINE(TMP -0.00001,LOW,TMP -0.00001,OPEN,COLORRED);
DRAWLINE(ABS(TMP) 0.00001,LOW,ABS(TMP) 0.00001,OPEN,COLORBLUE);
DRAWLINE(ABS(TMP) 0.00001,HIGH,ABS(TMP) 0.00001,OPEN,COLORBLUE);
STICKLINE(TMP 0,OPEN,CLOSE,COLORBLUE,0);
STICKLINE(TMP =0,OPEN,CLOSE,COLORRED,1);
*/
TR1 : =MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));
N:=14;
M:=1.5;
UP:=(H+L)/2+MA(TR1,N)*M;
DN:=(H+L)/2-MA(TR1,N)*M;
L1:=REF(UP,BARSLAST(UP =REF(UP,1)));
L2:=LLV(UP,N*1.5);
LL:=IF(L2 REF(L2,1) AND L1 REF(L1,1),L1,IF(L1=L2,L1,L2));
S1:=BARSLAST(CROSS(0.5,UP=LL))+1;
S2:=CROSS(COUNT((CROSS(C,LL) OR CROSS(C,REF(LL,2))) AND UP LL,S1),0.5);
A6:=BARSLAST(S2);
B6:=BARSLAST(CROSS(HHV(DN,A6+1),C));
BY:=CROSS(B6,A6);
SL:=CROSS(A6,B6);
JX:=MA(C,60);
//{云析赢指标公式网,指标公式,指标源码,指标编写教程、指标破解指标论坛。www.zbgs518.com}
HHZ:=HHV(HIGH,1)/4+HHV(HIGH,3)/4+HHV(HIGH,5)/4+HHV(HIGH,8)/4;
LLZ:=LLV(LOW,1)/4+LLV(LOW,3)/4+LLV(LOW,5)/4+LLV(LOW,8)/4;
H1Z:= IFELSE(H REF(H,2) REF(H,1) REF(H,2),REF(H,2),0);
L1Z:= IFELSE(L REF(L,2) REF(L,1) REF(L,2),REF(L,2),0);
H2Z:=VALUEWHEN(H1Z 0,H1Z);
L2Z:=VALUEWHEN(L1Z 0,L1Z);
VVZ:=C;
K1Z:=IFELSE(VVZ H2Z,-3,IFELSE(VVZ L2Z,1,0));
K2Z:=VALUEWHEN(K1Z 0,K1Z);
TMP1:=K2Z;
SJXZ:=IF(DATE 331231,1,1);
SCW:=BARSLAST(CROSS(TMP1,0));
XCW:=BARSLAST(CROSS(0,TMP1));
KTW:=BARSLAST(CROSS(JX,C));
DTW:=BARSLAST(CROSS(C,JX));
GZ:=IF(K2Z=1,H2Z,L2Z),COLORWHITE,LINETHICK1;
//G1Q:=VALUEWHEN(ISLASTBAR,GZ);
//IF(K2Z=1,GZ,NULL),COLORGREEN,LINETHICK2;
//IF(K2Z=-3,GZ,NULL),COLORMAGENTA,LINETHICK2;
偷抢:=IF(B6 A6,HHV(DN,BARSLAST(BY)+1),LLV(UP,BARSLAST(SL)+1)),COLORGREEN,LINETHICK1;
//偷不到就抢:IF(C =偷抢,偷抢,NULL),COLORGREEN,LINETHICK1;
IF(G C GZ C 偷抢 C,MIN1(G,GZ,偷抢),NULL);
IF(G C GZ C 偷抢 C,MAX1(G,GZ,偷抢),NULL);