VARA:=(((CLOSE - EMA(CLOSE,13)) / EMA(CLOSE,13)) * (0 - 100));
趋势线:EMA(((VARA/10)+EMA(CLOSE,10)),3),COLORFFFF00,LINETHICK2;
VARB:=(OPEN+HIGH+LOW)/3;
VARC:=EMA(VARB,4);
行情线:VARC,COLORYELLOW;
STICKLINE(行情线<趋势线,H,L,1,1),COLORGREEN;
STICKLINE(行情线<趋势线,C,O,6,1),COLORGREEN;
STICKLINE(行情线>=趋势线,H,L,1,1),COLORRED;
STICKLINE(行情线>=趋势线,C,O,6,1),COLORRED;
BUY1:=IF(CROSS(行情线,趋势线) OR (REF(行情线,1)=REF(趋势线,1) AND 行情线>趋势线),1,0);
{买入显示}
DRAWTEXT(CROSS(行情线,趋势线) OR (REF(行情线,1)=REF(趋势线,1) AND 行情线>趋势线),LOW*0.98,'▲'),COLOR0000FF;
DRAWTEXT(CROSS(行情线,趋势线) OR (REF(行情线,1)=REF(趋势线,1) AND 行情线>趋势线),LOW*0.975,'∣'),COLOR0000FF;
DRAWTEXT(CROSS(行情线,趋势线) OR (REF(行情线,1)=REF(趋势线,1) AND 行情线>趋势线),LOW*0.975,'‖'),COLOR0000FF;
DRAWTEXT(CROSS(行情线,趋势线) OR (REF(行情线,1)=REF(趋势线,1) AND 行情线>趋势线),LOW*0.97,'∣'),COLOR0000FF;
DRAWTEXT(CROSS(行情线,趋势线) OR (REF(行情线,1)=REF(趋势线,1) AND 行情线>趋势线),LOW*0.97,'‖'),COLOR0000FF;
DRAWTEXT(CROSS(行情线,趋势线) OR (REF(行情线,1)=REF(趋势线,1) AND 行情线>趋势线),LOW*0.965,'∣'),COLOR0000FF;
DRAWTEXT(CROSS(行情线,趋势线) OR (REF(行情线,1)=REF(趋势线,1) AND 行情线>趋势线),LOW*0.965,'‖'),COLOR0000FF;
{买出显示}
DRAWTEXT(CROSS(趋势线,行情线) OR (REF(行情线,1)=REF(趋势线,1) AND 行情线<趋势线),HIGH*1.02,'▼'),COLOR00FF00;
DRAWTEXT(CROSS(趋势线,行情线) OR (REF(行情线,1)=REF(趋势线,1) AND 行情线<趋势线),HIGH*1.025,'∣'),COLOR00FF00;
DRAWTEXT(CROSS(趋势线,行情线) OR (REF(行情线,1)=REF(趋势线,1) AND 行情线<趋势线),HIGH*1.025,'‖'),COLOR00FF00;
DRAWTEXT(CROSS(趋势线,行情线) OR (REF(行情线,1)=REF(趋势线,1) AND 行情线<趋势线),HIGH*1.03,'∣'),COLOR00FF00;
DRAWTEXT(CROSS(趋势线,行情线) OR (REF(行情线,1)=REF(趋势线,1) AND 行情线<趋势线),HIGH*1.03,'‖'),COLOR00FF00;
DRAWTEXT(CROSS(趋势线,行情线) OR (REF(行情线,1)=REF(趋势线,1) AND 行情线<趋势线),HIGH*1.035,'∣'),COLOR00FF00;
DRAWTEXT(CROSS(趋势线,行情线) OR (REF(行情线,1)=REF(趋势线,1) AND 行情线<趋势线),HIGH*1.035,'‖'),COLOR00FF00;
{加仓}
A:=(3*CLOSE+LOW+OPEN+HIGH)/6;
X:=(20*A+19*REF(A,1)+18*REF(A,2)+17*REF(A,3)+16*REF(A,4)+15*REF(A,5)+
14*REF(A,6)+13*REF(A,7)+12*REF(A,8)+11*REF(A,9)+10*REF(A,10)+9*REF(A,11)+8*REF(A,12)
+7*REF(A,13)+6*REF(A,14)+5*REF(A,15)+4*REF(A,16)+3*REF(A,17)+2*REF(A,18)+
REF(A,20))/210;
Y:=EMA(X,13);
加仓A:=SMA(EMA((C-REF(C,1))/REF(C,1),5)*100,3,1)*10;
DRAWTEXT(FILTER((CROSS(加仓A,0) OR CROSS(CLOSE,Y)) AND 行情线>=趋势线 AND BUY1=0,3),LOW*0.98,'▲'),COLORFF00FF;
加仓:FILTER((CROSS(加仓A,0) OR CROSS(CLOSE,Y)) AND 行情线>=趋势线 AND BUY1=0,3),COLORFF00FF;
STICKLINE(加仓,H,L,1,1),COLORFF00FF;
STICKLINE(加仓,C,O,6,1),COLORFF00FF;
{减仓}
VARJ1:=REF(CLOSE,1);
VARJ2:=((SMA(MAX(CLOSE-VARJ1,0),6,1))/(SMA(ABS(CLOSE-VARJ1),6,1)))*(100);
减仓A:=CROSS(85,VARJ2);
DRAWTEXT(减仓A AND 行情线>=趋势线,HIGH*1.03,'▼'),COLORYELLOW;
MTM:=C-REF(C,1);
DX:=100*EMA(EMA(MTM,6),6)/EMA(EMA(ABS(MTM),6),6);
DY:=HHV(DX,2)=HHV(DX,7) AND COUNT(DX>50,2) AND CROSS(MA(DX,2),DX);
LC:=REF(CLOSE,1);
RSI:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;
减仓B:=FILTER(CROSS(84,RSI) OR DY,5);{下穿84}
DRAWTEXT(减仓B AND 行情线>=趋势线,H*1.03,'▼'),COLORYELLOW;
减仓:减仓A OR 减仓B,COLORYELLOW;
STICKLINE(减仓,H,L,1,1),COLORYELLOW;
STICKLINE(减仓,C,O,6,1),COLORYELLOW;
{压力支撑线}
RSV:=(CLOSE-LLV(LOW,13))/(HHV(HIGH,13)-LLV(LOW,13))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
RSV24:=(CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*100;
K24:=SMA(RSV24,3,1);
D24:=SMA(K24,3,1);
J24:=3*K24-2*D24;
压力位:IF(CROSS(j24,j),H,REF(H,BARSLAST(CROSS(j24,j)))),COLORWHITE;
支撑位:IF(CROSS(j,j24),L,REF(L,BARSLAST(CROSS(j,j24)))),COLORRED;
{一阳穿三线}
BBI:=(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4;
上:=BBI+3*STD(BBI,10);
中:=BBI;
下:=BBI-3*STD(BBI,10);
优选:BETWEEN(上,OPEN,CLOSE) AND BETWEEN(中,OPEN,CLOSE) AND BETWEEN(下,OPEN,CLOSE) AND CLOSE>OPEN AND 上>=REF(上,1) AND 中>=REF(中,1) AND 下>REF(下,1),COLOR00FF00;
DRAWTEXT(FILTER(优选,2),LOW*0.95,'¤'),COLOR00FF00;
DRAWTEXT(FILTER(优选,2),LOW*0.95,'●'),COLOR00FF00;
|