后台头寸矫正程序
tsell(holding=0 and tholding>0,tholding,lmt,l-mindiff*2),ALLOWREPEAT;
tsellshort(holding=0 and tholding<0,tholding,lmt,h+mindiff*2),ALLOWREPEAT;
tbuy(holding>tholding and tholding>=0,holding-tholding,lmt,h+mindiff*2),ALLOWREPEAT;
tbuyshort(holding<tholding and tholding<=0,tholding-holding,lmt,l-mindiff*2),ALLOWREPEAT;
debugout('当前实际持仓%.0f',tholding);
debugout('当前图表持仓%.0f',holding);
debugout('开仓历时%.0f',tenterbars);
debugfile('d:\test.txt','当前持仓%.2f',tholding);
================
有时候做图表交易的时候会有部分交易指令没发出(不是没成交或者指令被拒而是没发出)~
目前暂时搞不清是用户自身操作问题还是CTP模拟服务器的问题还是软件问题
解决办法是开个后台头寸矫正程序
保持帐户中真实持仓与图表一致~
0秒确认的程序
非常同步..
不错,这是我一贯的做法,这样做,科学不科学,尚且需要大家进一步探讨。。
不知道什么原因,开的仓很快被后台平掉了
不知道什么原因,开的仓很快被后台平掉了 |
后台头寸矫正程序
tsell(holding=0 and tholding>0,tholding,lmt,l-mindiff*2),ALLOWREPEAT;
tsellshort(holding=0 and tholding<0,tholding,lmt,h+mindiff*2),ALLOWREPEAT;
tbuy(holding>tholding and tholding>=0,holding-tholding,lmt,h+mindiff*2),ALLOWREPEAT;
tbuyshort(holding<tholding and tholding<=0,tholding-holding,lmt,l-mindiff*2),ALLOWREPEAT;
debugout('当前实际持仓%.0f',tholding);
debugout('当前图表持仓%.0f',holding);
debugout('开仓历时%.0f',tenterbars);
debugfile('d:\test.txt','当前持仓%.2f',tholding);
================
有时候做图表交易的时候会有部分交易指令没发出(不是没成交或者指令被拒而是没发出)~
目前暂时搞不清是用户自身操作问题还是CTP模拟服务器的问题还是软件问题
解决办法是开个后台头寸矫正程序
保持帐户中真实持仓与图表一致~
0秒确认的程序