Login Page - Create Account

Technical Studies Reference


Market Depth Historical Graph

Introduction

The Market Depth Historical Graph study displays by default 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.

If the Use Last Quantity Instead Of Max Quantity For Bars Input is set to Yes, then the last market depth quantity at a price level for the chart column will be displayed instead of the maximum quantity.

This study only works with Intraday charts.

The market depth quantities displayed after the last bar in the chart 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 when the Display Market Depth Quantities After Last Bar Input is set to Yes. These values will match with the data in File >> Open Market Depth Window when the Depth Quantity Type to Display After Last Bar is set to Last Depth.

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 the Market Depth Historical Graph study to display the color-coded rectangles for market depth, 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.

During the formation of a chart bar which covers a certain span of time, the market depth bid and ask values are continuously varying during that timeframe. Therefore, for a given price level, there can be and most likely are both bid and ask market depth quantities recorded. However, only the bid side or ask side quantity at that price level is displayed depending upon which one is dominant. Both are not displayed.

Below are examples of the Market Depth Historical Graph study on an Intraday chart:

Step by Step Instructions

  1. Select Global Settings >> Symbol Settings on the menu.
  2. Locate the symbol or symbol pattern for the Symbol in the list of symbols, that you want to use the Market Depth Historical Graph study with.
  3. Select the Intraday tab.
  4. Enable the Record Market Depth Data option.
  5. Press OK.
  6. Reconnect to the data feed with File >> Disconnect and File >> Connect to Data Feed after altering the Symbol Settings.
  7. Market Depth historical data is not currently provided. It can only be stored in real time when connected to the data feed. Therefore, it is necessary to stay connected to the data feed as much as possible to avoid missing data. If market depth data is not provided for the symbol, then only the Best Bid and Ask data will be stored. In this particular case, this will limit the number of levels to just one.
  8. Go to the chart you want to add the Market Depth Historical Graph study to.
  9. Select Analysis >> Studies.
  10. In the list of the Studies Available, select Market Depth Historical Graph.
  11. Press the Add button.
  12. Press the Settings button. Set the Study Inputs as required.
  13. Press OK.
  14. Press OK.
  15. 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.
  16. 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.
  17. 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.
  18. By default, historical market depth data is only loaded for the last 10 days of data in an Intraday chart if there is historical market depth data available for those days. To adjust this, select Chart >> Chart Settings. Increase or decrease the Use Number of Days to Load >> Market Depth setting. The default is 10.

Study Inputs

Range 3 Max Ask Color

This is the maximum intensity color that is used for price levels at which the Ask quantity is greater than the Bid quantity and the depth value as a percentage of the greatest range is greater than the last percentage entered in the Percent Color Thresholds.

When the Input for Use Range Minimum Colors is set to No then this should be set to a light color when using a dark background in the chart as the gradient is based on these two colors.

When the Input for Use Range Minimum Colors is set to Yes then the color gradient is based on this color and the Range 3 Min Ask Color.

See the Block Coloring Logic section for more details.

Range 3 Min Ask Color

This is the minimum intensity color that is used for price levels at which the Ask quantity is greater than the Bid quantity and the depth value as a percentage of the greatest range is greater than the last percentage entered in the Percent Color Thresholds.

This Input is only used when the Input for Use Range Minimum Colors is set to Yes. When this is the case then the color gradient is based on this color and the Range 3 Max Ask Color.

See the Block Coloring Logic section for more details.

Range 2 Max Ask Color

This is the maximum intensity color that is used for price levels at which the Ask quantity is greater than the Bid quantity and the depth value as a percentage of the greatest range is greater than the second percentage and less than or equal to the third percentage entered in the Percent Color Thresholds.

When the Input for Use Range Minimum Colors is set to No then this should be set to a light color when using a dark background in the chart as the gradient is based on these two colors.

When the Input for Use Range Minimum Colors is set to Yes then the color gradient is based on this color and the Range 2 Min Ask Color.

See the Block Coloring Logic section for more details.

Range 2 Min Ask Color

This is the minimum intensity color that is used for price levels at which the Ask quantity is greater than the Bid quantity and the depth value as a percentage of the greatest range is greater than the second percentage and less than or equal to the third percentage entered in the Percent Color Thresholds.

