当前位置: 首页>>代码示例>>Java>>正文


Java Order.parentId方法代码示例

本文整理汇总了Java中com.ib.client.Order.parentId方法的典型用法代码示例。如果您正苦于以下问题:Java Order.parentId方法的具体用法?Java Order.parentId怎么用?Java Order.parentId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.ib.client.Order的用法示例。


在下文中一共展示了Order.parentId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
	}
}
 
开发者ID:qerio,项目名称:goib,代码行数:17,代码来源:OrdersPanel.java

示例2: AttachAdjustableToStop

import com.ib.client.Order; //导入方法依赖的package包/类
public static Order AttachAdjustableToStop(Order parent, double attachedOrderStopPrice, double triggerPrice, double adjustStopPrice) {
    //! [adjustable_stop]
    Order order = new Order();
    //Attached order is a conventional STP order in opposite direction
    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 order
    order.adjustedOrderType(OrderType.STP);
    //With the given STP price
    order.adjustedStopPrice(adjustStopPrice);
    //! [adjustable_stop]
    return order;
}
 
开发者ID:qerio,项目名称:goib,代码行数:18,代码来源:OrderSamples.java

示例3: 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;
}
 
开发者ID:qerio,项目名称:goib,代码行数:20,代码来源:OrderSamples.java

示例4: AttachAdjustableToTrail

import com.ib.client.Order; //导入方法依赖的package包/类
public static Order AttachAdjustableToTrail(Order parent, double attachedOrderStopPrice, double triggerPrice, double adjustStopPrice, double adjustedTrailAmount, int trailUnit) {
	//! [adjustable_trail]
    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 TRAIL order
    order.adjustedOrderType(OrderType.TRAIL);
    //With a stop price of...
    order.adjustedStopPrice(adjustStopPrice);
    //traling by and amount (0) or a percent (1)...
    order.adjustableTrailingUnit(trailUnit);
    //of...
    order.adjustedTrailingAmount(adjustedTrailAmount);
    //! [adjustable_trail]
    return order;
}
 
开发者ID:qerio,项目名称:goib,代码行数:22,代码来源:OrderSamples.java

示例5: BracketOrder

import com.ib.client.Order; //导入方法依赖的package包/类
public static List<Order> BracketOrder(int parentOrderId, String action, double quantity, double limitPrice, double takeProfitLimitPrice, double stopLossPrice) {
	//This will be our main or "parent" order
	Order parent = new Order();
	parent.orderId(parentOrderId);
	parent.action(action);
	parent.orderType("LMT");
	parent.totalQuantity(quantity);
	parent.lmtPrice(limitPrice);
	//The parent and children orders will need this attribute set to false to prevent accidental executions.
       //The LAST CHILD will have it set to true.
	parent.transmit(false);
	
	Order takeProfit = new Order();
	takeProfit.orderId(parent.orderId() + 1);
	takeProfit.action(action.equals("BUY") ? "SELL" : "BUY");
	takeProfit.orderType("LMT");
	takeProfit.totalQuantity(quantity);
	takeProfit.lmtPrice(takeProfitLimitPrice);
	takeProfit.parentId(parentOrderId);
	takeProfit.transmit(false);
	
	Order stopLoss = new Order();
	stopLoss.orderId(parent.orderId() + 2);
	stopLoss.action(action.equals("BUY") ? "SELL" : "BUY");
	stopLoss.orderType("STP");
	//Stop trigger price
	stopLoss.auxPrice(stopLossPrice);
	stopLoss.totalQuantity(quantity);
	stopLoss.parentId(parentOrderId);
	//In this case, the low side order will be the last child being sent. Therefore, it needs to set this attribute to true 
       //to activate all its predecessors
	stopLoss.transmit(true);
	
	List<Order> bracketOrder = new ArrayList<Order>();
	bracketOrder.add(parent);
	bracketOrder.add(takeProfit);
	bracketOrder.add(stopLoss);
	
	return bracketOrder;
}
 
开发者ID:qerio,项目名称:goib,代码行数:41,代码来源:OrderSamples.java

示例6: MarketFHedge

import com.ib.client.Order; //导入方法依赖的package包/类
public static Order MarketFHedge(int parentOrderId, String action) {
	//FX Hedge orders can only have a quantity of 0
	Order order = MarketOrder(action, 0);
	order.parentId(parentOrderId);
	order.hedgeType("F");
	return order;
}
 
开发者ID:qerio,项目名称:goib,代码行数:8,代码来源:OrderSamples.java

示例7: copyExtendedOrderDetails

