一组策略,买入条件一样,为了追求利润最大化,卖出条件做了修改,想通过回测找到利润最大。但回测中发现得到的交易次数都不一样,假如按开仓计的话,交易次数应该是一样的,不解?
我的策略是只开一次仓, 仓位为“0”才买,按理是开仓、平仓是一 一个对应的。 策略如下:买入条件一样,卖出条件略有不同,个人认为交易次数应该是一样的,只是胜率不一样而以,但这两种情况测试下来,交易次数就是不一样。不知为什么。
方案一:
if CROSS(MA10,MA20) AND macd>REF(macd,1) and tbuyholding(1)=0 and TTOTALDAYTRADE<1 then BEGIN
tbuy(1,10000/close,mkt);
End
if (c>tenterprice*1.045 or c<tenterprice*0.93 or tenterbars>=20) and tbuyholding(0)>0 then BEGIN
tsell(1,0,mkt);
end
方案二:
if CROSS(MA10,MA20) AND macd>REF(macd,1) and tbuyholding(1)=0 and TTOTALDAYTRADE<1 then BEGIN
tbuy(1,10000/close,mkt);
End
if ( c>tenterprice*1.045 or c<tenterprice*0.93 or tenterbars>=20 or CROSS(dea, diff) or cross(ma10,ma5)) and tbuyholding(0)>0 then BEGIN
tsell(1,0,mkt);
end
我已将两份测试报告通过QQ离线文件传给金字塔客服10(2862096385).
你开平仓条件限制上形成了类似互锁条件的。只有平仓触发后,在没有持仓时,才会进行开仓动作,那就有可能造成开仓不一致