等级: 新手上路
- 注册:
- 2024-10-14
- 曾用名:
|
楼主 |
发表于 2024-10-17 13:38
|
显示全部楼层
帮老头改下代码吧,下面是我的代码,拜托了
if holding=0 then
begin
if 开多平空条件 then tbuy(islastbar,firstvol,lmt,min(dynainfo2(54,kcname),dynainfo2(28,kcname)+hd*mindiff),0,'',kcname),ignorecheckprice;
if 开空平多条件 then tbuyshort(islastbar,firstvol,lmt,max(dynainfo2(55,kcname),dynainfo2(34,kcname)-hd*mindiff),0,'',kcname),ignorecheckprice;
end
else
begin
if 开多平空条件 and holding<-0.5 then
begin
tsellshort(islastbar,holding,lmt,min(dynainfo2(54,pcname),dynainfo2(28,pcname)+hd*mindiff),0,'',pcname),ignorecheckprice;
tbuy(islastbar,firstvol,lmt,min(dynainfo2(54,kcname),dynainfo2(28,kcname)+hd*mindiff),0,'',kcname),ignorecheckprice;
end
if 开空平多条件 and holding>0.5 then
begin
tsell(islastbar,holding,lmt,max(dynainfo2(55,pcname),dynainfo2(34,pcname)-hd*mindiff),0,'',pcname),ignorecheckprice;
tbuyshort(islastbar,firstvol,lmt,max(dynainfo2(55,kcname),dynainfo2(34,kcname)-hd*mindiff),0,'',kcname),ignorecheckprice;
end
end
|
|