Bookmap API
API modules
There are two main API modules. Initially, they were called Layer Zero (L0) and Layer One (L1), but today L1 is frequently referred just as Bookmap API while L0 is considered its extension. Both modules share share many common interfaces such as trading and market data
Addons API / Bookmap API / Layer One / L1 | Adapters API / Layer Zero / L0 / 'Connect' API | |
---|---|---|
Usage | Development of addons | Development of adapters |
Details | Develop add-ons such as indicators, alerts, trading strategies, etc. Such addons can be used in real time and in replay, and in general don’t depend on data source type (unless it uses a know-how specific for some data source) | Develop adapters that connect Bookmap to additional market data and/or trading services such as digital/crypto exchanges, market data vendors, brokers, order management systems (OMS), etc. |
Extensions | “Intercept / Inject” mode -- override upstream and downstream market data and trading messages. See below some of the use cases.Another extension of this API is a “Simplified” development framework | Quant solution -- Allows to connect Bookmap to a proprietary market data and trading sessions for debriefing, development, real-time monitoring of trading systems. It also includes a collection of useful tools for the quantitative finance industry, especially HFT. Learn more |
Building a sample jar file with multiple demo addons
If you already have git, gradle, and JDK 8+ on your system, you can run the following in a command window:
git clone https://github.com/BookmapAPI/DemoStrategies.git
cd DemoStrategies/Strategies
gradle jar
This will create a jar file in build/libs
which you can import into Bookmap via Settings -> API Plugins -> Add.
Key API features
- Bookmap treats the market data as it is -- a time series of millions of tiny incremental updates distributed in time in an extremely non-uniform frequency. But if you wish to receive the data aggregated into bars/candles, use BarListener interface or simply build them yourself using the Bar class
- Supports full market depth either as Market-by-price (MBP) or Market-by-order (MBO)
- Unique: Ability to backfill recent history of market depth data simply by declaring ‘implements HistoricalDataListener’ in your code.
- Draw indicators on chart or indicators panel with unlimited resolution
- Create custom settings panel or detachable custom windows and widgets with pure Java
Simplicity
Here is a sample code of an addon using the “Simplified” API framework. It’s the entire code of this addon. It doesn’t produce anything except of building a bar/candle, but it receives trades data, full market depth data and manages the order book.
Q&A and notes
- Bookmap supports Windows and MAC. Linux is also supported but less tested.
- Loading an addon is done via Settings -> API Plugins Configuration -> Add. It expects a single jar file each time, but a jar file may contain multiple indicators and trading strategies.
- Multiple simultaneous data connections are supported
How does Bookmap route orders and market data?
Neither orders nor real-time market data travel through Bookmap servers. Bookmap is a front end and connects directly to the target connection using credentials (when relevant) configured by the user.
What types of trading strategies can be developed with Bookmap API?
There are no restrictions. Implement any business logic or complex orders management. However, always be aware of risks, especially those associated with latency. Traders must always consider the worst case scenarios in regards to their orders.
Semi-automatic trading strategies
Bookmap API allows trading strategies to “intercept” and manage / modify orders, sent by the user from the chart. This mode may also appear as “inject” mode. It can be useful, for instance, for randomizing the take-profit & stop-loss distances. Another example is a risk module, Note, however, that Bookmap expects a valid feedback about the status of all orders sent from the chart. It’s the responsibility of such a strategy to provide this feedback.
How to write an addon or adapter in languages other than Java?
You can use all supported by OS interprocess communication methods including web sockets, JNI, etc. However, you can load your own minimalistic Java module that acts as a proxy agent.
The Quant solution
Is an extension to Layer Zero API which allows you to connect Bookmap to your proprietary market data and trading sessions for debriefing, development, compliance management, and monitoring of your trading systems in real time.
Key features of Quant solution include:
- Connect your own market data and orders. Choose between several ways to do it:
- By developing an adapter using L0 API
- By using a jar file called Bookmap Recorder, which creates Bookmap readable bmf files. Since it’s very fast, it can be embedded into simulations without affecting the performance. This allows to review then the results of most interesting simulations with Bookmap in replay mode
- By creating a plain text file in Bookmap readable format
- It’s possible to include and draw thousands of custom signals (each may have thousands of data points) at the adapter level with all the methods above. Alternatively, some of these signals may be computed using regular L1 API Visualization of orders’ place in the queue
- Tools to grab all events from a selected chart area into a separate window or export as a csv file Offline license
Here are several typical use case scenarios:
If you have further questions, please send us an email to support@bookmap.com