等级: 免费版
- 注册:
- 2024-1-11
- 曾用名:
|
次数:totaltrade,linethick0;
胜率:percentwin,linethick0;
连亏:maxseqloss,linethick0;
连赢:maxseqwin,linethick0;
当前持仓:holding,colorgray,linethick0;
当前资产:asset,noaxis,colorgray;
ma1:=ema((open+2*close+high+low)/5,3);
ma2:=ema((open+2*close+high+low)/5,8);
ma3:=ema((open+2*close+high+low)/5,18);
ma4:=ema((open+2*close+high+low)/5,34);
A:=ATAN((MA1/MA4-1)*100)*180/3.1415926,NODRAW;
RSV:=(CLOSE-LLV(LOW,21))/(HHV(HIGH,21)-LLV(LOW,21))*100;
K:SMA(RSV,5,1);
D:SMA(K,5,1);
B:=ATAN((K/D-1)*100)*180/3.1415926,NODRAW;
kd:=A>=2 and B>=0; //开多条件
pd:=A<=0 AND B<0; //平多条件
kk:=A<=-2 and B<=0; //开空条件
pk:=A>=0; //平空条件
手数:=5;
//交易系统
平空:sellshort(pk,手数,market);
平多:sell(pd,手数,market);
开多:buy(kd and holding=0,手数,market);
开空:buyshort(kk and holding=0,手数,market);
if time>144500 then//如果时间在14点45分以后,那么
begin
sell(holding>0,0,market);//如果持有多单,以市价卖出所有持仓量
sellshort(holding<0,0,market);//如果持有空单,以市价空头卖出所有持仓量
end
|
|