通达信波段趋势主图源码公式 :
input:N(5,1,10);
{DRAWGBK((CLOSE > 0),COLORRGB(0,0,30),COLORRGB(0,130,100),1);}
VAR1:=(CLOSE - REF(CLOSE,6));
VAR2:=(CLOSE - REF(CLOSE,7));
VAR3:=(CLOSE - REF(CLOSE,8));
VAR4:=(CLOSE - REF(CLOSE,9));
VAR5:=(CLOSE - REF(CLOSE,10));
VAR6:=((((HHV(HIGH,N) - LLV(LOW,N)) / LLV(LOW,N)) * 100) > 8);
DX:=(((((VAR1 + VAR2) + VAR3) + VAR4) + VAR5) / 5);
ZX:=MA(DX,5);
CX:=MA(DX,21);
MA5:MA(CLOSE,5),COLORFF00FF;
MA10:MA(CLOSE,10),COLORFFFF00;
MA20:MA(CLOSE,20),LINETHICK2,COLORFF00FF;
MA60:MA(CLOSE,60),COLOR00FF00;
MA120:MA(CLOSE,120),COLORFFFFFF;
VAR11:=(((CLOSE - LLV(LOW,60)) / (HHV(HIGH,60) - LLV(LOW,60))) * 100);
VAR12:=SMA(VAR11,5,1);
VAR13:=SMA(VAR12,10,1);
VAR14:=CROSS(VAR13,VAR12);
VAR15:=((VAR13 > 80) OR (VAR12 > 80));
VAR16:=(VAR14 AND VAR15);
VAR17:=EMA(((AMOUNT / VOL) / 100),3);
VAR18:=EMA(VAR17,88);
VAR19:=(EMA(VAR17,88) * 0.85);
VARA:=(VAR19 * 0.87);
VARB:=((LOW < VARA) AND (CLOSE > (REF(CLOSE,1) * 1.02)));
DRAWTEXT(FILTER(VARB,6),(LOW - 0.2),'★买'),COLOR6600FF;
{仅供参考:STICKLINE(VAR16,HIGH,HIGH,18,1),COLORFF0000;}
DRAWTEXT(FILTER(CROSS(69,((SMA(MAX((CLOSE - REF(CLOSE,1)),0),8,1) / SMA(ABS((CLOSE - REF(CLOSE,1))),8,1)) * 100)),10),(HIGH + 0.36),'★卖 '),COLOR00FF00;
DRAWTEXT(FILTER(CROSS((0 - 5),MA((((LLV(LOW,45) - CLOSE) / (HHV(HIGH,45) - LLV(LOW,45))) * 100),5)),5),(LOW - 0.2),'★买'),COLOR00FFFF;
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,9,0),COLOR00FF00;
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,6,0),COLOR007D00;
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,2.4,0),COLORFFFF00;
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,1.1,0),COLORFFFFFF;
STICKLINE((CLOSE > OPEN),CLOSE,OPEN,9,0),COLORRED;
STICKLINE((CLOSE > OPEN),CLOSE,OPEN,6,0),COLORCC0000;
STICKLINE((CLOSE > OPEN),CLOSE,OPEN,2.4,0),COLOR00FFFF;
STICKLINE((CLOSE > OPEN),CLOSE,OPEN,1.1,0),COLORFF00FF;
{STICKLINE((CLOSE > OPEN),OPEN,LOW,0.5,0),COLORCC0000;
STICKLINE((CLOSE > OPEN),CLOSE,HIGH,0.5,0),COLORCC0000;
STICKLINE((OPEN >= CLOSE),CLOSE,LOW,0.5,0),COLORFFFF00;
STICKLINE((OPEN >= CLOSE),OPEN,HIGH,0.5,0),COLORFFFF00;}; |