本文整理汇总了Java中com.ib.client.OrderState类的典型用法代码示例。如果您正苦于以下问题:Java OrderState类的具体用法?Java OrderState怎么用?Java OrderState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OrderState类属于com.ib.client包,在下文中一共展示了OrderState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: NewOrderState
import com.ib.client.OrderState; //导入依赖的package包/类
public NewOrderState(OrderState orderState) {
m_status = OrderStatus.valueOf( orderState.m_status);
m_initMargin = orderState.m_initMargin;
m_maintMargin = orderState.m_maintMargin;
m_equityWithLoan = orderState.m_equityWithLoan;
m_commission = orderState.m_commission;
m_minCommission = orderState.m_minCommission;
m_maxCommission = orderState.m_maxCommission;
m_commissionCurrency = orderState.m_commissionCurrency;
m_warningText = orderState.m_warningText;
}
开发者ID:rterp,项目名称:SumZeroTrading,代码行数:12,代码来源:NewOrderState.java
示例2: openOrder
import com.ib.client.OrderState; //导入依赖的package包/类
@Override public void openOrder(int orderId, Contract contract, Order orderIn, OrderState orderState) {
NewOrder order = new NewOrder( orderIn);
IOrderHandler handler = m_orderHandlers.get( orderId);
if (handler != null) {
handler.orderState( new NewOrderState( orderState) );
}
if (!order.whatIf() ) {
for (ILiveOrderHandler liveHandler : m_liveOrderHandlers) {
liveHandler.openOrder( new NewContract( contract), order, new NewOrderState( orderState) );
}
}
recEOM();
}
开发者ID:rterp,项目名称:SumZeroTrading,代码行数:16,代码来源:ApiController.java
示例3: openOrder
import com.ib.client.OrderState; //导入依赖的package包/类
@Override public void openOrder(int orderId, Contract contract, Order order, OrderState orderState) {
IOrderHandler handler = m_orderHandlers.get( orderId);
if (handler != null) {
handler.orderState(orderState);
}
if (!order.whatIf() ) {
for (ILiveOrderHandler liveHandler : m_liveOrderHandlers) {
liveHandler.openOrder( contract, order, orderState );
}
}
recEOM();
}
开发者ID:qerio,项目名称:goib,代码行数:14,代码来源:ApiController.java
示例4: displayMargin
import com.ib.client.OrderState; //导入依赖的package包/类
protected void displayMargin(OrderState orderState) {
String str = String.format( "Equity with loan: %s\n\nInitial margin: %s\nMaintenance margin: %s\n",
fmt( Double.parseDouble(orderState.equityWithLoan() ) ),
fmt( Double.parseDouble( orderState.initMargin() ) ),
fmt( Double.parseDouble(orderState.maintMargin() ) ) );
JOptionPane.showMessageDialog( this, str, "Post-Trade Margin Requirements", JOptionPane.INFORMATION_MESSAGE);
}
开发者ID:qerio,项目名称:goib,代码行数:9,代码来源:TicketDlg.java
示例5: openOrder
import com.ib.client.OrderState; //导入依赖的package包/类
@Override public void openOrder(Contract contract, Order order, OrderState orderState) {
OrderRow full = m_map.get( order.permId() );
if (full != null) {
full.m_order = order;
full.m_state = orderState;
fireTableDataChanged();
}
else if (shouldAdd(contract, order, orderState) ) {
full = new OrderRow( contract, order, orderState);
add( full);
m_map.put( order.permId(), full);
fireTableDataChanged();
}
}
开发者ID:qerio,项目名称:goib,代码行数:16,代码来源:OrdersPanel.java
示例6: updateWebCommission
import com.ib.client.OrderState; //导入依赖的package包/类
public void updateWebCommission(int id, Order order, OrderState orderState) throws SQLException, ClassNotFoundException {
if (order == null || orderState == null) {
return;
}
if (MathUtil.isValid(orderState.m_commission)) {
executeUpdate(
"UPDATE LOW_PRIORITY IGNORE `web`.`executions` "
+ " SET commission = " + orderState.m_commission
+ " WHERE ID = " + id
+ " AND m_orderId = " + order.m_orderId
+ " ;");
}
}
开发者ID:AnyObject,项目名称:OAT,代码行数:15,代码来源:WebSchema.java
示例7: OpenOrder
import com.ib.client.OrderState; //导入依赖的package包/类
public OpenOrder(
int orderId ,
Contract contract ,
Order order ,
OrderState orderState
) {
this.orderId = orderId ;
this.contract = contract ;
this.order = order ;
this.orderState = orderState;
}
开发者ID:softwarespartan,项目名称:TWS,代码行数:12,代码来源:OpenOrder.java
示例8: openOrder
import com.ib.client.OrderState; //导入依赖的package包/类
@Override
public void openOrder(int orderId, Contract contract, Order order, OrderState orderState) {
//not implemented
}
开发者ID:rterp,项目名称:SumZeroTrading,代码行数:5,代码来源:BaseIBConnectionDelegate.java
示例9: openOrder
import com.ib.client.OrderState; //导入依赖的package包/类
@Override
public void openOrder(int orderId, Contract contract, Order order, OrderState orderState) {
ibConnectionDelegates.stream().forEach((delegate) -> {
delegate.openOrder(orderId, contract, order, orderState);
});
}
开发者ID:rterp,项目名称:SumZeroTrading,代码行数:7,代码来源:IBConnection.java
示例10: openOrder
import com.ib.client.OrderState; //导入依赖的package包/类
@Override
public void openOrder(int orderId, Contract contract, Order order, OrderState orderState) {
logger.debug("OpenOrder: " + orderId + " Contract: " + contract + " Order: " + order + " OrderState: " + orderState);
}
开发者ID:rterp,项目名称:SumZeroTrading,代码行数:6,代码来源:InteractiveBrokersBroker.java
示例11: shouldAdd
import com.ib.client.OrderState; //导入依赖的package包/类
@Override protected boolean shouldAdd(Contract contract, Order order, OrderState orderState) {
return contract.isCombo();
}
开发者ID:qerio,项目名称:goib,代码行数:4,代码来源:ComboPanel.java
示例12: shouldAdd
import com.ib.client.OrderState; //导入依赖的package包/类
protected boolean shouldAdd(Contract contract, Order order, OrderState orderState) {
return true;
}
开发者ID:qerio,项目名称:goib,代码行数:4,代码来源:OrdersPanel.java
示例13: OrderRow
import com.ib.client.OrderState; //导入依赖的package包/类
OrderRow( Contract contract, Order order, OrderState state) {
m_contract = contract;
m_order = order;
m_state = state;
}
开发者ID:qerio,项目名称:goib,代码行数:6,代码来源:OrdersPanel.java
示例14: openOrder
import com.ib.client.OrderState; //导入依赖的package包/类
@Override public void openOrder(int orderId, Contract contract, Order order, OrderState orderState) {
}
开发者ID:qerio,项目名称:goib,代码行数:3,代码来源:Test.java
示例15: openOrder
import com.ib.client.OrderState; //导入依赖的package包/类
public void openOrder( int orderId, Contract contract, Order order, OrderState orderState) {
// received open order
String msg = EWrapperMsgGenerator.openOrder( orderId, contract, order, orderState);
m_TWS.add( msg) ;
}
开发者ID:qerio,项目名称:goib,代码行数:6,代码来源:SampleFrame.java
示例16: openOrder
import com.ib.client.OrderState; //导入依赖的package包/类
public void openOrder(int orderId, Contract contract, Order order, OrderState orderState) {
logIn("openOrder");
}
开发者ID:qerio,项目名称:goib,代码行数:4,代码来源:SimpleWrapper.java
示例17: openOrder
import com.ib.client.OrderState; //导入依赖的package包/类
@Override
public void openOrder(int orderId, Contract contract, Order order,
OrderState orderState) {
System.out.println("OpenOrder. ID: "+orderId+", "+contract.symbol()+", "+contract.secType()+" @ "+contract.exchange()+": "+
order.action()+", "+order.orderType()+" "+order.totalQuantity()+", "+orderState.status());
}
开发者ID:qerio,项目名称:goib,代码行数:7,代码来源:EWrapperImpl.java
示例18: openOrder
import com.ib.client.OrderState; //导入依赖的package包/类
@Override
public void openOrder(final int orderId, final Contract contract, final Order order, final OrderState orderState) {
try {
openOrders.add(order);
} catch (Exception e) {
log(Level.SEVERE, null, e);
}
// new Thread(new Runnable() {
//
// @Override
// public void run() {
try {
TradingThread tradingThread = Main.getStrategy(contract);
// if (tradingThread == null) {
// log(Level.WARNING, "Unknown contract: " + contract.m_localSymbol);
// } else {
OrderRecord orderRecord = orderRecordMap.get(order.m_orderId);
boolean enterOrder = false;
if (orderRecord != null) {
orderRecord.setOpenOrder(order, orderState);
// for (ListIterator<Trade> listIterator = tradingThread.getTrades().iterator(); listIterator.hasNext();) {
// Trade trade = listIterator.next();
for (Trade trade : tradingThread.getTrades()) {
if (trade.isEnterOrder(orderRecord)) {
enterOrder = true;
break;
}
}
if (tradingThread.isOrphanOrder(orderRecord)) {
tradingThread.cancelOrder(orderRecord);
}
}
Main.tradingSchema.insertOrder(contract, order, orderState, enterOrder);
Main.webSchema.updateWebCommission(tradingThread.getContractId(), order, orderState);
// }
} catch (Exception ex) {
log(Level.SEVERE, null, ex);
}
// }
// }).start();
super.openOrder(orderId, contract, order, orderState);
}
开发者ID:AnyObject,项目名称:OAT,代码行数:53,代码来源:IbTradingClient.java
示例19: insertOrder
import com.ib.client.OrderState; //导入依赖的package包/类
public void insertOrder(Contract contract, Order order, OrderState orderState, boolean enterOrder) throws SQLException, ClassNotFoundException {
executeBatch(
"INSERT INTO `orders`"
+ " (m_permId, m_conId, m_orderId, m_clientId, m_action, m_totalQuantity,"
+ " m_orderType, m_lmtPrice, m_auxPrice, m_tif, m_ocaGroup, m_ocaType,"
+ " m_transmit, m_parentId, m_triggerMethod, m_outsideRth, m_goodAfterTime,"
+ " m_goodTillDate, m_allOrNone, m_minQty, m_volatilityType, m_trailStopPrice,"
+ " m_whatIf, enterOrder)"
+ " VALUES("
+ SqlUtil.formatValues(
order.m_permId,
contract.m_conId,
order.m_orderId,
order.m_clientId,
order.m_action,
order.m_totalQuantity,
order.m_orderType,
order.m_lmtPrice,
order.m_auxPrice,
order.m_tif,
order.m_ocaGroup,
order.m_ocaType,
order.m_transmit,
order.m_parentId,
order.m_triggerMethod,
order.m_outsideRth,
order.m_goodAfterTime,
order.m_goodTillDate,
order.m_allOrNone,
order.m_minQty,
order.m_volatilityType,
order.m_trailStopPrice,
order.m_whatIf,
enterOrder)
+ " ) ON DUPLICATE KEY UPDATE modified_time_long = UNIX_TIMESTAMP() * 1000"
+ ";",
"UPDATE `orders` SET"
+ " m_status =" + SqlUtil.formatValues(orderState.m_status)
+ ", m_initMargin =" + SqlUtil.formatValues(orderState.m_initMargin)
+ ", m_maintMargin =" + SqlUtil.formatValues(orderState.m_maintMargin)
+ ", m_equityWithLoan =" + SqlUtil.formatValues(orderState.m_equityWithLoan)
+ ", m_commission =" + SqlUtil.formatValues(orderState.m_commission)
+ ", m_minCommission =" + SqlUtil.formatValues(orderState.m_minCommission)
+ ", m_maxCommission =" + SqlUtil.formatValues(orderState.m_maxCommission)
+ ", m_commissionCurrency =" + SqlUtil.formatValues(orderState.m_commissionCurrency)
+ ", m_warningText =" + SqlUtil.formatValues(orderState.m_warningText)
+ " WHERE m_permId =" + order.m_permId
+ " AND (m_status != 'Filled' OR m_commission IS NULL);",
"UPDATE `orders` SET"
+ " submitted_time_long = UNIX_TIMESTAMP() * 1000"
+ " WHERE m_permId = " + order.m_permId
+ " AND submitted_time_long IS NULL;");
}
开发者ID:AnyObject,项目名称:OAT,代码行数:54,代码来源:TradingSchema.java
示例20: openOrder
import com.ib.client.OrderState; //导入依赖的package包/类
@Override
public void openOrder(int orderId, Contract contract, Order order, OrderState orderState) {
}
开发者ID:curtiszimmerman,项目名称:AlgoTrader,代码行数:4,代码来源:IBDefaultAdapter.java
注:本文中的com.ib.client.OrderState类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论