This Input is only used when the Input for Use Range Minimum Colors is set to Yes. When this is the case then the color gradient is based on this color and the Range 2 Max Ask Color.

See the Block Coloring Logic section for more details.

Range 1 Max Ask Color

This is the maximum intensity color that is used for price levels at which the Ask quantity is greater than the Bid quantity and the depth value as a percentage of the greatest range is greater than the first percentage and less than or equal to the second percentage entered in the Percent Color Thresholds.

When the Input for Use Range Minimum Colors is set to No then this should be set to a light color when using a dark background in the chart as the gradient is based on these two colors.

When the Input for Use Range Minimum Colors is set to Yes then the color gradient is based on this color and the Range 1 Min Ask Color.

See the Block Coloring Logic section for more details.

Range 1 Min Ask Color

This is the minimum intensity color that is used for price levels at which the Ask quantity is greater than the Bid quantity and the depth value as a percentage of the greatest range is greater than the first percentage and less than or equal to the second percentage entered in the Percent Color Thresholds.

This Input is only used when the Input for Use Range Minimum Colors is set to Yes. When this is the case then the color gradient is based on this color and the Range 1 Max Ask Color.

See the Block Coloring Logic section for more details.

Range 0 Max Ask Color

This is the maximum intensity color that is used for price levels at which the Ask quantity is greater than the Bid quantity and the depth value as a percentage of the greatest range is less than or equal to the first percentage entered in the Percent Color Thresholds.

When the Input for Use Range Minimum Colors is set to No then this should be set to a light color when using a dark background in the chart as the gradient is based on these two colors.

When the Input for Use Range Minimum Colors is set to Yes then the color gradient is based on this color and the Range 0 Min Ask Color.

See the Block Coloring Logic section for more details.

Range 0 Min Ask Color

This is the minimum intensity color that is used for price levels at which the Ask quantity is greater than the Bid quantity and the depth value as a percentage of the greatest range is less than or equal to the first percentage entered in the Percent Color Thresholds.

This Input is only used when the Input for Use Range Minimum Colors is set to Yes. When this is the case then the color gradient is based on this color and the Range 0 Max Ask Color.

See the Block Coloring Logic section for more details.

Range 0 Min Bid Color

This is the minimum intensity color that is used for price levels at which the Bid quantity is greater than the Ask quantity and the depth value as a percentage of the greatest range is less than or equal to the first percentage entered in the Percent Color Thresholds.

This Input is only used when the Input for Use Range Minimum Colors is set to Yes. When this is the case then the color gradient is based on this color and the Range 0 Max Bid Color.

See the Block Coloring Logic section for more details.

Range 0 Max Bid Color

This is the maximum intensity color that is used for price levels at which the Bid quantity is greater than the Ask quantity and the depth value as a percentage of the greatest range is less than or equal to the first percentage entered in the Percent Color Thresholds.

When the Input for Use Range Minimum Colors is set to No then this should be set to a light color when using a dark background in the chart as the gradient is based on these two colors.

When the Input for Use Range Minimum Colors is set to Yes then the color gradient is based on this color and the Range 0 Min Bid Color.

See the Block Coloring Logic section for more details.

Range 1 Min Bid Color

This is the minimum intensity color that is used for price levels at which the Bid quantity is greater than the Ask quantity and the depth value as a percentage of the greatest range is greater than the first percentage and less than or equal to the second percentage entered in the Percent Color Thresholds.

This Input is only used when the Input for Use Range Minimum Colors is set to Yes. When this is the case then the color gradient is based on this color and the Range 1 Max Bid Color.

See the Block Coloring Logic section for more details.

Range 1 Max Bid Color

This is the maximum intensity color that is used for price levels at which the Bid quantity is greater than the Ask quantity and the depth value as a percentage of the greatest range is greater than the first percentage and less than or equal to the second percentage entered in the Percent Color Thresholds.

When the Input for Use Range Minimum Colors is set to No then this should be set to a light color when using a dark background in the chart as the gradient is based on these two colors.

When the Input for Use Range Minimum Colors is set to Yes then the color gradient is based on this color and the Range 1 Min Bid Color.

See the Block Coloring Logic section for more details.

Range 2 Min Bid Color

This is the minimum intensity color that is used for price levels at which the Bid quantity is greater than the Ask quantity and the depth value as a percentage of the greatest range is greater than the second percentage and less than or equal to the third percentage entered in the Percent Color Thresholds.

