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


Java Order.orderType方法代码示例

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


在下文中一共展示了Order.orderType方法的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: 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

示例3: MarketWithProtection

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

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

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

示例6: ComboMarketOrder

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

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

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

示例9: MarketToLimit

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

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

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

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

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

示例14: AuctionPeggedToStock

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

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


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