討論區列表
FAQ
一般模式
討論串模式
標題:
[發表] 驗證委託單為何被執行或是沒有被執行。
by 2015-03-05 11:20:04
0
暱稱:
MultiCharts小秘書
信箱:不顯示
成就:發文(0) / 回文(0) / 推薦(0)
一般來說,客戶能夠預期某些委託單將會在程式交易進行中被產生並執行委託或是不被產生與執行委託。
下列有兩組方法能夠協助您了解為何委託單在自動交易時被委託成功並成交或是沒有。
一、交易追蹤視窗
若委託單在自動交易中被產生且被傳送至下單元件中,此委託單將會顯示在交易追蹤視窗中的委託單頁籤中。
若委託單已經成交,您能夠看到此委託單的執行價格以及相關細節。(請見
委託單頁籤
)
這裡有兩個造成委託單並沒有成功被委託至券商的可能原因:
1.此委託單被經紀商或是MultiCharts委託拒絕。
(一般來說,您可以在交易追蹤視窗的紀錄頁籤中看到委託拒絕原因)
2.此委託單被您使用的策略所取消,而此策略邏輯是依照使用者透過EasyLanguage/PowerLanguage編譯而來。
一個委託單只要它在下次運算中有達到產生條件,就會被保留下來。若條件不成立,委託單就會被取消。
二、從策略中監測
這個方法不管在回測或是自動交易上都非常有效。
因為在回測上,您並無法透過交易追蹤視窗來監看歷史資料運算狀況,不同於真實交易您能夠在畫面上看到您策略邏輯的呈現。
請加入下列程式碼在您的進出場條件之前。
它能夠幫助您了解您的委託單在哪一根K棒、何時被觸發以及執行價格為何。
Var: Scale(0);
Condition1 = close > close[1];
If MinMove < 10 then
Scale = 1;
If MinMove > 99 and MinMove < 1000 then
Scale = 2;
If MinMove > 999 and MinMove < 10000 then
Scale = 3;
If MinMove > 9999 and MinMove < 100000 then
Scale = 4;
If MinMove > 99999 and MinMove < 1000000 then
Scale = 5;
If Condition1 = true then begin
print( "======================", NewLine,
"The date is ", DateToString(DateToJulian(Date)), ",", NewLine,
"time is ", TimeToString(ELTimeToDateTime(Time)), ",", NewLine,
"bar # is ", maxbarsback+currentbar, ",", NewLine,
"current bar open is ", open, ",", NewLine,
"current bar high is ", high, ",", NewLine,
"current bar low is ", low, ",", NewLine,
"current bar close is ", close, ",", NewLine,
"market position on chart is", MarketPosition, ",", NewLine,
"market position at broker is", MarketPosition_at_Broker, ",", NewLine,
"Condition1 is true, so at close of this bar the limit order to buy at ", NumToStr(close,scale), " is generated by the script", NewLine,
"to be executed at bar # ", maxbarsback+currentbar+1);
end else begin
print( "======================", NewLine,
"The date is ", DateToString(DateToJulian(Date)), ",", NewLine,
"time is ", TimeToString(ELTimeToDateTime(Time)), ",", NewLine,
"bar # is ", symbol_currentbar, ",", NewLine,
"current bar open is ", open, ",", NewLine,
"current bar high is ", high, ",", NewLine,
"current bar low is ", low, ",", NewLine,
"current bar close is ", close, ",", NewLine,
"market position on chart is", MarketPosition, ",", NewLine,
"market position at broker is", MarketPosition_at_Broker, ",", NewLine,
"Condition1 is false, so no order is generated.");
end;
當您將訊號應用在您的圖表後,開啟PowerLanguage Editor,您將可以在Output頁籤中看見下列:
======================
The date is 10/8/2013,
time is 4:00:00 PM,
bar # is 995.00,
current bar open is 865.32,
current bar high is 865.98,
current bar low is 851.63,
current bar close is 853.67,
market position on chart is 1.00,
market position at broker is 0.00,
Condition1 is false, so no order is generated.
======================
The date is 10/9/2013,
time is 4:00:00 PM,
bar # is 996.00,
current bar open is 856.28,
current bar high is 862.65,
current bar low is 842.98,
current bar close is 855.86,
market position on chart is 1.00,
market position at broker is 0.00,
Condition1 is true, so at close of this bar the limit order to buy at 855.9 is generated by the script
to be executed at bar # 997.00
編輯文章 by MultiCharts小秘書 2015-03-19 10:23:38
第一頁
上一頁
下一頁
最後頁
討論區列表
FAQ
MultiCharts
│
討論區
│
會員專區
│
教學講座
│
支援與服務
│
產品購買
│
申請試用
All rights for MultiCharts Trading Software are reserved by MultiCharts, LLC
凱衛資訊股份有限公司 營利事業統一編號(21261212) 著作權所有 本網站最佳瀏覽解析度為 1024 x 768
隱私權政策
│
網站安全政策
│
著作權說明
若不清楚點選圖片更新驗證碼
註冊帳號
忘記密碼
解除鎖定