[PEL] 复制代码 cond1:=min(open,close)>ma(close,20);
cond2:=max(open,close)<ma(close,20);
cond3:=max(open,close)<ma(close,60);
ma60:ma(c,60);
MID:MA(CLOSE,20);//布林中轨
UPPER: MID + 2*STD(CLOSE,20);//布林上轨
LOWER: MID - 2*STD(CLOSE,20);//布林下轨
VARIABLE:mark:=1;
if ref(cond1 and o<c ,1) and open>MID and holding=0 THEN
BEGIN
buy(1,25%,limitr,o),PERTRADER;
END
if ref(cond3 and o>c,1) and close<MID and holding>=0 THEN
BEGIN
全平:sell(1,0,market);
mark:=1;
END
if ref(cond2 and o>c,1) and open<MID and holding>=0 and mark THEN
BEGIN
减仓:sell(1,50%,market),PERTRADER;
mark:=0;
END
|