請教一下:
我現在想要用一個回測程式做出以下動作
假設我要在特定時段9:00~9:15時用特定條件篩選紀錄股票(例如漲幅在0~7.5%內或五價量表總委賣 >= 100 張)
並且在特定時段10:00~10:30進行買進賣出判斷(例如1分k收盤價超過布林軌道上軌)
我希望在篩選跟進場時間點不一樣,請問能否在程式內先記錄起來?
以下是我寫的範例,我用value1當作已篩選好的股票,但回測出來都無結果
if time > 090000 and time <091000 and getPriceChangeRatio() >0 and getPriceChangeRatio() < 7.5 then
value1 = 1;
//在9:00~9:10內,股價漲幅在0~7.5%內時,value1為1
if time > 100000 and time <103000 and getfield("close","1") >bollingerBand(close,20,2) and value1 =1 then
ret = 1;
//在10:00~10:30,1分k收盤價大於布林軌道上軌且value1為1時,下單進場
1 評論