金字塔决策交易系统

标题: 为什么没有满足条件,频繁的开多平多开空平空呢 [打印本页]

作者: 张恒    时间: 2024-1-21 15:57
标题: 为什么没有满足条件,频繁的开多平多开空平空呢
次数: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





作者: 技术009    时间: 2024-1-22 08:55
if time>184500 then//如果时间在14点45分以后,那么
begin
sell(holding>0,0,market);//如果持有多单,以市价卖出所有持仓量
sellshort(holding<0,0,market);//如果持有空单,以市价空头卖出所有持仓量                                                                                    
end

金字塔时区了解下:https://www.weistock.com/docs/HE ... 4%E6%97%B6%E5%8C%BA







欢迎光临 金字塔决策交易系统 (https://www.weistock.com/bbs/) Powered by Discuz! X3.4