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


Java Order.action方法代码示例

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


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

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

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

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

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

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

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

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

示例8: Volatility

import com.ib.client.Order; //导入方法依赖的package包/类
public static Order Volatility(String action, double quantity, double volatilityPercent, int volatilityType) {
	// ! [volatility]
	Order order = new Order();
	order.action(action);
	order.orderType("VOL");
	order.volatility(volatilityPercent);//Expressed in percentage (40%)
	order.volatilityType(volatilityType);// 1=daily, 2=annual
	order.totalQuantity(quantity);
	// ! [volatility]
	return order;
}
 
开发者ID:qerio,项目名称:goib,代码行数:12,代码来源:OrderSamples.java

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

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

示例11: RelativeMarketCombo

import com.ib.client.Order; //导入方法依赖的package包/类
public static Order RelativeMarketCombo(String action, double quantity, boolean nonGuaranteed) {
	// ! [relativemarketcombo]
	Order order = new Order();
	order.action(action);
	order.orderType("REL + MKT");
	order.totalQuantity(quantity);
	if (nonGuaranteed)
	{
		List<TagValue> smartComboRoutingParams = new ArrayList<TagValue>();
		smartComboRoutingParams.add(new TagValue("NonGuaranteed", "1"));
	}
	// ! [relativemarketcombo]
	return order;
}
 
开发者ID:qerio,项目名称:goib,代码行数:15,代码来源:OrderSamples.java

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

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

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


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