if holding=0 then begin
if x+y>0 then
buy(1,30%,limitr,open-0.2);
end
if holding=0 then begin
if x+y<0 then
buyshort(1,30%,limitr,open-0.2);
end
if holding>0 then begin
if x+y<0 then begin
sell(1,holding,limitr,open-0.2);
buyshort(1,30%,limitr,open-0.2);
end
end
if holding<0 then begin
if x+y>0 then begin
sellshort(1,holding,limitr,open-0.2);
buy(1,30%,limitr,open-0.2);
end
end
这样设计是否可以在信号出现的时候开盘价能成交?
或者直接使用滑点
variable:DHcDs=1;{多、空单滑点数}
if holding=0 then begin
if x+y>0 then
buy(1,30%,limitr,open-DHcDs);
end
if holding=0 then begin
if x+y<0 then
buyshort(1,30%,limitr,open-DHcDs);
end
if holding>0 then begin
if x+y<0 then begin
sell(1,holding,limitr,open-DHcDs);
buyshort(1,30%,limitr,open-DHcDs);
end
end
if holding<0 then begin
if x+y>0 then begin
sellshort(1,holding,limitr,open-DHcDs);
buy(1,30%,limitr,open-DHcDs);
end
end
这样写可以否?
会以指定价报单,具体以什么价成交要看具体交易了
滑点肯定是有的 只不过滑点的话我能想到的也就用限价单来控制下 别无她发 求个大侠指教