我是在用XS及自動交易中心在做當沖交易,一直會遇到策略回測的交易紀錄,跟實際交易紀錄有落差的狀況,例如:1/1 盤中策略都沒有交易,但是1/2我做回測時,會發現回測在1/1會有交易
差距最大甚至會有5~6個策略在盤中都完全沒交易,但是隔天回測時5~6個策略都各有1~10筆交易不等
想請問我可以怎麼找出問題在哪裡?
或是有哪些函數寫法應該改變呢?
目前我的作法是:1分鐘洗價,用前一根K棒做進場判斷、即時洗價做出場判斷
有用到的語法大略是包含以下類型
if date<>date[1] then value1=0;
if time = 090500 then value1 = summation(getField("V","1")[1],5);
if date<>date[1] then value2=0;
if time = 091500 then value2 = getField("內盤量","D")-getField("外盤量","D");
if date<>date[1] then value3=0;
if time = 093000 then value3 = getField("內盤量","D")-getField("外盤量","D");
it
time > 090500 and time < 120000
and value1 > getField("成交量","D")[1]*0.3
and value2 < value3
and summation(getField("賣出特大單金額","1")[1],15) > summation(getField("買進特大單金額","1")[1],15)
and summation(getField("投信買張","D")[1],10) <= 0
and summation(getsymbolField("tse.tw", "內盤量","1")[1],25) > summation(getsymbolField("tse.tw", "外盤量","1")[1],25)
and getsymbolField("tse.tw", "內盤量","D") > getsymbolField("tse.tw", "外盤量","D")
and getsymbolField("tse.tw", "O","D")/getsymbolField("tse.tw", "C","D")[1] - 1 < 0.015
and getsymbolField("TSE.TW", "上漲家數","1")[1] - getsymbolField("TSE.TW", "上漲家數","1")[20] < 100
4 評論