var: flag(0);
if flag=0 and high cross above sellcheck then //高点超过sellcheck
flag=1;
if flag=1 and close>trendbuy then //判断收盘价是否处于trendbuy下方
flag=0;
if flag=1 and close cross under revsell then //价格下穿revsell时,将变量flag赋值为2
flag=2;
if flag=2 then begin //当flag为2时卖空,同时将flag赋值为0
sellshort next bar at market;
flag=0;
end;
var: flag(0);
if flag=0 and high cross above sellcheck then //高点超过sellcheck
flag=1;
if flag=1 and close>trendbuy then //判断收盘价是否处于trendbuy下方
flag=0;
if flag=1 and close cross under revsell then //价格下穿revsell时,将变量flag赋值为2
flag=2;
if flag=2 then begin //当flag为2时卖空,同时将flag赋值为0
sellshort next bar at market;
flag=0;
end;