各位高手 小編大大你們好 :
小弟想詢問一下,我今天測試程式交易的時候遇到的一個問題
我設定1點過後不會交易, 結果在 13:06 他下了一筆多單
之後沒有賣出! 跳出異常 策略就停止了
以下想問的是 :
1. 策略停止是因為 跳出異常 吧? 因為我看到 從 1300~1306 都一直有跳出檢查程式碼 ( 但不予以執行 )
2. 為什麼突然在13:06 他就 自己下單了呢? 是5min 6min cycle 一次程式碼嗎?
目前我把 最下面的 currenttime( 設定交易時間的部分 ) 移動到最上方, 好像目前是沒有再發生下單問題
不知道是不是因為順序呢?
//
if position = 0 and filled = 0 and condition1 then setposition(1, market);
//
if filled = 1 and position = 1
and (high >= (filledAvgPrice + profit){停利} or low <= (filledAvgPrice - loss){停損})
then setposition(0, market);
if currenttime > 130000 and currenttime < 134000
or currenttime > 040000 and currenttime < 050000
or currenttime > 210000 and currenttime < 212500
then setposition(0, market);
以上謝謝


4 評論