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


Java Order.lmtPrice方法代码示例

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


在下文中一共展示了Order.lmtPrice方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AtAuction

import com.ib.client.Order; //导入方法依赖的package包/类
public static Order AtAuction(String action, double quantity, double price) {
	//! [auction]
	Order order = new Order();
	order.action(action);
	order.tif("AUC");
	order.orderType("MTL");
	order.totalQuantity(quantity);
	order.lmtPrice(price);
	//! [auction]
	return order;
}
 
开发者ID:qerio,项目名称:goib,代码行数:12,代码来源:OrderSamples.java

示例2: Discretionary

import com.ib.client.Order; //导入方法依赖的package包/类
public static Order Discretionary(String action, double quantity, double price, double discretionaryAmt) {
	//! [discretionary]
	Order order = new Order();
	order.action(action);
	order.orderType("LMT");
	order.totalQuantity(quantity);
	order.lmtPrice(price);
	order.discretionaryAmt(discretionaryAmt);
	//! [discretionary]
	return order;
}
 
开发者ID:qerio,项目名称:goib,代码行数:12,代码来源:OrderSamples.java

示例3: PeggedToStock

import com.ib.client.Order; //导入方法依赖的package包/类
public static Order PeggedToStock(String action, double quantity, double delta, double stockReferencePrice, double startingPrice) {
	//! [pegged_stock]
	Order order = new Order();
	order.action(action);
	order.orderType("PEG STK");
	order.totalQuantity(quantity);
	order.delta(delta);
	order.lmtPrice(stockReferencePrice);
	order.startingPrice(startingPrice);
	//! [pegged_stock]
	return order;
}
 
开发者ID:qerio,项目名称:goib,代码行数:13,代码来源:OrderSamples.java

示例4: RelativePeggedToPrimary

import com.ib.client.Order; //导入方法依赖的package包/类
public static Order RelativePeggedToPrimary(String action, double quantity, double priceCap, double offsetAmount) {
	//! [relative_pegged_primary]
	Order order = new Order();
	order.action(action);
	order.orderType("REL");
	order.totalQuantity(quantity);
	order.lmtPrice(priceCap);
	order.auxPrice(offsetAmount);
	//! [relative_pegged_primary]
	return order;
}
 
开发者ID:qerio,项目名称:goib,代码行数:12,代码来源:OrderSamples.java

示例5: SweepToFill

import com.ib.client.Order; //导入方法依赖的package包/类
public static Order SweepToFill(String action, double quantity, double price) {
	//! [sweep_to_fill]
	Order order = new Order();
	order.action(action);
	order.orderType("LMT");
	order.totalQuantity(quantity);
	order.lmtPrice(price);
	order.sweepToFill(true);
	//! [sweep_to_fill]
	return order;
}
 
开发者ID:qerio,项目名称:goib,代码行数:12,代码来源:OrderSamples.java

示例6: AuctionLimit

import com.ib.client.Order; //导入方法依赖的package包/类
public static Order AuctionLimit(String action, double quantity, double price, int auctionStrategy) {
	//! [auction_limit]
	Order order = new Order();
	order.action(action);
	order.orderType("LMT");
	order.totalQuantity(quantity);
	order.lmtPrice(price);
	order.auctionStrategy(auctionStrategy);
	//! [auction_limit]
	return order;
}
 
开发者ID:qerio,项目名称:goib,代码行数:12,代码来源:OrderSamples.java

示例7: Block

import com.ib.client.Order; //导入方法依赖的package包/类
public static Order Block(String action, double quantity, double price) {
	// ! [block]
	Order order = new Order();
	order.action(action);
	order.orderType("LMT");
	order.totalQuantity(quantity);//Large volumes!
	order.lmtPrice(price);
	order.blockOrder(true);
	// ! [block]
	return order;
}
 
开发者ID:qerio,项目名称:goib,代码行数:12,代码来源:OrderSamples.java

示例8: LimitOrder

import com.ib.client.Order; //导入方法依赖的package包/类
public static Order LimitOrder(String action, double quantity, double limitPrice) {
	// ! [limitorder]
	Order order = new Order();
	order.action(action);
	order.orderType("LMT");
	order.totalQuantity(quantity);
	order.lmtPrice(limitPrice);
	// ! [limitorder]
	return order;
}
 
开发者ID:qerio,项目名称:goib,代码行数:11,代码来源:OrderSamples.java

示例9: LimitIfTouched

import com.ib.client.Order; //导入方法依赖的package包/类
public static Order LimitIfTouched(String action, double quantity, double limitPrice, double triggerPrice) {
	// ! [limitiftouched]
	Order order = new Order();
	order.action(action);
	order.orderType("LIT");
	order.totalQuantity(quantity);
	order.lmtPrice(limitPrice);
	order.auxPrice(triggerPrice);
	// ! [limitiftouched]
	return order;
}
 
开发者ID:qerio,项目名称:goib,代码行数:12,代码来源:OrderSamples.java

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

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

示例12: 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

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

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

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


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