Wealth-lab ApplyAutoStop訊號輸出成檔案? - 財經
By Donna
at 2008-11-22T13:17
at 2008-11-22T13:17
Table of Contents
程式碼大約如下:
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的程式碼?
謝謝
--
Tags:
財經
All Comments
By Candice
at 2008-11-23T10:26
at 2008-11-23T10:26
By Edith
at 2008-11-25T19:09
at 2008-11-25T19:09
By Hedy
at 2008-11-30T03:33
at 2008-11-30T03:33
By Jacob
at 2008-12-04T17:15
at 2008-12-04T17:15
By David
at 2008-12-06T04:36
at 2008-12-06T04:36
Related Posts
為啥這樣的邏輯還會在同一根k線進出場
By Irma
at 2008-11-12T11:20
at 2008-11-12T11:20
請問有誰能有30k 台指期貨的歷史資料
By Hedwig
at 2008-11-12T10:23
at 2008-11-12T10:23
新手請問EasyLanguage程式
By Genevieve
at 2008-11-11T09:36
at 2008-11-11T09:36
新手請問EasyLanguage程式
By Iris
at 2008-11-10T18:46
at 2008-11-10T18:46
有一個網站上看到的程式交易,跟各位請넠…
By Damian
at 2008-11-08T23:38
at 2008-11-08T23:38