[PEL] 复制代码 BE:=C>O;
SE:=O>C;BX:=SE;SX:=BE;
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
INPUT:VLL(1,0,10000,1);
IF ISLASTBAR AND (WORKMODE=1 OR WORKMODE=2) THEN
BEGIN
LBL:=STKLABEL&'=AT=';
TBH:=TBUYHOLDING(1);
TSH:=TSELLHOLDING(1);
TAH:=TBH+TSH;
IF TAH THEN
BEGIN
TBP:=TAVGENTERPRICEEX2('','',0);
TSP:=TAVGENTERPRICEEX2('','',1);
TBC:=CLOSE-TBP;
TSC:=TSP-CLOSE;
BYL:=TBC*TBH;
SYL:=TSC*TSH;
IF BYL<0 AND BX THEN BEGIN EXTGBDATASET(LBL, 1); END;
IF SYL<0 AND SX THEN BEGIN EXTGBDATASET(LBL, -1); END;
IF TBH AND TBC>0 AND BX THEN BEGIN
DEBUGFILE('D:\TEXT.TXT','TBH%.2f',TBH);
DEBUGFILE('D:\TEXT.TXT','TBC%.2f',TBC);
DEBUGFILE('D:\TEXT.TXT','BYL%.2f',BYL);
TSELL(1,0,LMT,CLOSE+MINDIFF);
END;
IF TSH AND TSC>0 AND SX THEN BEGIN
TSELLSHORT(1,0,LMT,CLOSE-MINDIFF);
END;
END ELSE
BEGIN
IF BE {AND NOT(TISREMAIN(0))} THEN BEGIN
TBUY(1, VLL, LMT, CLOSE+MINDIFF);
EXTGBDATASET(LBL, 0);
END;
IF SE {AND NOT(TISREMAIN(0))} THEN BEGIN
TBUYSHORT(1, VLL, LMT, CLOSE-MINDIFF);
EXTGBDATASET(LBL, 0);
END;
END;
END;
|