本文整理汇总了Java中com.ib.client.ExecutionFilter类的典型用法代码示例。如果您正苦于以下问题:Java ExecutionFilter类的具体用法?Java ExecutionFilter怎么用?Java ExecutionFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExecutionFilter类属于com.ib.client包,在下文中一共展示了ExecutionFilter类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import com.ib.client.ExecutionFilter; //导入依赖的package包/类
public static void main(String[] args){
// create connection object for to communicate with TWS
EClientSocket eClientSocket = new EClientSocket(new TWSClientInterface());
// try to connect to TWS
eClientSocket.eConnect("127.0.0.1", 7496, 0);
// auto associate TWS order with API
eClientSocket.reqAutoOpenOrders(true);
// get all the execution entries so init empty filter
ExecutionFilter filter = new ExecutionFilter();
// request execution details
eClientSocket.reqExecutions(0,filter);
}
示例2: reqExecutions
import com.ib.client.ExecutionFilter; //导入依赖的package包/类
public void reqExecutions( ExecutionFilter filter, ITradeReportHandler handler) {
if (!checkConnection())
return;
m_tradeReportHandler = handler;
m_client.reqExecutions( m_reqId++, filter);
sendEOM();
}
示例3: reqExecutions
import com.ib.client.ExecutionFilter; //导入依赖的package包/类
public void reqExecutions( ExecutionFilter filter, ITradeReportHandler handler) {
m_tradeReportHandler = handler;
m_client.reqExecutions( m_reqId++, filter);
sendEOM();
}
示例4: requestOrderStatus
import com.ib.client.ExecutionFilter; //导入依赖的package包/类
@Override
public synchronized TradeOrder requestOrderStatus(String orderId) {
ExecutionFilter filter = new ExecutionFilter();
ibConnection.reqExecutions(executionRequestId++, filter);
throw new IllegalStateException("Not yet implemented");
}
示例5: onRefresh
import com.ib.client.ExecutionFilter; //导入依赖的package包/类
private void onRefresh() {
ApiDemo.INSTANCE.controller().reqExecutions( new ExecutionFilter(), this);
}
示例6: orderOperations
import com.ib.client.ExecutionFilter; //导入依赖的package包/类
private static void orderOperations(EClientSocket client, int nextOrderId) throws InterruptedException {
/*** Requesting the next valid id ***/
//! [reqids]
//The parameter is always ignored.
client.reqIds(-1);
//! [reqids]
//Thread.sleep(1000);
/*** Requesting all open orders ***/
//! [reqallopenorders]
client.reqAllOpenOrders();
//! [reqallopenorders]
//Thread.sleep(1000);
/*** Taking over orders to be submitted via TWS ***/
//! [reqautoopenorders]
client.reqAutoOpenOrders(true);
//! [reqautoopenorders]
//Thread.sleep(1000);
/*** Requesting this API client's orders ***/
//! [reqopenorders]
client.reqOpenOrders();
//! [reqopenorders]
//Thread.sleep(1000);
/*** Placing/modifying an order - remember to ALWAYS increment the nextValidId after placing an order so it can be used for the next one! ***/
//! [order_submission]
client.placeOrder(nextOrderId++, ContractSamples.USStock(), OrderSamples.LimitOrder("SELL", 1, 50));
//! [order_submission]
//! [faorderoneaccount]
Order faOrderOneAccount = OrderSamples.MarketOrder("BUY", 100);
// Specify the Account Number directly
faOrderOneAccount.account("DU119915");
client.placeOrder(nextOrderId++, ContractSamples.USStock(), faOrderOneAccount);
//! [faorderoneaccount]
//! [faordergroupequalquantity]
Order faOrderGroupEQ = OrderSamples.LimitOrder("SELL", 200, 2000);
faOrderGroupEQ.faGroup("Group_Equal_Quantity");
faOrderGroupEQ.faMethod("EqualQuantity");
client.placeOrder(nextOrderId++, ContractSamples.USStock(), faOrderGroupEQ);
//! [faordergroupequalquantity]
//! [faordergrouppctchange]
Order faOrderGroupPC = OrderSamples.MarketOrder("BUY", 0); ;
// You should not specify any order quantity for PctChange allocation method
faOrderGroupPC.faGroup("Pct_Change");
faOrderGroupPC.faMethod("PctChange");
faOrderGroupPC.faPercentage("100");
client.placeOrder(nextOrderId++, ContractSamples.EurGbpFx(), faOrderGroupPC);
//! [faordergrouppctchange]
//! [faorderprofile]
Order faOrderProfile = OrderSamples.LimitOrder("BUY", 200, 100);
faOrderProfile.faProfile("Percent_60_40");
client.placeOrder(nextOrderId++, ContractSamples.EuropeanStock(), faOrderProfile);
//! [faorderprofile]
//client.placeOrder(nextOrderId++, ContractSamples.USStock(), OrderSamples.PeggedToMarket("BUY", 10, 0.01));
//client.placeOrder(nextOrderId++, ContractSamples.EurGbpFx(), OrderSamples.MarketOrder("BUY", 10));
//client.placeOrder(nextOrderId++, ContractSamples.USStock(), OrderSamples.Discretionary("SELL", 1, 45, 0.5));
//! [reqexecutions]
client.reqExecutions(10001, new ExecutionFilter());
//! [reqexecutions]
Thread.sleep(10000);
}