qwert0401 發表於 19-9-6 18:10

Multicharts使用limit單到價格了有時無法成交


最近,開始學習程式交易,Interactive Brokers(IB) 連接 Multicharts。但是在嘗試程式交易的時候,發現使用limit單有時會無法成交,例如:ES期貨多單進場是2970,掛limit單平倉或反手是2978。但是價格到了2978會沒成交,有時候又會成交到。當價格沒成交,之後價格回到2977.75,下一個k棒會取消了limit單,但是backtesting是顯示成交了,造成了真實的成交和backtesting有部分或之後的交易有差異。我上網看,可以用設定轉成市價單去下單,但是 IB 好像無此功能。請問,有什麼辦法或程序怎樣改寫可以讓limit單到了價格,立即以市價成交,還是Multicharts可以去設置做到。感激萬分!


academic 發表於 19-9-7 07:57

本帖最後由 academic 於 19-9-7 08:13 編輯

A Market order is an order to buy or sell at the market bid or offer price. A market order may increase the likelihood of a fill and the speed of execution, but unlike the Limit order a Market order provides no price protection and may fill at a price far lower/higher than the current displayed bid/ask.
[*]Products: BOND, CFD, EFP, CASH, FUND, FUT, FOP, OPT, STK, WAR

[*]            Order order = new Order();
            order.Action = action;
            order.OrderType = "MKT";
            order.TotalQuantity = quantity;
[*]Market If TouchedA Market If Touched (MIT) is an order to buy (or sell) a contract below (or above) the market. Its purpose is to take advantage of sudden or unexpected changes in share or other prices and provides investors with a trigger price to set an order in motion. Investors may be waiting for excessive strength (or weakness) to cease, which might be represented by a specific price point. MIT orders can be used to determine whether or not to enter the market once a specific price level has been achieved. This order is held in the system until the trigger price is touched, and is then submitted as a market order. An MIT order is similar to a stop order, except that an MIT sell order is placed above the current market price, and a stop sell order is placed below

[*]Products: BOND, CFD, CASH, FUT, FOP, OPT, STK, WAR

[*]            Order order = new Order();
            order.Action = action;
            order.OrderType = "MIT";
            order.TotalQuantity = quantity;
            order.AuxPrice = price;


if possible please use their API and write your own program.
I don't use multicharts so don't know how to set it at multicharts.
any question please call IB technical support, They are very nice to
asnwer your questions.
only write your own code then you can fully control it.

flashbibby 發表於 19-9-9 10:06

限價單到價掛出去要能夠成交的方法,就是要能穿價,你的狀況就是觸發後未穿價,因為你的排序在較後面,所以無法成交。

能在不改變程式的回測的情形下,能做的大概就是從下單機下手,限價單觸發後轉市價或是限價讓點。不然就是用api自己寫囉
頁: [1]
查看完整版本: Multicharts使用limit單到價格了有時無法成交