剛剛試了回測ORB, 簡單的ORB, 卻遇上問題 , 請各位大大指教
inputs:beginTime(0945),endTime(1630); vars:ah(0),al(0); if time=0945 then begin ah=highd(0); al=lowd(0); value1=ah+1; value2=al-1; end; condition1=time>=beginTime and time<endTime; if condition1 then begin buy next bar at value1 stop; sellshort next bar at value2 stop; end; {ifmarketposition<>0 then begin sellnext bar at value2 stop; buytocovernext bar at value1 stop; end;} setexitonclose; 恆指期貨0915開市, 用30分K, 看了回測報告, 發現進場時間必定是45分或15分, stop 單應該不會每次都每根bar開始時進場吧?
於是開啟了細部回測, 結果進場時間也是45分或15分, 開啟了細部回測不會在bar 中進場嗎?
然後遇上了更奇怪的問題, 我圖改成用1分K, 結果每天都會0916進場,  
beginTime 是0945, 為何每天都會0916進場? 到底出了甚麼問題?
time>=beginTime and time<endTime; 這個語法試過用在其他地方是OK的, 為什麼用在這裡就不OK?
|