This Input is only used when the Input for Use Range Minimum Colors is set to Yes. When this is the case then the color gradient is based on this color and the Range 2 Max Bid Color.

See the Block Coloring Logic section for more details.

Range 2 Max Bid Color

This is the maximum intensity color that is used for price levels at which the Bid quantity is greater than the Ask quantity and the depth value as a percentage of the greatest range is greater than the second percentage and less than or equal to the third percentage entered in the Percent Color Thresholds.

When the Input for Use Range Minimum Colors is set to No then this should be set to a light color when using a dark background in the chart as the gradient is based on these two colors.

When the Input for Use Range Minimum Colors is set to Yes then the color gradient is based on this color and the Range 2 Min Bid Color.

See the Block Coloring Logic section for more details.

Range 3 Min Bid Color

This is the minimum intensity color that is used for price levels at which the Bid quantity is greater than the Ask quantity and the depth value as a percentage of the greatest range is greater than the last percentage entered in the Percent Color Thresholds.

This Input is only used when the Input for Use Range Minimum Colors is set to Yes. When this is the case then the color gradient is based on this color and the Range 3 Max Bid Color.

See the Block Coloring Logic section for more details.

Range Max 3 Bid Color

This is the maximum intensity color that is used for price levels at which the Bid quantity is greater than the Ask quantity and the depth value as a percentage of the greatest range is greater than the last percentage entered in the Percent Color Thresholds.

When the Input for Use Range Minimum Colors is set to No then this should be set to a light color when using a dark background in the chart as the gradient is based on these two colors.

When the Input for Use Range Minimum Colors is set to Yes then the color gradient is based on this color and the Range 3 Min Bid Color.

See the Block Coloring Logic section for more details.

Use Range Minimum Colors

When this Input is set to Yes, the Range # Min Ask/Bid Color Inputs are used along with the Range # Max Ask/Bid Color to determine the color gradient for depth values that fall into a specific range. Otherwise, the background color is used along with the Range # Max Ask/Bid Color to determine the color gradient for depth values that fall into a specific range.

Regardless of this setting, the Minimum Volume Intensity Percent still applies for each range of color values.

Percent Color Thresholds

This defines the percentages at which the Range 0-3 Ask/Bid Color options are separated.

Three values are to be entered as decimal values with a comma separating the values. For example, if the desired percentages are 40%, 60%, and 80%, these would be entered in this field as .40, .60, .80.

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 within each color range 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 towards the bottom of each color range, but decrease the overall contrast. Whereas a lesser value for this Input will increase the contrast between blocks, but decrease the visibility of blocks towards the bottom of each color range. A value of 0 will make it so the blocks with the smallest, non-zero, market depth quantity within each color range, 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.

Maximum Quantity For Coloring

If any visible market depth quantities are greater than this value, they will be colored as if they are equal to the Input value. This effects the overall range of quantity values used for the Block Coloring Logic.

The purpose of this Input is to prevent very large values from desaturating the rest of the graph. For example, if you were viewing a graph where most quantity values are in the range of 100~500, but there are one or two quantities that are over 5000, that would cause the large quantity values to stand out significantly while all of the other quantity values would be barely visible. With this Input, if it is set to a value of 500 or 600 for the example, the large quantity values would not stand out as much, and the details of the rest of the graph would be more visible.

Setting this to 0 means there is no maximum quantity limit.

Value Type for Graph Only Quantities Greater or Equal To

This Input controls how the value entered in the Graph Only Quantities Greater or Equal To is interpreted. The available options are the following:

  • Actual Value: This sets the value entered in the Graph Only Quantities Greater Or Equal To Input as the actual Market Depth value below which the data will not be drawn on the graph.
  • Percentage of Maximum Depth: This sets the value entered in the Graph Only Quantities Greater or Equal To Input as the Percentage of the maximum displayed depth below which the data will not be drawn on the graph.

It is important to note that when using the option Percentage of Maximum Depth this is the percentage of the highest viewable market depth value. Therefore, as scrolling through the chart, the actual value below which data is not displayed, will be constantly changing as the highest value viewable value changes. This is also the same method used to determine the range of colors that are used to color the graph.

