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.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object | Configuration parameters. Properties
|
- Since:
-
- 6.1.0
- 6.2.0 Added
record
parameter. - 6.3.0 Added
heatmapSize
andheadsUp
parameters. - 7.0.0 Added
heatmapBlockHeight
parameter. - 8.2.1 Added
allowUIZoom
parameter. - 8.4.0 Renamed
allowUIZoom
parameter 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");
Members
-
viewRatio :number
-
Market depth chart view ratio. Specifies what fraction of the chart is viewable.
Can be set to any number, but sane values are between 0 and 1.
Type:
- number
- Since:
-
8.2.1
Methods
-
display(on)
-
Shows and hides the market depth plot.
Parameters:
Name Type Description on
boolean If true, displays the market depth plot; if false, hides the plot.