回復 36# ezbentley
參考 IBcontroller 1.3 beta (for IB TWS>=890) , copy past here again :The IB Controller (BrokerIB.EXE) is a separate application that acts as a buffer between AmiBroker and Interactive Brokers TWS. It accepts commands from AmiBroker and send orders to / retrieves information from TWS. It also allows to cancel/transmit orders manually. The IB controller application is run automatically by AmiBroker if the formula contains the following call: ibc = GetTradingInterface("IB"); After this call the BrokerIB.EXE (IB Controller) application is launched and the ibc variable contains the pointer to OLE automation object that has several methods (functions) that allow to place/modify/cancel orders via TWS and to query portfolio information. Those methods (functions) are called as any automation object methods, for example:
ibc = GetTradingInterface("IB"); if( ibc.IsConnected() ) // check if connection to IB was successfull
{
ibc.PlaceOrder("MSFT", "BUY", 100, "MKT", 0, 0, "DAY", False ); // place order but do not transmit yet
}
意似 要寫code call ibc interface 而 且 成功 就可 place order , 不 傳出 意是 IB TWS 處 要 manual 去 click
"T" (transmit) button , 如此 是為 測試 應 改成 直接 transmit ---please read readme file in WWW or my attached other place in this forum . |