Graph Only Quantities Greater Or Equal To

This Input sets the value for which a displayed depth at a particular price level and at a particular chart bar that are greater than or equal to the value determined by this setting and the Value Type for Graph Only Quantities Greater or Equal To will be displayed on the graph.

Any depth quantities below this threshold will be treated as if they were a quantity of zero. Since quantities below the threshold will be treated as if they are zero, this Input does affect the color shading of the blocks.

Setting this to 0 will effectively prevent any filtering.

When the Input Value Type for Graph Only Quantities Greater or Equal To is set to Percentage, values should be entered as whole percentages (for example - 20 for 20%). Additionally, any value greater than 100 is treated as 100%.

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

This Input controls the display of the market depth quantities used for the colored blocks. The quantities are displayed on top of the colored blocks.

This Input has the following 4 options:

  • None: No quantity values are displayed.
  • In Bars Only: The quantities are only displayed in the price bars.
  • In Bars and After Last Bar: If the Input Display Market Depth Quantities After Last Bar is set to Yes then the quantity numbers are displayed in the price bars as well as the extended last bar on the right side of the chart. If the Input Display Market Depth Quantities After Last Bar is set to No then the quantities are only displayed in the price bars.
  • Only After Last Bar: If the Input Display Market Depth Quantities After Last Bar is set to Yes then the quantity numbers are only displayed in the extended last bar on the right side of the chart. If the Input Display Market Depth Quantities After Last Bar is set to No then no quantities are displayed.

If there is not enough space within the block to display the full number, the number will be clipped. This is something to be aware of. In this particular case you will need to increase the chart bar spacing.

Quantity Numbers Color

This is the color that is used for the displayed quantity numbers when the Show Quantity Numbers Input is set to Yes.

Display Market Depth Last Quantities After Last Bar

When this is set to Yes, the 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. The depth values displayed are determined from the Input Depth Quantity Type to Display After Last Bar.

This column of blocks after the last bar which display the market depth quantities (when the Display Market Depth Last Quantities After Last Bar Input is set to Yes), will only update using market depth updates which have timestamps which are within the timeframe of the last bar. If the last bar is a variable timeframe bar, then they will only update using market depth updates with timestamps up to the timestamp of the last trade within that bar.

When a bar completes and before a new bar begins, the market depth data quantities displayed after the last bar, will not update until the new bar begins. This will cause them to appear delayed relative to the current market depth data displayed through other features displaying market depth like the Bid Size and Ask Size columns in the market data and trading columns on the right side of the chart, if enabled.

Depth Quantity Type to Display After Last Bar

This Input controls which data is displayed after the last bar when the Input Display Market Depth Last Quantities After Last Bar is set to Yes. This allows the depth data displayed after the last bar to display different information than what is in the last bar. The following options are available:

  • Maximum Depth: This displays the maximum depth value obtained at each price level.
  • Last Depth: This displays the last depth value at each price level.

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.

It is useful to set this to a value of less than 100 when Trade >> Draw DOM Graph on Chart is enabled.

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.

Font Size

This Input controls the size of the font that is used to display quantity values when the Input Show Quantity Numbers is set to anything other than None.

When this Input is set to a value of 0, the font size is set by the Chart Text font as defined in the Fonts and Text section of the Graphics Settings.

Maximum Levels to Display (0 for All)

This Input controls the total number of Market Depth levels that are displayed at each bar. The location of the levels is centered around the Last price of the bar.

Note that this is the total number of levels, including both Bid and Ask levels, not just the amount for one side.

Setting this Input to 0 will display all available Market Depth levels.

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 quantity within a given color range (Range n Max Ask/Bid Color) use a color that is closer to the corresponding color input. Blocks with lesser quantities within a given color range will appear faded toward the color of the background or to the color defined by the Range n Min Ask/Bid Color when the Input for Use Range Minimum Colors is set to Yes.

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 both the greatest Bid quantity and the greatest Ask quantity within the visible chart bars. The minimum quantity is the lesser of both the smallest non-zero Bid quantity and the smallest non-zero Ask quantity within the visible chart bars. Very often the minimum market depth value is not visible on the chart, as it is of the opposing depth type (for example, at a price of 2040.25 the Bid Depth is 50 and the Ask Depth is 2, the Bid Depth is displayed on the chart, but the Ask may be the minimum depth value).

