[問題] Wealth-lab ApplyAutoStop訊號輸出成檔案?
程式碼大約如下:
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
→
11/22 18:41, , 1F
11/22 18:41, 1F
→
11/22 18:42, , 2F
11/22 18:42, 2F
推
11/24 15:08, , 3F
11/24 15:08, 3F
→
11/24 15:09, , 4F
11/24 15:09, 4F
→
11/24 15:09, , 5F
11/24 15:09, 5F
→
11/24 15:10, , 6F
11/24 15:10, 6F
Trading 近期熱門文章
14
18
307
941
PTT職涯區 即時熱門文章