import com.ib.client.Order; //导入方法依赖的package包/类
private static void copyExtendedOrderDetails( Order destOrder, Order srcOrder) {
    destOrder.tif(srcOrder.getTif());
    destOrder.activeStartTime(srcOrder.activeStartTime());
    destOrder.activeStopTime(srcOrder.activeStopTime());
    destOrder.ocaGroup(srcOrder.ocaGroup());
    destOrder.ocaType(srcOrder.getOcaType());
    destOrder.openClose(srcOrder.openClose());
    destOrder.origin(srcOrder.origin());
    destOrder.orderRef(srcOrder.orderRef());
    destOrder.transmit(srcOrder.transmit());
    destOrder.parentId(srcOrder.parentId());
    destOrder.blockOrder(srcOrder.blockOrder());
    destOrder.sweepToFill(srcOrder.sweepToFill());
    destOrder.displaySize(srcOrder.displaySize());
    destOrder.triggerMethod(srcOrder.getTriggerMethod());
    destOrder.outsideRth(srcOrder.outsideRth());
    destOrder.hidden(srcOrder.hidden());
    destOrder.discretionaryAmt(srcOrder.discretionaryAmt());
    destOrder.goodAfterTime(srcOrder.goodAfterTime());
    destOrder.shortSaleSlot(srcOrder.shortSaleSlot());
    destOrder.designatedLocation(srcOrder.designatedLocation());
    destOrder.exemptCode(srcOrder.exemptCode());
    destOrder.ocaType(srcOrder.getOcaType());
    destOrder.rule80A(srcOrder.getRule80A());
    destOrder.allOrNone(srcOrder.allOrNone());
    destOrder.minQty(srcOrder.minQty());
    destOrder.percentOffset(srcOrder.percentOffset());
    destOrder.eTradeOnly(srcOrder.eTradeOnly());
    destOrder.firmQuoteOnly(srcOrder.firmQuoteOnly());
    destOrder.nbboPriceCap(srcOrder.nbboPriceCap());
    destOrder.optOutSmartRouting(srcOrder.optOutSmartRouting());
    destOrder.auctionStrategy(srcOrder.auctionStrategy());
    destOrder.startingPrice(srcOrder.startingPrice());
    destOrder.stockRefPrice(srcOrder.stockRefPrice());
    destOrder.delta(srcOrder.delta());
    destOrder.stockRangeLower(srcOrder.stockRangeLower());
    destOrder.stockRangeUpper(srcOrder.stockRangeUpper());
    destOrder.overridePercentageConstraints(srcOrder.overridePercentageConstraints());
    destOrder.volatility(srcOrder.volatility());
    destOrder.volatilityType(srcOrder.getVolatilityType());
    destOrder.deltaNeutralOrderType(srcOrder.getDeltaNeutralOrderType());
    destOrder.deltaNeutralAuxPrice(srcOrder.deltaNeutralAuxPrice());
    destOrder.deltaNeutralConId(srcOrder.deltaNeutralConId());
    destOrder.deltaNeutralSettlingFirm(srcOrder.deltaNeutralSettlingFirm());
    destOrder.deltaNeutralClearingAccount(srcOrder.deltaNeutralClearingAccount());
    destOrder.deltaNeutralClearingIntent(srcOrder.deltaNeutralClearingIntent());
    destOrder.deltaNeutralOpenClose(srcOrder.deltaNeutralOpenClose());
    destOrder.deltaNeutralShortSale(srcOrder.deltaNeutralShortSale());
    destOrder.deltaNeutralShortSaleSlot(srcOrder.deltaNeutralShortSaleSlot());
    destOrder.deltaNeutralDesignatedLocation(srcOrder.deltaNeutralDesignatedLocation());
    destOrder.continuousUpdate(srcOrder.continuousUpdate());
    destOrder.referencePriceType(srcOrder.getReferencePriceType());
    destOrder.trailStopPrice(srcOrder.trailStopPrice());
    destOrder.trailingPercent(srcOrder.trailingPercent());
    destOrder.scaleInitLevelSize(srcOrder.scaleInitLevelSize());
    destOrder.scaleSubsLevelSize(srcOrder.scaleSubsLevelSize());
    destOrder.scalePriceIncrement(srcOrder.scalePriceIncrement());
    destOrder.scalePriceAdjustValue(srcOrder.scalePriceAdjustValue());
    destOrder.scalePriceAdjustInterval(srcOrder.scalePriceAdjustInterval());
    destOrder.scaleProfitOffset(srcOrder.scaleProfitOffset());
    destOrder.scaleAutoReset(srcOrder.scaleAutoReset());
    destOrder.scaleInitPosition(srcOrder.scaleInitPosition());
    destOrder.scaleInitFillQty(srcOrder.scaleInitFillQty());
    destOrder.scaleRandomPercent(srcOrder.scaleRandomPercent());
    destOrder.scaleTable(srcOrder.scaleTable());
    destOrder.hedgeType(srcOrder.getHedgeType());
    destOrder.hedgeParam(srcOrder.hedgeParam());
    destOrder.account(srcOrder.account());
    destOrder.modelCode(srcOrder.modelCode());
    destOrder.settlingFirm(srcOrder.settlingFirm());
    destOrder.clearingAccount(srcOrder.clearingAccount());
    destOrder.clearingIntent(srcOrder.clearingIntent());
    destOrder.solicited(srcOrder.solicited());
    destOrder.randomizePrice(srcOrder.randomizePrice());
    destOrder.randomizeSize(srcOrder.randomizeSize());
}
 
开发者ID:qerio,项目名称:goib,代码行数:77,代码来源:SampleFrame.java


注:本文中的com.ib.client.Order.parentId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。