Tabnine Logo
BuyOrderPlaced
Code IndexAdd Tabnine to your IDE (free)

How to use
BuyOrderPlaced
in
co.vaughnvernon.nanotrader.domain.model.order

Best Java code snippets using co.vaughnvernon.nanotrader.domain.model.order.BuyOrderPlaced (Showing top 4 results out of 315)

origin: VaughnVernon/IDDD_NYSE

public BuyOrderPlaced(
    AccountId anAccountId,
    OrderId anOrderId,
    Quote aQuote,
    int aQuantityOfSharesOrdered,
    Date aPlacedOnDate,
    Money aCost,
    Money anOrderFee) {
  super();
  this.setAccountId(anAccountId);
  this.setCost(aCost);
  this.setOccurredOn(new Date());
  this.setOrderFee(anOrderFee);
  this.setOrderId(anOrderId);
  this.setPlacedOnDate(aPlacedOnDate);
  this.setQuantityOfSharesOrdered(aQuantityOfSharesOrdered);
  this.setQuote(aQuote);
}
origin: VaughnVernon/IDDD_NYSE

@Override
public void handleEvent(BuyOrderPlaced aDomainEvent) {
  reconcilableAccount.reconcileWith(
      new Payment(
          aDomainEvent.accountId(),
          aDomainEvent.orderId(),
          "BUY: "
              + aDomainEvent.quantityOfSharesOrdered()
              + " of "
              + aDomainEvent.quote().tickerSymbol()
              + " at "
              + aDomainEvent.quote().price(),
          aDomainEvent.cost(),
          aDomainEvent.orderFee(),
          aDomainEvent.placedOnDate()));
}
origin: VaughnVernon/IDDD_NYSE

public void testPlaceBuyOrder() throws Exception {
  DomainEventPublisher.instance().subscribe(new DomainEventSubscriber<BuyOrderPlaced>() {
    @Override
    public void handleEvent(BuyOrderPlaced aDomainEvent) {
      buyOrderPlaced = aDomainEvent;
    }
    @Override
    public Class<BuyOrderPlaced> subscribedToEventType() {
      return BuyOrderPlaced.class;
    }
  });
  BuyOrder buyOrder = this.buyOrderFixture(); // event published here
  assertNotNull(buyOrderPlaced);
  assertEquals(new Money("9.99"), buyOrderPlaced.orderFee());
  assertEquals(NUMBER_OF_SHARES, buyOrderPlaced.quantityOfSharesOrdered());
  assertEquals(PRICE, buyOrderPlaced.quote().price());
  assertEquals(TICKER, buyOrderPlaced.quote().tickerSymbol().symbol());
  assertEquals(PRICE.multipliedBy(NUMBER_OF_SHARES), buyOrder.valueOfOrderedShares());
  assertEquals(buyOrder.accountId(), buyOrderPlaced.accountId());
  assertEquals(buyOrder.orderId(), buyOrderPlaced.orderId());
  assertEquals(buyOrder.quantityOfSharesOrdered(), buyOrderPlaced.quantityOfSharesOrdered());
  assertEquals(buyOrder.quote(), buyOrderPlaced.quote());
}
origin: VaughnVernon/IDDD_NYSE

public BuyOrder(
    AccountId anAccountId,
    Quote aQuote,
    int aQuantityOfSharesOrdered,
    Money anOrderFee) {
  super();
  this.setAccountId(anAccountId);
  this.setExecution(new PurchaseExecution(aQuantityOfSharesOrdered));
  this.setOrderId(OrderId.unique());
  this.setQuote(aQuote);
  DomainEventPublisher.instance().publish(
      new BuyOrderPlaced(
          this.accountId(),
          this.orderId(),
          this.quote(),
          this.execution().quantityOfSharesOrdered(),
          this.execution().openDate(),
          aQuote.price().multipliedBy(aQuantityOfSharesOrdered),
          anOrderFee));
}
co.vaughnvernon.nanotrader.domain.model.orderBuyOrderPlaced

Most used methods

  • <init>
  • accountId
  • cost
  • orderFee
  • orderId
  • placedOnDate
  • quantityOfSharesOrdered
  • quote
  • setAccountId
  • setCost
  • setOccurredOn
  • setOrderFee
  • setOccurredOn,
  • setOrderFee,
  • setOrderId,
  • setPlacedOnDate,
  • setQuantityOfSharesOrdered,
  • setQuote

Popular in Java

  • Making http requests using okhttp
  • onCreateOptionsMenu (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSupportFragmentManager (FragmentActivity)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Path (java.nio.file)
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now