等级: 免费版
- 注册:
- 2021-5-20
- 曾用名:
|
1、图表交易,固定轮询,1秒tick,如何做到只开一手;策略如下:
if 开空平多条件 and not((开多平空条件)) and holding>=0 then BEGIN // and (CD0||CD1)
sell(1,0,MARKETR);//平多 (CLOSS)*Lots
BuyP:=CLOSE;
exitP:=0;
end
if (开多平空条件) and holding=0 then BEGIN//and (CD0||CD1)
buy(C<O,Lots,MARKETR);//开多(CLOSS+1)*Lots
BuyP:=O+10*MINDIFF;
end
if TYPEBAR(1,2)>=1 and O<BuyP and HOLDING=0 THEN BEGIN// and (CD0||CD2)
buy(1,Lots,limitR,O+10*MINDIFF);//开多
BuyP:=O+10*MINDIFF;
end
2、正常buy(1,Lots,limitR,O+10*MINDIFF);超出10个价位开仓,为何经常开仓不成功,变为挂单。
有没有办法,K线开始就确保开盘价成交,或以市价成交?
谢谢
|
|