看板 Trading 關於我們 聯絡資訊
程式碼大約如下: InstallProfitTarget( 18 ); InstallStopLoss(2); //2% stop for Bar := daysMA to BarCount - 1 do begin ApplyAutoStops( Bar +1 ); .... if LastPositionActive then begin if ... then begin CoverAtMarket(Bar+1, LastPosition, 'Cover'); FileWrite(FileCreate('C:\signal.txt'),LastPosition+'1'); //1 buy end; end else if ... then begin ShortAtMarket(Bar+1, 'Short+'+AsString(WaitToExit)); FileWrite(FileCreate('C:\signal.txt'),LastPosition+'-1'); //-1 sell end; end; end; 正常情況下 short跟cover訊號都可以寫入signal.txt 下單機也可以正常讀取signal.txt 但是碰到stoploss時 卻沒有辦法把cover的訊號寫到signal.txt 就會有open的部位 請問要如何把AutoStop的訊號輸出到signal.txt呢? 或是要如何將autostop修改成manual cover的程式碼? 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.133.192.132
idleidle:我之前是用自已寫的stoploss去解決~~XD 11/22 18:41
idleidle:不過我也很想知道其它的方法~~~~ 11/22 18:42
TimHortons:我覺得ApplyAutoStops那邊怪怪的 你無法look-ahead 11/24 15:08
TimHortons:說明書寫當你在scan某日時 只要某日有觸發條件 就會啟 11/24 15:09
TimHortons:動.. 但是Bar+1尚未發生 無法觸發..請參考 11/24 15:09
TimHortons:說明書上也寫 autostop是某Bar結束後去檢查的 11/24 15:10