本文整理汇总了Java中com.ib.client.Order.triggerPrice方法的典型用法代码示例。如果您正苦于以下问题:Java Order.triggerPrice方法的具体用法?Java Order.triggerPrice怎么用?Java Order.triggerPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ib.client.Order
的用法示例。
在下文中一共展示了Order.triggerPrice方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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;
}