If the Maximum Quantity For Coloring Input is set to a value greater than zero, any historical market depth quantities that are greater than that value will be treated as equal to that value for the purposes of coloring. This Input value does not increase the maximum quantity value used for coloring if all visible historical market depth quantities are less than the Maximum Quantity For Coloring.

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. Either the Bid quantity or the Ask quantity will be used.

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 Range 3 Color Input for the dominant side of that block is used. Quantities less than the maximum quantity within the color range are faded into the chart background color or to the Minimum Range Color if the Input for Use Range Minimum Colors is set to Yes.

For the block (or blocks) with a quantity that matches the minimum quantity (if visible), 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 Range Maximum Input color that is used over the chart background color (or Range Minimum Color if the Input for Use Range Minimum Colors is set to Yes. An intensity of 0% results in the chart background color (or the Range Minimum Color if the Input for Use Range Minimum Colors is set to Yes), and an intensity of 100% results in the exact Range Maximum Input color. An intensity of 50% is half way between the chart background color (or Range Minimum Color if the Input for Use Range Minimum Colors is set to Yes) and Range Maximum Input color.

The color intensities for blocks with quantities between the minimum quantity and the maximum quantity and within a particular color range correspond to a linear scale between the 0% and 100%. The use of a particular color range is determined by the values entered in the Percent Color Thresholds.

Quantities of zero, if they need to be displayed, will use the same color as the chart background color (or the Range Minimum Color if the Input for Use Range Minimum Colors is set to Yes.

The following logic is used when determining a particular color:

  • The range of the highest to lowest depth is determined. If the Maximum Quantity for Coloring and the Graph Only Quantities Greater or Equal To are both set to 0 then this is the highest depth value minus the lowest depth value of the visible bars in the chart. As noted above, the lowest depth value may not be displayed as it is most likely the non-dominant side.

    If the Maximum Quantity for Coloring is non-zero and is less than the highest depth value within the visible bars, then the value entered in the Maximum Quantity for Coloring Input will be used as the highest depth value.

    If the Graph Only Quantities Greater or Equal To is non-zero and is greater than the lowest depth value in the visible bars, then the value entered in the Graph Only Quantities Greater or Equal To Input will be used as the lowest depth value.
  • The range of depth values is treated as a percentage ranging from 0% (lowest value) to 100% (highest value), and each depth value is evaluated to determine it's percentage position within the range.
  • The choice of Bid or Ask is determined by which side is larger. For example, if the Ask is 243 and the Bid is 54, then the Depth at that Bar and Price will be the Ask at 243.
  • The Range 0-3 Max/Min Ask/Bid Color to be used is determined by the Percentage value of each depth value (as determined above) and where it falls into the range of values defined in the Percent Color Thresholds. The following determines which specific color range is used:
    • If the Percentage is less than or equal to the lowest value in the Percent Color Thresholds, then the Range 0 Bid/Ask Color is used.
    • If the Percentage is greater than the lowest value and less than or equal to the middle value in the Percent Compare Thresholds, then the Range 1 Bid/Ask Color is used.
    • If the Percentage is greater than the middle value and less than or equal to the highest value in the Percent Compare Thresholds, then the Range 2 Bid/Ask Color is used.
    • If the Percentage is greater than the highest value in the Percent Compare Thresholds, then the Range 3 Bid/Ask Color is used.
  • Each color range is also treated as a percentage range from 0% to 100% (color percentage). A depth value is then converted to a percentage within the range of values within a specific Color range. The final color that is used is determined by a linear interpolation from the Input color to the Background color (or to the Range Minimum Color if the Input for Use Range Minimum Colors is set to Yes based on this color percentage, where 100% is the entered Input color and 0% is the Background color.

    If the Minimum Volume Intensity Percent is non-zero, then any color that would be lower than this percentage value is not used in the calculation of the color percentage. This would mean that a Color Percentage of 0% would map to the color value that would be defined at the Minimum Volume Intensity Percent without this scaling.

Example 1 - Interpolation to Background Color:

The following example uses only the Ask depths for simplicity. The data and Inputs are as follows:

  • Highest Depth Value: 1000
  • Lowest Depth Value: 0
  • Range 3 Max Ask Color: Grey (RGB values of 100, 100, 100)
  • Background Color: Black (RGB values of 0, 0, 0)
  • Maximum Quantity for Coloring: 0
  • Graph Only Quantities Greater or Equal To: 0
  • Percent Color Thresholds: .25, .5, .75
  • Minimum Volume Intensity Percent: 0
  • Depth Value: 850

The following steps are used to calculate the specific color for this depth and price:

  1. Since the Depth Value is 850, and the range of data is 0 - 1000, the Range Percentage for this value is 0.85 (850 / (1000 - 0)).
  2. This Range Percentile is greater than the highest value in the Percent Color Thresholds, therefore the Range 3 Max Ask Color is the basis color for this depth value.
  3. Since the Minimum Volume Intensity Percent is zero, the full range of possible colors for this Color Range will be used. The low value of this color range is 750 (.75 * 1000) and the high value within this color range is 1000, therefore this Depth Value equates to a Color Percentage of 0.4 ((850 - 750) / (1000 - 750)).
  4. A linear interpolation of the entered color results in a grey color with RGB values of (40, 40, 40).

Example 2 - Interpolation to Range Minimum Color:

The following example uses only the Ask depths for simplicity. The data and Inputs are as follows:

  • Highest Depth Value: 1000
  • Lowest Depth Value: 0
  • Range 3 Max Ask Color: Dark Blue (RGB values of 0, 0, 100)
  • Range 3 Min Ask Color: Dark Red (RGB values of 100, 0, 0)
  • Maximum Quantity for Coloring: 0
  • Graph Only Quantities Greater or Equal To: 0
  • Percent Color Thresholds: .25, .5, .75
  • Minimum Volume Intensity Percent: 0
  • Depth Value: 850

The following steps are used to calculate the specific color for this depth and price:

  1. Since the Depth Value is 850, and the range of data is 0 - 1000, the Range Percentage for this value is 0.85 (850 / (1000 - 0)).
  2. This Range Percentile is greater than the highest value in the Percent Color Thresholds, therefore the Range 3 colors are used to determine the final color for this depth value.
  3. Since the Minimum Volume Intensity Percent is zero, the full range of possible colors for this Color Range will be used. The low value of this color range is 750 (.75 * 1000) and the high value within this color range is 1000, therefore this Depth Value equates to a Color Percentage of 0.4 ((850 - 750) / (1000 - 750)).
  4. A linear interpolation of the entered color results in a Burgundy color with RGB values of (40, 0, 40).

Market Depth Historical Graph Not Displaying

Follow through the instructions here to resolve a problem where the Market Depth Historical Graph study does not display anything.

  1. The first step is to reconnect to the data feed. Stop here if the problem is resolved.
  2. Reset the defaults for the Market Depth Historical Graph study by opening the Study Settings window for the study (Analysis >> Studies >> [select study in Studies to Graph] >> Settings). Press the Reset Defaults button.
  3. Press OK.
  4. Press the Remove button on the Chart Studies window to remove the study.
  5. Add the Market Depth Historical Graph study again from the Studies Available list.
  6. Press OK. Stop here if the problem is resolved.
  7. Follow through the Step by Step Instructions. Be sure to enable the Record Market Depth Data option for the symbol or symbol pattern in the Global Symbol Settings.
  8. There must be market depth data available for the symbol. To verify this is the case, open the market depth window through File >> Open Market Depth Window . Sierra Chart needs to be connected to the data feed with File >> Connect to Data Feed to see the market depth data there if it is available.
  9. Historical market depth data will only be displayed at the Date-Times in the chart at which Sierra Chart was connected to the data feed and market depth data is being recorded. It is necessary to follow through the Step by Step Instructions to set up the recording. Although the recording also happens when the Market Depth Historical Graph study is on the chart.

    The symbol of the market depth data file needs to match the symbol of the chart exactly.
  10. Verify that there are data files present. Go to the \Data\MarketDepthData folder in the Sierra Chart installation folder on your system (usually C:\SierraChart), through your operating system file manager.

    This folder contains all of the market depth data files. The file extension is .depth. The filename format is [symbol].[UTC date].depth. The date on a market depth data file is the UTC date and covers a time span from 0:00:00 to 23:59:59 for that date in UTC time. If the file for a particular date does not exist, then there will be no data for that particular date in the chart.

    Also, consider the fact that the market depth data file may only contain data for a portion of the date it is for. Or Sierra Chart may not have been connected to the data feed at all times during that date or the necessary settings to maintain historical market depth data for the symbol were not present all times.
  11. If the depth file does exist for a particular date but yet the data is not displayed on the chart, and the chart is updating in real-time and contains the Market Depth Historical Graph study, then as a last step, disconnect from the data feed with File >> Disconnect.

    Rename the market depth data file for the symbol and the current date to the same name with a .backup file extension. Connect to the data feed with File >> Connect to Data Feed. We would not normally expect this last procedure to really be necessary.

Market Depth Data Time Stamping During Real Time Updates and Replays

During real-time chart updating and also during Chart Replays, 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 between the market depth data and trades which can cause the market depth data to be out of sync with the last trade prices within the 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 Incorrect Date and/or Time Display for further information.

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 Service Setting >> 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.

In some cases market depth data is always time stamped using the local computer clock depending upon the particular Data/Trading service being used.

For the most accurate time stamping which does not use the local computer clock, you must use the Sierra Chart Exchange Data Feed for market data for accurate time stamping.

However, as of this time, the market depth data time stamping is only to the second and not the millisecond for all supported Data and Trading services. In a future version milliseconds will be supported This is necessary for perfect alignment of the market depth data to chart bars where there are multiple bars with the same Date-Time to the second.

Sierra Chart also timestamps trades to the second and milliseconds acts as a trade counter when there are multiple trades within the same second. Therefore, in the case of when there are multiple chart bars with the same Date-Time to the second, the market depth data for that second will all be contained on the first bar with the same Date-Time to the second as other bars. Subsequent bars with that same Date-Time will display the last received market depth data values at each price level.

Market Depth Historical Graph Timing in Relation to Chart Bar Date-Times

During real-time updating of a chart and chart replays there are rules related to market depth data in relation to the last bar Date-time and whether the market depth data with Date-Times beyond this Date-Time is displayed or not. The following are the rules for this.

During a chart replay, the reference Date-Time for market depth data will be based upon the current Date-Time of the replay whether or not the last bar in the chart includes that particular Date-Time. The current Date-Time during a chart replay depends upon the replay speed and the starting Date-Time of the replay, and the actual elapsed time.

When a chart is not replaying and the chart bars are based upon a fixed time, the reference Date-Time for market depth data is the latest ending time of the chart bar whether or not that time has yet been encountered. So in other words in the case of a 5 minute chart bar, with the starting time of 12:00:00 the ending time will be 12:04:59.999. A new bar does not begin until there is a new trade within the timeframe of that upcoming bar.

When a chart is not replaying and the chart bars are based upon a variable timeframe, Number of Trades, Volume, Range, Reversal, Renko, Delta Volume, Price Change, Point and Figure Bars, the reference Date-Time is the time of the last trade within that bar.

In all of these cases market depth activity beyond the reference Date-Time will not be displayed until a new chart bar is added to the chart which will only occur when there is a trade within the timeframe of that upcoming bar.

Drawing of Depth Quantities at Price Levels on Chart Bars where there have been No Depth Updates

The maximum market depth quantity at a price level is only shown at the chart bar during the timeframe it occurred. For subsequent chart 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 even if there has been no market depth update at that price level at a particular chart bar.

This is the standard functioning of the Market Depth Historical Graph study for price levels on chart bars where there have been no market depth updates but the prior depth levels have not been deleted by the data feed.

This is considered essential functioning of the study otherwise the Market Depth Historical Graph will have a broken appearance.

Improving Performance

To improve the drawing performance and therefore lower the CPU usage when using the Market Depth Historical Graph study, follow the below steps.

  1. Go to the chart and select Chart >> Chart Settings >> Advanced Settings.
  2. Set the Chart Update Interval in Milliseconds to 1000 or higher.
  3. Press OK.
  4. Open the Study Settings window for the Market Depth Historical Graph study.
  5. Set the Show Quantity Numbers Input to None or Only After Last Bar.
  6. Set the Maximum Levels to Display Input to 20 or lower.
  7. Press OK to close the Study Settings window.

Other Related Useful Studies

Below are some studies which you may find useful to use along with the Market Depth Historical Graph study.


*Last modified Friday, 17th May, 2019.