--
老师你好,谢谢帮助修改。
问题:
此主题相关图片如下:qq图片20160128162758.png

1、设置采用的是走完一根K线开仓,平仓采用 marketr和limitr价格形式,而程序是在走完一根K线开仓的,平仓信号却在走完一根K线前发出了,所以这种情况下,造成该笔开仓不能被平仓,或一直持有,或与下次同方向平仓信号时才能平仓。
例如:今天13::15信号显示开多并多止盈,其实是该根K线结束后以1924点开了多单,并没有多止盈,这个多单一直持有。在13:20以1920.8点只是空开,不再平多单,并且这个空单下笔也不平仓。如此,这样有一笔多单一直持有至收盘,亏损巨大。
2、多止损25个点不起作用。
有关程序如下:
平空:sellshort(BB10>1 AND AA10>REF(AA10,1) ,0, marketr);
if BB10>1 AND AA10>REF(AA10,1) and holding=0 and bjd=0 then begin
buy(1,1, marketr);
bjd:=1;
bjk:=0;
end
平多:sell(BB10<1 AND AA10<REF(AA10,1) ,0,marketr);
if BB10<1 AND AA10<REF(AA10,1) and holding=0 and bjk=0 then begin
buyshort(1,1,marketr);
bjk:=1;
bjd:=0;
end
多止损:sell(C<ENTERPRICE-25*MINDIFF,holding,marketr);
空止损:sellshort(C>ENTERPRICE+25*MINDIFF,holding,marketr);
if hhv(h,enterbars+1)>=enterprice+10*mindiff and hhv(h,enterbars+1)<=enterprice+15*mindiff and (h>=enterprice+5*mindiff) and (l<=enterprice+5*mindiff) then 多止盈1:sell(1,0, limitr,enterprice+5*mindiff);
if hhv(h,enterbars+1)>=enterprice+16*mindiff and hhv(h,enterbars+1)<=enterprice+20*mindiff and (h>=enterprice+10*mindiff) and (l<=enterprice+10*mindiff) then 多止盈2:sell(1,0, limitr,enterprice+10*mindiff);
if llv(l,enterbars+1)<=enterprice-10*mindiff and llv(l,enterbars+1)>=enterprice-15*mindiff and (h>=enterprice-5*mindiff) and (l<=enterprice-5*mindiff) then 空止盈1:sellshort(1,0, limitr,enterprice-5*mindiff);
if llv(l,enterbars+1)<=enterprice-16*mindiff and llv(l,enterbars+1)>=enterprice-20*mindiff and (h>=enterprice-10*mindiff) and (l<=enterprice-10*mindiff) then 空止盈2:sellshort(1,0, limitr,enterprice-10*mindiff);
if hhv(h,enterbars+1)>=enterprice+21*mindiff and close<=hhv(h,enterbars+1)-3*mindiff then 移动平多:sell(1,0,market);
if llv(l,enterbars+1)<=enterprice-21*mindiff and c>=llv(l,enterbars+1)+3*mindiff then 移动平空:sellshort(1,0,market);