AAA:=(MA(CLOSE,80)-MA(CLOSE,13)/3);
BBB:=MA((CLOSE-AAA)/AAA,1);
XG1:=crOSS(BBB,0) AND LOW/REF(HIGH,1)<1.012;
VAR111A:=(C+H+O+L)/4;
压力线:=EMA(VAR111A,20)*(1+80/1000) ;
支撑线:=EMA(VAR111A,32)*(1-100/1000);
工作线:=expma(CLOSE,12);
XG2:=CROSS(C ,支撑线) OR (L<支撑线 AND C>支撑线);
XG:CROSS(C,工作线) AND XG1 AND XG2,NODRAW;{买点}
VAR444:=REF(CLOSE,1);
VAR555:=SMA(MAX(CLOSE-VAR444,0),7,1)/SMA(Abs(CLOSE-VAR444),7,1)*100;
SS:CROSS(79,VAR555),NODRAW;{卖点}
BL:BArslAST(XG),NODRAW;{最近买点距当前交易周期}
ssl:BARSSINCEN(SS,BL),NODRAW;{第一卖点距当前交易周期}
BC:REF(C,BL),NODRAW{买点当天收盘价};
SSC:REF(C,SSL),NODRAW{卖点当天收盘价};
BS:=BL-SSL,NODRAW;{买卖区间交易周期}
GJ:=IF(SSL=0,BS,DRAWNULL),NODRAW;
MAXX:=HHV(H,GJ),NODRAW;
MINN:=LLV(L,GJ),NODRAW;
MAXXX:IF(SSL=0,MAXX,REF(MAXX,BARSLAST(SSL=0))),NODRAW{买卖区间最高价};
MINNN:IF(SSL=0,MINN,REF(MINN,BARSLAST(SSL=0))),NODRAW{买卖区间最低价};
MAX%:100*(MAXXX/BC-1),NODRAW;{买卖区间最大涨幅}
MIN%:100*(MINNN/BC-1),NODRAW;{买卖区间最大跌幅}
S%:100*(SSC/BC-1),NODRAW;{买卖区间收盘涨幅}
NOW%:100*(C/BC-1),NODRAW;{买点到当前的涨幅};
DRAWICON(XG,L*0.99,1);
DRAWICON(SS,H*1.01,2);