本文整理汇总了Java中quickfix.field.OrdStatus.PENDING_NEW属性的典型用法代码示例。如果您正苦于以下问题:Java OrdStatus.PENDING_NEW属性的具体用法?Java OrdStatus.PENDING_NEW怎么用?Java OrdStatus.PENDING_NEW使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类quickfix.field.OrdStatus
的用法示例。
在下文中一共展示了OrdStatus.PENDING_NEW属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStatus
public static Status getStatus(OrdStatus ordStatus, CumQty cumQty) {
if (ordStatus.getValue() == OrdStatus.NEW || ordStatus.getValue() == OrdStatus.PENDING_NEW) {
return Status.SUBMITTED;
} else if (ordStatus.getValue() == OrdStatus.PARTIALLY_FILLED) {
return Status.PARTIALLY_EXECUTED;
} else if (ordStatus.getValue() == OrdStatus.FILLED) {
return Status.EXECUTED;
} else if (ordStatus.getValue() == OrdStatus.CANCELED || ordStatus.getValue() == OrdStatus.PENDING_CANCEL || ordStatus.getValue() == OrdStatus.REJECTED) {
return Status.CANCELED;
} else if (ordStatus.getValue() == OrdStatus.REPLACED || ordStatus.getValue() == OrdStatus.PENDING_REPLACE) {
if (cumQty.getValue() == 0) {
return Status.SUBMITTED;
} else {
return Status.PARTIALLY_EXECUTED;
}
} else {
throw new IllegalArgumentException("unknown orderStatus " + ordStatus.getValue());
}
}
示例2: createExecutionReport
private quickfix.fix44.ExecutionReport createExecutionReport(
quickfix.fix44.NewOrderSingle order) throws FieldNotFound {
quickfix.fix44.ExecutionReport execReport = new ExecutionReport(new OrderID("ORD_" + currentOrdId++),
new ExecID("EXEC_" + currentExecId++),
new ExecType(ExecType.NEW),
new OrdStatus(OrdStatus.PENDING_NEW),
new Side(order.getSide().getValue()),
new LeavesQty(0.0),
new CumQty(0.0),
new AvgPx(order.getPrice().getValue()));
execReport.set(order.getClOrdID());
execReport.set(order.getAccount());
execReport.set(order.getOrderQty());
execReport.set(order.getPrice());
execReport.set(order.getOrdType());
execReport.set(order.getSymbol());
return execReport;
}