以下是通达信变色操作区间主图公式
通达信变色操作区间主图公式
B:=100;
MA(CLOSE,5)COLORWHITE,NODRAW;
MA(CLOSE,10),COLORYELLOW NODRAW;
MA(CLOSE,20),COLORGREEN NODRAW;
MA(CLOSE,30),COLORMAGENTA NODRAW;
MA(CLOSE,60),COLORRED NODRAW;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.12,0,0,EXTERNSTR(0,3)),COLORWHITE;
DIF:=EMA(C,12)-EMA(C,26);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2;
STICKLINE(CURRBARSCOUNT<61,CONST(LLV(C,60)),CONST(HHV(C,60)),5,0),COLORBROWN;
STICKLINE(CURRBARSCOUNT<21,CONST(LLV(C,20)),CONST(HHV(C,20)),5,0),COLORBLUE;
小:=CONST(LLV(L,B));
大:=CONST(HHV(H,B));
K:=大-小;
宽:=K*0.25;
宽1:=K*0.4;
宽2:=K*0.15;
宽3:=K*0.3;
XS2:=小-K*0.26;
XS5:=小-K*0.66 ;
XS8:=小-K*1.06;
XS7:=小-K*0.96;
STICKLINE( HOUR=15 ,小,大,0,0),COLORGRAY;
RSV10:=(CLOSE-LLV(C,10))/(HHV(C,10)-LLV(C,10));
RSV20:=(CLOSE-LLV(C,20))/(HHV(C,20)-LLV(C,20));
RSV60:=(CLOSE-LLV(C,60))/(HHV(C,60)-LLV(C,60));
RSV120:=(CLOSE-LLV(C,120))/(HHV(C,120)-LLV(C,120));
NOTEXT52:0.8*宽+XS2,COLORGRAY,DOTLINE;
NOTEXT2:0.5*宽+XS2,COLORGRAY,DOTLINE;
NOTEXT3:0.2*宽+XS2,COLORGRAY,DOTLINE;
NOTEXT62:宽+XS2,COLORGRAY;
NOTEXTK2:XS2,COLORGRAY;
NOTEXTXS5:XS5 COLORGRAY;
STICKLINE(L<LLV(C,20),XS2+宽*0.5,XS2+宽,1,0),COLORGREEN;
STICKLINE(RSV20=0,XS2+宽*0.5,XS2+宽,1,0),COLORMAGENTA;
NOTEXT8:RSV60*宽+XS2,COLORRED LINETHICK2;
NOTEXT7:RSV20*宽+XS2,COLORYELLOW LINETHICK2;
NOTEXT47:RSV10*宽+XS2,COLORWHITE;
GG:=CONST(HHV(MA(V,3),B));
V1:=(V/GG)*宽2+XS8;
STICKLINE(V,XS8,V1,1,0),COLORGRAY;
DIF20:=EMA(C,20)-EMA(C,60);
DEA20:=EMA(DIF20,9);
李1P:=CONST(HHV(DEA,B));
李2P:=CONST(HHV(DIF,B));
李3P:=CONST(HHV(MACD,B));
李4P:=CONST(HHV(DIF20,B));
李5P:=CONST(HHV(DEA20,B));
李D1P:=MAX(李1P,MAX(李2P,MAX(李5P,MAX(李4P,李3P))));
李1AP:=CONST(LLV(DEA,B));
李2AP:=CONST(LLV(DIF,B));
李3AP:=CONST(LLV(MACD,B));
李4AP:=CONST(LLV(DEA20,B));
李5AP:=CONST(LLV(DIF20,B));
李X1P:=MIN(李1AP,MIN(李2AP,MIN(李4AP,MIN(李5AP,李3AP))));
李宽P:=李D1P-李X1P;
零1:=(ABS(李X1P))/李宽P*宽1+XS5;
MACD1:=(MACD+ABS(李X1P))/李宽P*宽1+XS5;
Y:=(DEA20+ABS(李X1P))/李宽P*宽1+XS5,;
U:=(DIF20+ABS(李X1P))/李宽P*宽1+XS5;
DRAWBAND(Y,RGB(0,0,255),U,RGB(162,132,32));
STICKLINE(MACD>REF(MACD,1),MACD1,零1,1,0),COLORLIRED;
STICKLINE(MACD<REF(MACD,1),MACD1,零1,1,0),COLORWHITE;
(DEA+ABS(李X1P))/李宽P*宽1+XS5,COLORGREEN LINETHICK2;
(DIF+ABS(李X1P))/李宽P*宽1+XS5,COLORRED LINETHICK2;
IF(MA(CLOSE,20)<大 AND MA(CLOSE,20)>小,MA(CLOSE,20),DRAWNULL),COLORGREEN,LINETHICK2;
IF(MA(CLOSE,30)<大 AND MA(CLOSE,30)>小,MA(CLOSE,30),DRAWNULL),COLORMAGENTA LINETHICK2;
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
IF(MA(CLOSE,5)<大 AND MA(CLOSE,5)>小,MA(CLOSE,5),DRAWNULL)COLORWHITE,;
IF(MA(CLOSE,10)<大 AND MA(CLOSE,10)>小,MA(CLOSE,10),DRAWNULL),COLORYELLOW;
IF(MA(CLOSE,60)<大 AND MA(CLOSE,60)>小,MA(CLOSE,60),DRAWNULL),COLORRED ;
IF(MA(CLOSE,120)<大 AND MA(CLOSE,120)>小,MA(CLOSE,120),DRAWNULL),COLORLIGRAY,DOTLINE;
STICKLINE(V=LLV(V,10),XS8,V1,5,0),COLORRED;
DRAWRECTREL(0,0,60,150,RGB(250,250,250));
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0,0,0,ROUND(((CONST(HHV(C,20))-CONST(LLV(C,20)))/CONST(LLV(C,20))*100))),COLORBLACK;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0,0.05,0,ROUND(((CONST(HHV(C,60))-CONST(LLV(C,60)))/CONST(LLV(C,60))*100))),COLORBLACK;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0,0.1,0,ROUND(((CONST(HHV(C,B))-CONST(LLV(C,B)))/CONST(LLV(C,B))*100))),COLORBLACK;
DRAWRECTREL(970,1000,1000,480,RGB(250,250,250));
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.968,0.49,0,MIN(99,ROUND(RSV10*100))),COLORBLACK;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.968,0.52,0,MIN(99,ROUND(RSV20*100))),COLORBLACK;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.968,0.55,0,MIN(99,ROUND(RSV60*100))),COLORBLACK;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND DIF>REF(DIF,1),0.97,0.62,0,’上’),COLORMAGENTA;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND DIF<REF(DIF,1),0.97,0.62,0,’下’),COLORBLACK;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND DEA>REF(DEA,1),0.97,0.66,0,’上’),COLORMAGENTA;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND DEA<REF(DEA,1),0.97,0.66,0,’下’),COLORBLACK;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND DIF20>REF(DIF20,1),0.97,0.72,0,’上’),COLORMAGENTA;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND DIF20<REF(DIF20,1),0.97,0.72,0,’下’),COLORBLACK;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND DEA20>REF(DEA20,1),0.97,0.76,0,’上’),COLORMAGENTA;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND DEA20<REF(DEA20,1),0.97,0.76,0,’下’),COLORBLACK;
M20:=(MA(C,20)-MA(C,60))/(MA(C,60))*100,;
M10:=(MA(C,10)-MA(C,60))/(MA(C,60))*100,;
M5:=(MA(C,10)-MA(C,30))/(MA(C,30))*100,;
M1:=(MA(C,5)-MA(C,30))/(MA(C,30))*100,;
XS7 COLORGRAY;
T6:=CONST(IF(BARSCOUNT(C)<159,CONST(BARSCOUNT(C))-59,B));
T3:=CONST(IF(BARSCOUNT(C)<129,CONST(BARSCOUNT(C))-29,B));
李1B:=CONST(HHV(M1,B));
李2B:=CONST(HHV(M5,B));
李3B:=CONST(HHV(M10,B));
李4B:=CONST(HHV(M20,B));
李D1B:=MAX(李1B,MAX(李3B,MAX(李4B,MAX(0,李2B))));
李1AB:=CONST(LLV(M1,T3));
李2AB:=CONST(LLV(M5,T3));
李3AB:=CONST(LLV(M10,T6));
李4AB:=CONST(LLV(M20,T6));
李D2B:=MIN(李1AB,MIN(李3AB,MIN(李4AB,MIN(0,李2AB)))) ;
全D:=IF(李D1B=DRAWNULL,0,李D1B);
全X1:=IF(李D2B=DRAWNULL,0,李D2B);
全宽1:=ABS(全D)+ABS(全X1);
李XB:=MAX(李1B,MAX(0,李2B));
李X2B:=MIN(李1AB,MIN(0,李2AB)) ;
全宽2:=ABS(李XB)+ABS(李X2B);
全宽:=IF(全宽1=0,全宽2,全宽1);
全X:=IF(全宽1=0,李X2B,全X1);
零:(ABS(全X))/全宽*宽3+XS7,COLORWHITE,DOTLINE;
(M20+ABS(全X))/全宽*宽3+XS7,COLORRED ;
(M10+ABS(全X))/全宽*宽3+XS7,COLORCYAN ;
(M5+ABS(全X))/全宽*宽3+XS7,COLORYELLOW ;
(M1+ABS(全X))/全宽*宽3+XS7,COLORWHITE ;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND M1>REF(M1,1),0.97,0.84,0,’上’),COLORMAGENTA;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND M1<REF(M1,1),0.97,0.84,0,’下’),COLORBLACK;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND M5>REF(M5,1),0.97,0.88,0,’上’),COLORMAGENTA;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND M5<REF(M5,1),0.97,0.88,0,’下’),COLORBLACK;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND M10>REF(M10,1),0.97,0.93,0,’上’),COLORMAGENTA;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND M10<REF(M10,1),0.97,0.93,0,’下’),COLORBLACK;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND M20>REF(M20,1),0.97,1,0,’上’),COLORMAGENTA;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND M20<REF(M20,1),0.97,1,0,’下’),COLORBLACK;
评论(0)