//建立多头的进场条件
long :=VBuy and time>=092700 and time<=150000;
if long then
begin
sellshort(holding < 0, 0, limitr, open);
buy(holding = 0, 1, limitr, open);
Price:=AVGENTERPRICE;//持仓价位
SELL(HOLDING>0,HOLDING,Stopr,Price*0.9977);//止损
end
//Price:=AVGENTERPRICE;//持仓价位
//画出多头的止损线
partline(holding>0,Price*0.9977,colorred);
//开空条件
short := VSell and time >= 092700 and time <= 150000;
if short then
begin
sell(holding > 0, 0, limitr, open);
buyshort(holding = 0, 1, limitr, open);
Price:=AVGENTERPRICE;//持仓价位
sellshort(holding > 0, 0, Stopr,Price*1.0027);
end
//画出空头的止损线
partline(holding<0, Price*1.0027, colorgreen);
//收盘前5分钟平仓
if time >= 151200 then
begin
sell(holding > 0, 0, limitr, open);
sellshort(holding < 0, 0, limitr, open);
end