本文整理汇总了Java中com.ib.client.Order.totalQuantity方法的典型用法代码示例。如果您正苦于以下问题:Java Order.totalQuantity方法的具体用法?Java Order.totalQuantity怎么用?Java Order.totalQuantity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ib.client.Order
的用法示例。
在下文中一共展示了Order.totalQuantity方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onAttachOrder
import com.ib.client.Order; //导入方法依赖的package包/类
protected void onAttachOrder() {
OrderRow row = getSelectedOrder();
if (row != null) {
Order parent = row.m_order;
Order child = new Order();
child.parentId( parent.orderId() );
child.action( parent.action() );
child.totalQuantity( parent.totalQuantity() );
child.orderType( OrderType.TRAIL);
child.auxPrice( 1);
TicketDlg dlg = new TicketDlg( row.m_contract.clone(), child);
dlg.setVisible( true);
}
}
示例2: getValueAt
import com.ib.client.Order; //导入方法依赖的package包/类
@Override public Object getValueAt(int row, int col) {
OrderRow fullOrder = m_orders.get( row);
Order order = fullOrder.m_order;
switch( col) {
case 0: return order.permId();
case 1: return order.clientId();
case 2: return order.orderId();
case 3: return order.account();
case 4: return order.modelCode();
case 5: return order.action();
case 6: return order.totalQuantity();
case 7: return fullOrder.m_contract.description();
case 8: return fullOrder.m_state.status();
default: return null;
}
}
示例3: LimitOrderForComboWithLegPrices
import com.ib.client.Order; //导入方法依赖的package包/类
public static Order LimitOrderForComboWithLegPrices(String action, double quantity, boolean nonGuaranteed, double[] legPrices) {
// ! [limitordercombolegprices]
Order order = new Order();
order.action(action);
order.orderType("LMT");
order.totalQuantity(quantity);
order.orderComboLegs(new ArrayList<OrderComboLeg>());
for(double price : legPrices) {
OrderComboLeg comboLeg = new OrderComboLeg();
comboLeg.price(5.0);
order.orderComboLegs().add(comboLeg);
}
if (nonGuaranteed)
{
List<TagValue> smartComboRoutingParams = new ArrayList<TagValue>();
smartComboRoutingParams.add(new TagValue("NonGuaranteed", "1"));
}
// ! [limitordercombolegprices]
return order;
}
示例4: AttachAdjustableToStopLimit
import com.ib.client.Order; //导入方法依赖的package包/类
public static Order AttachAdjustableToStopLimit(Order parent, double attachedOrderStopPrice, double triggerPrice, double adjustStopPrice, double adjustedStopLimitPrice) {
//! [adjustable_stop_limit]
Order order = new Order();
//Attached order is a conventional STP order
order.action(parent.action().equals("BUY") ? "SELL" : "BUY");
order.totalQuantity(parent.totalQuantity());
order.auxPrice(attachedOrderStopPrice);
order.parentId(parent.orderId());
//When trigger price is penetrated
order.triggerPrice(triggerPrice);
//The parent order will be turned into a STP LMT order
order.adjustedOrderType(OrderType.STP_LMT);
//With the given stop price
order.adjustedStopPrice(adjustStopPrice);
//And the given limit price
order.adjustedStopLimitPrice(adjustedStopLimitPrice);
//! [adjustable_stop_limit]
return order;
}
示例5: RelativeLimitCombo
import com.ib.client.Order; //导入方法依赖的package包/类
public static Order RelativeLimitCombo(String action, double quantity, boolean nonGuaranteed, double limitPrice) {
// ! [relativelimitcombo]
Order order = new Order();
order.action(action);
order.orderType("REL + LMT");
order.totalQuantity(quantity);
order.lmtPrice(limitPrice);
if (nonGuaranteed)
{
List<TagValue> smartComboRoutingParams = new ArrayList<TagValue>();
smartComboRoutingParams.add(new TagValue("NonGuaranteed", "1"));
}
// ! [relativelimitcombo]
return order;
}
示例6: onPlaceOrder
import com.ib.client.Order; //导入方法依赖的package包/类
protected void onPlaceOrder() {
Order o = new Order();
o.totalQuantity( 1);
Contract c = getComboContractFromLegs();
TicketDlg dlg = new TicketDlg( c, o);
dlg.setVisible( true);
}
示例7: LimitOnClose
import com.ib.client.Order; //导入方法依赖的package包/类
public static Order LimitOnClose(String action, double quantity, double limitPrice) {
// ! [limitonclose]
Order order = new Order();
order.action(action);
order.orderType("LOC");
order.totalQuantity(quantity);
order.lmtPrice(limitPrice);
// ! [limitonclose]
return order;
}
示例8: PassiveRelative
import com.ib.client.Order; //导入方法依赖的package包/类
public static Order PassiveRelative(String action, double quantity, double offset) {
// ! [passive_relative]
Order order = new Order();
order.action(action);
order.orderType("PASSV REL");
order.totalQuantity(quantity);
order.auxPrice(offset);
// ! [passive_relative]
return order;
}
示例9: StopLimit
import com.ib.client.Order; //导入方法依赖的package包/类
public static Order StopLimit(String action, double quantity, double limitPrice, double stopPrice) {
// ! [stoplimit]
Order order = new Order();
order.action(action);
order.orderType("STP LMT");
order.lmtPrice(limitPrice);
order.auxPrice(stopPrice);
order.totalQuantity(quantity);
// ! [stoplimit]
return order;
}
示例10: MarketIfTouched
import com.ib.client.Order; //导入方法依赖的package包/类
public static Order MarketIfTouched(String action, double quantity, double price) {
//! [market_if_touched]
Order order = new Order();
order.action(action);
order.orderType("MIT");
order.totalQuantity(quantity);
order.auxPrice(price);
//! [market_if_touched]
return order;
}
示例11: MidpointMatch
import com.ib.client.Order; //导入方法依赖的package包/类
public static Order MidpointMatch(String action, double quantity) {
//! [midpoint_match]
Order order = new Order();
order.action(action);
order.orderType("MKT");
order.totalQuantity(quantity);
//! [midpoint_match]
return order;
}
示例12: TrailingStopLimit
import com.ib.client.Order; //导入方法依赖的package包/类
public static Order TrailingStopLimit(String action, double quantity, double trailingAmount, double trailStopPrice, double limitPrice) {
// ! [trailingstoplimit]
Order order = new Order();
order.action(action);
order.orderType("TRAIL LIMIT");
order.lmtPrice(limitPrice);
order.auxPrice(trailingAmount);
order.trailStopPrice(trailStopPrice);
order.totalQuantity(quantity);
// ! [trailingstoplimit]
return order;
}
示例13: Stop
import com.ib.client.Order; //导入方法依赖的package包/类
public static Order Stop(String action, double quantity, double stopPrice) {
// ! [stop]
Order order = new Order();
order.action(action);
order.orderType("STP");
order.auxPrice(stopPrice);
order.totalQuantity(quantity);
// ! [stop]
return order;
}
示例14: ComboLimitOrder
import com.ib.client.Order; //导入方法依赖的package包/类
public static Order ComboLimitOrder(String action, double quantity, boolean nonGuaranteed, double limitPrice) {
// ! [combolimit]
Order order = new Order();
order.action(action);
order.orderType("LMT");
order.lmtPrice(limitPrice);
order.totalQuantity(quantity);
if (nonGuaranteed)
{
List<TagValue> smartComboRoutingParams = new ArrayList<TagValue>();
smartComboRoutingParams.add(new TagValue("NonGuaranteed", "1"));
}
// ! [combolimit]
return order;
}
示例15: LimitOnOpen
import com.ib.client.Order; //导入方法依赖的package包/类
public static Order LimitOnOpen(String action, double quantity, double limitPrice) {
// ! [limitonopen]
Order order = new Order();
order.action(action);
order.tif("OPG");
order.orderType("LOC");
order.totalQuantity(quantity);
order.lmtPrice(limitPrice);
// ! [limitonopen]
return order;
}