加个移动止损语句即可:
if holding>0 and close<=hhv(h,enterbars+1)*0.95 then sell(1,0,marketr);
if holding<0 and close>=llv(l,enterbars+1)*1.05 then sellshort(1,0,marketr);
为什么加了移动止损后,止损平仓之后,合开仓条件也不再开仓?
//移动20%止损
if holding<0 and close>=llv(l,enterbars+1)*1.20 then sellshort(1,0,marketr);
if pk and holding<0 then begin
SELLSHORT(1,0,marketr);
美国原油在15年8月28止损20%后,11月份就没再开仓了。
[此贴子已经被作者于2016-5-30 9:16:08编辑过]
我的意思是,举个例子说明一下“合开仓条件也不再开仓”
重点是找一个符合条件但没有开仓的地方
而不是看代码
[此贴子已经被作者于2016-5-30 9:32:27编辑过]
嗯 美油15年0828止损后。
合开空条件的时间表是:
15年11月16日,
15年12月10日,
16年1月份11日,
但这三个时间都没再开仓了,去掉移动止损代码则开仓。但我现在要这个移动止损代码,我知道可以放大到30%止损但是太大了。
发一下信号截图,然后调试一下是代码里面的什么造成了没有信号