N:=14;
均价:=(2*C+(H-L)/2+L)/3;
价差:=SUM(均价-REF(均价,1),2)/2;
高低:=(均价+价差);
实价:=(高低+均价)/2;
AA:=EMA(((SLOPE(实价,N)*20)+实价),N*3);
BB:=EMA(((SLOPE(均价,N)*20)+均价),N*3);
多空线:=(AA+BB)/2;
市场心理:COUNT(C>多空线,N)/N*100,COLORWHITE,LINETHICK1;
险1:IF(市场心理>95,市场心理+0,120),COLORMAGENTA,LINETHICK2;
公式:IF(市场心理<5,市场心理-20,0),COLORBLUE,LINETHICK4;
DRAWTEXT(CROSS(公式,-1),-15,'公式'),COLORMAGENTA,LINETHICK1;
公式买:IF(CROSS(市场心理,7),35,0),COLORMAGENTA,LINETHICK3;
DRAWTEXT(公式买,36,'公式买'),COLORMAGENTA,LINETHICK1;
VAR1:=REF(LOW,1);
LC:=REF(CLOSE,1);
RSI1:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;
AR:=SUM(HIGH-OPEN,26)/SUM(OPEN-LOW,26)*100;
卖:=CROSS(85,RSI1)*30,COLORBLUE,LINETHICK2;
STICKLINE(卖,0,60,3,0),LINETHICK4,COLORGREEN;
DRAWTEXT(CROSS(85,RSI1),65,'卖'),LINETHICK1,COLORGREEN;
VARB:=SMA(MAX(CLOSE-LC,0),7,1)/SMA(ABS(CLOSE-LC),7,1)*100;
VARC:=SMA(MAX(CLOSE-LC,0),13,1)/SMA(ABS(CLOSE-LC),13,1)*100;
VARD:=BARSCOUNT(CLOSE);
BT1:=CROSS(RSI1,25);
STICKLINE(BT1,0,-1,1,0),LINETHICK4,COLORYELLOW ;
主力:=EMA( (CLOSE-MA(CLOSE,7))/MA(CLOSE,7)*480,2)*5,LINETHICK1,COLOR0000FF;
散户:=EMA( (CLOSE-MA(CLOSE,11))/MA(CLOSE,11)*480,7)*5,LINETHICK1,COLORC87800;
BT2:=CROSS(主力,散户) AND 主力<-10;
BT:=FILTER(COUNT(BT1 OR BT2,3)>=2,3);
STICKLINE(BT,0,26,3,0),LINETHICK8,COLORRED;
DRAWTEXT(BT,32,'獺'),LINETHICK1,COLORRED;
STICKLINE(BT2,0,-10,3,0),LINETHICK6,COLORYELLOW;
DRAWTEXT(BT2,-11,'升'),LINETHICK2,COLORYELLOW;
VARB1:=REF(CLOSE,2);
通达信:=SMA(MAX(CLOSE-VARB1,0),7,1)/SMA(ABS(CLOSE-VARB1),7,1)*100,COLORFFAA66;
顶: IF(通达信< REF(通达信,1) AND 通达信>79,通达信,0),LINETHICK2,COLORGREEN;
DRAWTEXT(CROSS(顶,1),86,'顶'),LINETHICK1,COLORGREEN;