Market Depth Historical Graph
- Step by Step Instructions
- Study Inputs
- Block Coloring Logic
- Market Depth Data Time Stamping and Replays
- c_ACSILDepthBars (Programmatically Accessing Market Depth Data) (Opens new page)
The Market Depth Historical Graph study displays at each chart column the highest market depth quantity at each price level, which occurred during the timeframe of the chart bar, as a color-coded rectangle.
The last market depth quantities from the last column currently displayed in the chart are displayed in the space between the last column with market depth data and the right side of the chart. These values will match with the data in File >> Open Market Depth Window.
The study only works with Intraday charts.
The maximum market depth quantity at a price level is only shown at the chart bar during the timeframe it occurred. For subsequent bars, if there has been no market depth update at that price level, the last market depth quantity is displayed until it is deleted by the market depth data stream.
In order for this study to display anything, historical market depth data must be collected for the chart's symbol. Refer to Step by Step Instructions for instructions.
Replaying market depth is also supported simply by using the Chart Replay feature.
Below are examples of the Market Depth Historical Graph study on an Intraday chart:
Step by Step Instructions
- Update Sierra Chart to version 1439 or higher.
- After the update is complete, select Global Settings >> Symbol Settings on the menu.
- Locate the symbol pattern for the Symbol in the list of symbols, that you want to use the Market Depth Historical Graph study with.
- Select the Intraday tab.
- Enable the Record Market Depth Data option.
- Press OK.
- Reconnect to the data feed with File >> Disconnect and File >> Connect to Data Feed after altering the Symbol Settings.
- Go to the chart you want to add the Market Depth Historical Graph study to.
- Select Analysis >> Studies.
- In the list of the Studies Available, select Market Depth Historical Graph.
- Press the Add button.
- Press the Settings button. Set the Study Inputs as required.
- Press OK.
- Press OK.
- As the market depth data starts to be received, you will see the color-coded rectangles on the chart. Sierra Chart will need to be connected to the data feed with File >> Connect to Data Feed and the market needs to be open for the symbol in order to receive market depth data.
Otherwise, there will be no market depth data and you will not see any color-coded rectangles on the chart unless it has been previously recorded for the symbol.
- The market depth data is permanently recorded in depth files. One for each day. These files are located in the MarketDepthData subfolder of the Sierra Chart Data Files Folder. In the case of a Continuous Futures Contract chart, currently only historical market depth data will be displayed for the bars in the chart that are for the current futures contract symbol set with the Chart >> Chart Settings >> Symbol setting.
- To display lines on the chart at the most recent Bid and Ask prices at each chart bar, use the Bid and Ask Prices study. This is an optional study and not required.
This is the maximum intensity color to use for price levels at which the Bid quantity is greater than the Ask quantity.
This should be set to a light color when using a dark background in the chart. The largest visible Bid market depth quantity will use this color.
It is not recommended to make this color the same as the Ask Color. Otherwise, it becomes impossible to distinguish Bid market depth from Ask market depth.
See the Block Coloring Logic section for more details.
This is the maximum intensity color to use for price levels at which the Ask quantity is greater than the Bid quantity.
This should be set to a light color when using a dark background in the chart. The largest visible Ask market depth quantity will use this color.
It is not recommended to make this color the same as the Bid Color. Otherwise, it becomes impossible to distinguish Bid market depth from Ask market depth.
See the Block Coloring Logic section for more details.
Minimum Volume Intensity Percent
This percentage is the intensity used for the blocks with the smallest, non-zero, market depth quantity among all of the visible blocks on the chart. The valid range for this input is 0 to 90.
A greater value for this input will effectively increase the visibility of blocks with little volume, but decrease the overall contrast. Where as a lesser value for this input will increase the contrast between blocks, but decrease the visibility of blocks for smaller market depth quantities. A value of 0 will make it so the blocks with the smallest, non-zero, market depth quantity among all of the visible blocks on the chart will have an intensity of 0 percent, effectively making them the same color as the chart background.
See the Block Coloring Logic section for more details.
Graph Only Quantities Greater Or Equal To
Only depth quantities that are greater than or equal to this value will be displayed on the graph. Any depth quantities below this threshold will be displayed as if they were a quantity of zero. Setting this to 0 will effectively prevent any filtering.
Extend Last Known Depth
When this is set to Yes, the last known market depth quantities will be drawn to extend forward into chart columns where no actual depth quantities are known, up to the right side of the chart, subject to the Percentage Of Fill Space To Display Market Depth Quantity Rectangles In input.
This input only has an effect when market depth data at a price level has been deleted and there has not been a market depth update at that price level at subsequent chart bars.
Show Quantity Numbers
When this is set to Yes, the exact market depth quantities used for the colored blocks are displayed on top of the colored blocks. If there is not enough space within the block to display the full number, the number will be clipped.
Quantity Numbers Color
This is the color that is used for the displayed quantity numbers when the Show Quantitiy Numbers input is set to Yes.
Display Market Depth Last Quantities After Last Bar
When this is set to Yes, the last depth quantities for the last visible bar will be extended from the last bar to the right side of the chart, subject to the Percentage Of Fill Space To Display Market Depth Quantity Rectangles In input.
Note that when the Extend Last Known Depth input is set to Yes, this input has no effect, because all bars, including the last bar, will have their last depth quantities extended.
Percentage Of Fill Space To Display Market Depth Quantity Rectangles In
For any depth quantities that are extended to the right side of the chart, such as from the Extend Last Known Depth or Display Market Depth Last Quantities After Last Bar inputs, this input controls how much of the fill space may be used for drawing those extensions. A value of 0 means extensions will not enter the fill space, where as a value of 100 means extensions will fill all of the fill space. A value of 50 means extensions will fill into the left half of the fill space while the right half of the fill space remains untouched.
Use Last Quantity Instead Of Max Quantity For Bars
This applies to price levels within bars where more than one depth quantity was recorded within the timeframe of the bar for that price level. When this input is set to true, only the last quantity at the price level for the timeframe of the bar will be displayed, otherwise the maximum quantity at the price level within the timeframe of the bar will be displayed. This input has no effect on the quantities that are displayed as extending beyond the end of a bar.
Block Coloring Logic
Historical market depth quantities are shown on the chart as colored blocks. Each block represents a market depth quantity within a particular time frame and price level. These blocks are colored such that blocks with greater quantities use a color that is closer to the corresponding Color Input (Bid Color / Ask Color). Blocks with lesser quantities appear faded.
Blocks are colored relative to the minimum and maximum historical market depth quantities that are currently within the visible chart bars. The maximum quantity is the greater of the greatest Bid quantity and the greatest Ask quantity within the visible chart bars. The minimum quantity is the lesser of the smallest non-zero Bid quantity and the smallest non-zero Ask quantity within the visible chart bars.
The study has separate Color Inputs for the Bid side and the Ask side. The color used for a particular block is determined by the side with the greater quantity at that particular price level and chart column. So this can either be the Bid quantity or Ask quantity.
Intensities for the entire graph are calculated independent of side. If the greatest historical Bid quantity is greater than the greatest historical Ask quantity, the intensity of the greatest historical Ask quantity will be less than the intensity of the greatest historical Bid quantity. Setting the Color Inputs for both sides to the same color will make the Bid and Ask sides indistinguishable.
For the block (or blocks) with a quantity that matches the maximum quantity, the exact Color Input for the dominant side of that block is used. Quantities less than the maximum quantity are faded into the chart background color.
For the block (or blocks) with a quantity that matches the minimum quantity, the color for that block will have an intensity equal to the Minimum Volume Intensity Percent Input. The only rare exception to this case is when the minimum quantity is equal to the maximum quantity, in which case the intensity will be 100%.
Intensity is the percentage of the dominant side input color that is used over the chart background color. In intensity of 0% results in the chart background color, and an intensity of 100% results in the exact input color. An intensity of 50% half way between the chart background color and input color.
The color intensities for blocks with quantities between the minimum quantity and the maximum quantity correspond to a linear scale between the Minimum Volume Intensity Percent and 100%.
Quantities of zero, if they need to be displayed, will use the same color as the chart background color.
Example Coloring With Default Settings
Here is an example of the colors and intensities that will be shown for a handfull of quantity values using default settings.
Bid Color = 128, 190, 255
Ask Color = 255, 255, 0
Minimum Volume Intensity Percent = 20
Chart Background Color = 0, 0, 0
|0||210||100%||Maximum visible quantity (210).|
|0||0||0%||No quantity (0), uses background color.|
|10||0||20%||Minimum visible quantity (10), uses Minimum Volume Intensity Percent.|
|160||0||80%||Maximum bid quantity (160) is only a fraction of the maximum visible quantity (210).|
Example of Minimum Volume Intensity Percent
Here is an example of how different values of the Minimum Volume Intensity Percent can affect the same quantity values as above.
|Bid||Ask||Minimum Volume Intensity Percent|
Note that the minimum visible quantity (10) uses the Minimum Volume Intensity Percent for its intensity directly. The intensities for all other quantities are scaled proportionally between the Minimum Volume Intensity Percent and the maximum intensity of 100%.
Market Depth Data Time Stamping and Replays
When replaying a chart that uses the market depth data in some way like through the Market Depth Window or when using the Market Depth Historical Graph study, it is important to be aware of time stamping differences which can cause the market depth data to be out of sync with the last trade prices in price bars.
Depending upon the particular data feed being used, trades could be timestamped using the timestamp from the data feed and the market depth data could use the local computer clock timestamp. This will cause these two different data sets to be potentially out of sync when replaying a chart.
It also could be that the time stamping of the market depth data uses the timestamp from the data feed but market depth data timestamp is not completely accurate relative to the timestamp used for trades. Sierra Chart has no control over this.
There is not necessarily a perfect solution to this kind of problem. If the local computer clock is being used for time stamping, it is recommended that your computer's clock be set extremely accurately and synchronized multiple times an hour to a network time server. Refer to help topic 38.
If the particular Data or Trading service you are using supports time stamping using the local computer clock, then set Global Settings >> Data/Trade Service Settings >> Timestamp Using Local Computer Clock to Yes/True to use the local computer clock, if this option is available for the Service you are using.
If you still have a problem, then it is necessary to use the Sierra Chart Exchange Data Feed for accurate time stamping.
Somewhat related to this section is the timing of market depth data read during replays. The data read from the Depth file into the chart will not be beyond the timestamp of the last trade in the last bar in the chart. So if the market has not traded for a certain period of time but there has been market depth activity, you will not see that market depth activity until the next trade occurs during the replay.
*Last modified Thursday, 19th January, 2017.