Class OrderBlockL2

java.lang.Object
org.drip.oms.depth.OrderBlockL2

public class OrderBlockL2
extends java.lang.Object
OrderBlockL2 maintains a Deep Price Book for a Venue. The References are:

  • Chen, J. (2021): Time in Force: Definition, Types, and Examples https://www.investopedia.com/terms/t/timeinforce.asp
  • Cont, R., and A. Kukanov (2017): Optimal Order Placement in Limit Order Markets Quantitative Finance 17 (1) 21-39
  • Vassilis, P. (2005b): Slow and Fast Markets Journal of Economics and Business 57 (6) 576-593
  • Weiss, D. (2006): After the Trade is Made: Processing Securities Transactions Portfolio Publishing London UK
  • Wikipedia (2023): Central Limit Order Book https://en.wikipedia.org/wiki/Central_limit_order_book


Author:
Lakshmi Krishnamurthy
  • Constructor Summary

    Constructors
    Constructor Description
    OrderBlockL2​(boolean descending)
    OrderBlockL2 Constructor
  • Method Summary

    Modifier and Type Method Description
    boolean addBlock​(OrderBlock postedBlock)
    Add a Posted Block to the Price Book
    static OrderBlockL2 Ask()
    Construct an Ask OrderBlockL2 Price Book
    static OrderBlockL2 Bid()
    Construct a Bid OrderBlockL2 Price Book
    boolean descending()
    Retrieve the Ascending/Descending Flag
    java.util.TreeMap<java.lang.Double,​OrderBlock> orderedBlockMap()
    Retrieve the Ordered Block Map
    OrderBlock topOfTheBook()
    Retrieve the Top of the Book

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OrderBlockL2

      public OrderBlockL2​(boolean descending) throws java.lang.Exception
      OrderBlockL2 Constructor
      Parameters:
      descending - TRUE - Price Book is in Descending Order
      Throws:
      java.lang.Exception - Thrown if OrderBlockL2 cannot be constructed
  • Method Details

    • Bid

      public static final OrderBlockL2 Bid()
      Construct a Bid OrderBlockL2 Price Book
      Returns:
      Bid OrderBlockL2 Price Book
    • Ask

      public static final OrderBlockL2 Ask()
      Construct an Ask OrderBlockL2 Price Book
      Returns:
      Ask OrderBlockL2 Price Book
    • orderedBlockMap

      public java.util.TreeMap<java.lang.Double,​OrderBlock> orderedBlockMap()
      Retrieve the Ordered Block Map
      Returns:
      Ordered Block Map
    • descending

      public boolean descending()
      Retrieve the Ascending/Descending Flag
      Returns:
      TRUE - Price Book is in Descending Order
    • addBlock

      public boolean addBlock​(OrderBlock postedBlock)
      Add a Posted Block to the Price Book
      Parameters:
      postedBlock - The Posted Block to be added
      Returns:
      The Posted Block successfully added to the L2 Price Book
    • topOfTheBook

      public OrderBlock topOfTheBook()
      Retrieve the Top of the Book
      Returns:
      Top of the Book