LOWV:=LLV(LOW,9);
HIGHV:=HHV(HIGH,9);
RSV:=EMA((CLOSE-LOWV)/(HIGHV-LOWV)*100,3);
K:=EMA(RSV,3);
D:=MA(K,3);
//准备下单条件。
COND1:=CROSS(C,MA(CLOSE,10))AND C>MA(CLOSE,10)*1.0015;//开仓条件
COND2:=CROSS(D,K);//开空条件
//下单
开多仓:BUY(COND1 and holding=0,1,market),IGNORECHECKPRICE;//开仓信号
开空:SELLSHORT(COND2 and holding=0,1,market);//开空信号
//固定止盈止损部分************************
//多止盈
IF C-AVGENTERPRICE>35*MINDIFF THEN BEGIN
SELL(1,HOLDING,MARKET);
END
//多止损
IF AVGENTERPRICE-C>10*MINDIFF THEN BEGIN
SELL(1,HOLDING,MARKET);
END
//空止盈
IF AVGENTERPRICE-C>35*MINDIFF THEN BEGIN
SELLSHORT(1,HOLDING,MARKET);
END
//空止损
IF C-AVGENTERPRICE>10*MINDIFF THEN BEGIN
SELLSHORT(1,HOLDING,MARKET);
END
//************************************
//其他
当前持仓:HOLDING,COLORGRAY,LINETHICK0;
当前资产:ASSET,NOAXIS,COLORGRAY;
帮忙修改一下一个止盈止损策略,好像有点不对,只有开多仓,没有开空仓
开空:buyshort(COND2 and holding=0,1,market);//开空信号
开空是这个