new MarketDepth(params)
Plug-in that adds a market depth plot and order book to the chart. Shows the volume of bids and asks.
See CIQ.ChartEngine#updateCurrentMarketData for data requirements.
Market Depth can be toggled using the Ctrl+Alt+D keystroke combination and L2 Heat Map using
the Ctrl+Alt+H keystroke combination (see the marketDepth and l2HeatMap actions in
hotkeyConfig.hotkeys in js/defaultConfiguration.js).
To enable this plug-in in examples/templated/sample-template-advanced.html or webpack-example/src/sample-template-webpack.js, search for "activetrader" and "Simulate L2 data" and uncomment the relevant markup or code. The templates can also serve as references for creating your own UI for this module.
Once you have created a CIQ.MarketDepth instance, use the
display function to add or remove the market depth plot
from the chart. See example.
For details on how to render a stand-alone market depth chart see CIQ.ChartEngine#drawMarketDepth.
Figure. Chart with market depth plot and order book.
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object | Configuration parameters. Properties
|
- Since:
-
- 6.1.0
- 6.2.0 Added
recordparameter. - 6.3.0 Added
heatmapSizeandheadsUpparameters. - 7.0.0 Added
heatmapBlockHeightparameter. - 8.2.1 Added
allowUIZoomparameter. - 8.4.0 Renamed
allowUIZoomparameter tointeraction.
Example
// Instantiate a market depth plot with default parameters.
new CIQ.MarketDepth({ stx: stxx });
// Display the market depth plot.
stxx.marketDepth.display(true);
// or
stxx.layout.marketDepth = true;
stxx.changeOccurred("layout");
// Hide the market depth plot.
stxx.marketDepth.display(false);
// or
stxx.layout.marketDepth = false;
stxx.changeOccurred("layout");
Methods
-
display(on)
-
Shows and hides the market depth plot.
Parameters:
Name Type Description onboolean If true, displays the market depth plot; if false, hides the plot.
