作者: 技术008 时间: 2025-1-13 13:15
cond1:all(close>bbi and k>d,60);
if cond1 and close<ref(close,todaybar)*1.06 then
begin
sellshort(1,holding,marketr);
buy(1,1,marketr);
END
if close>bbi and k>d and time=closetime(4) and close<ref(close,todaybar)*1.06 then
begin
sellshort(1,holding,marketr);
buy(1,4,marketr);
END
if close<bbi and c<d then sell(1,holding,marketr);
if hhv(OPENPROFITPER,enterbars)>0.16 and OPENPROFITPER<(0.16-4.5/100) then sell(1,holding,marketr);
// 卖出及平仓条件
IF C >= BASE_PRICE * 1.09 AND holding > 0 THEN BEGIN
SELL("上涨9%", holding / 3, MARKET);
holding := holding - holding / 3;
END;
IF C >= BASE_PRICE * 1.15 AND holding > 0 THEN BEGIN
SELL("上涨15%", holding / 3, MARKET);
holding := holding - holding / 3;
END;
IF C >= BASE_PRICE * 1.20 AND holding > 0 THEN BEGIN
SELL("上涨20%", holding, MARKET);
holding := 0;
END;
IF CROSS(MA1, MA2, -1) AND holding > 0 THEN BEGIN
SELL("5日均线下穿10日均线", holding, MARKET);
holding := 0;
END;
IF C <= BASE_PRICE * 0.95 AND holding > 0 THEN BEGIN
SELL("下跌5%", holding / 2, MARKET);
holding := holding - holding / 2;
END;
IF C <= BASE_PRICE * 0.90 AND holding > 0 THEN BEGIN
SELL("下跌10%", holding, MARKET);
holding := 0;
END;作者: 技术008 时间: 2025-1-13 14:48
// 定义持仓量
variable: flag = 0;
// 卖出及平仓条件
IF C >= BASE_PRICE * 1.09 AND flag = 0 THEN BEGIN
SELL(1, holding / 3, MARKET);
flag:=1;
END;
IF C >= BASE_PRICE * 1.15 AND flag=1 THEN BEGIN
SELL(1, holding / 3, MARKET);
flag:=2;
END;
IF C >= BASE_PRICE * 1.20 AND flag=2 THEN BEGIN
SELL(1, hh, MARKET);
flag:=0;
END;