co.vaughnvernon.tradercommon.quote.Quote.quantity()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(121)

本文整理了Java中co.vaughnvernon.tradercommon.quote.Quote.quantity方法的一些代码示例,展示了Quote.quantity的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Quote.quantity方法的具体详情如下:
包路径:co.vaughnvernon.tradercommon.quote.Quote
类名称:Quote
方法名:quantity

Quote.quantity介绍

暂无

代码示例

代码示例来源:origin: VaughnVernon/IDDD_NYSE

public AlgoOrder(
    String anOrderId,
    OrderType aType,
    Quote aQuote) {
  super();
  if (aQuote.quantity() < 500) {
    throw new IllegalArgumentException("Cannot be less than 500 shares.");
  }
  this.setOrderId(anOrderId);
  this.setType(aType);
  this.setQuote(aQuote);
  this.setSharesRemaining(new BigDecimal(aQuote.quantity()));
}

代码示例来源:origin: VaughnVernon/IDDD_NYSE

@Override
public boolean equals(Object anObject) {
  boolean equalObjects = false;
  if (anObject != null && this.getClass() == anObject.getClass()) {
    Quote typedObject = (Quote) anObject;
    equalObjects =
        this.tickerSymbol().equals(typedObject.tickerSymbol()) &&
        this.price().equals(typedObject.price()) &&
        this.quantity() == typedObject.quantity();
  }
  return equalObjects;
}

代码示例来源:origin: VaughnVernon/IDDD_NYSE

@Override
public int hashCode() {
  int hashCodeValue =
      + (75931 * 41)
      + this.tickerSymbol().hashCode()
      + this.price().hashCode()
      + this.quantity();
  return hashCodeValue;
}

代码示例来源:origin: VaughnVernon/IDDD_NYSE

private void filled() {
  if (this.isFilled()) {
    throw new IllegalStateException("Algo order is already filled.");
  }
  if (this.hasSharesRemaining()) {
    throw new IllegalStateException("Algo order is not yet filled.");
  }
  this.setFill(
      new Fill(
          this.quote().price(),
          new BigDecimal(this.quote().quantity()),
          new Date()));
  DomainEventPublisher
    .instance()
    .publish(new AlgoOrderFilled(
        this.orderId(),
        this.type().name(),
        this.quote()));
}

代码示例来源:origin: VaughnVernon/IDDD_NYSE

int totalQuantity = this.algoOrder.quote().quantity();

代码示例来源:origin: VaughnVernon/IDDD_NYSE

assertEquals(algoOrder.quote().quantity(), algoOrder.fill().quantity().intValue());
assertNotNull(algoOrder.fill().filledOn());

相关文章