Technical Studies Reference
Market Depth Historical Graph
- Step by Step Instructions
- Study Inputs
- Block Coloring Logic
- Market Depth Historical Graph Not Displaying
- Market Depth Data Time Stamping During Real Time Updates and Replays
- Market Depth Historical Graph Updating During Replays and with Variable Timeframe Chart Bars
- Drawing of Depth Quantities at Price Levels on Chart Bars where there have been No Depth Updates
- Other Related Useful Studies
- c_ACSILDepthBars (Programmatically Accessing Market Depth Data) (Opens a new page)
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 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 when the Display Market Depth Last Quantities After Last Bar Input is set to Yes. These values will match with the data in File >> Open Market Depth Window.
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.
Below are examples of the Market Depth Historical Graph study on an Intraday chart:
Step by Step Instructions
- Select Global Settings >> Symbol Settings on the menu.
- 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.
- 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.
- 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.
- 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.
- 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.
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.
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.
Graph Only Quantities Greater Or Equal To
Only market depth quantities at a particular price level and at a particular chart bar that are greater than or equal to this value 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.
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. 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 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.
The column of blocks after the last bar which display the last 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 last 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.
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.
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 or Ask Color). Blocks with lesser quantities will 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 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.
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 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 Historical Graph Not Displaying
Follow through the instructions here to resolve a problem where the Market Depth Historical Graph study does not display anything.
- The first step is to reconnect to the data feed. Stop here if the problem is resolved.
- 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.
- Press OK.
- Press the Remove button on the Chart Studies window to remove the study.
- Add the Market Depth Historical Graph study again from the Studies Available list.
- Press OK. Stop here if the problem is resolved.
- 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.
- 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 .
- 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.
- 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.
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 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 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.
If you still have a problem, then it is necessary to use the Sierra Chart Exchange Data Feed for accurate time stamping.
Related to this section is the timing of market depth data read during replays. The data read from the Market Depth file into the chart will not be beyond the timestamp of the last trade in the last bar in the chart for variable timeframe bars. 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.
Likewise with real-time updating of an Intraday chart or when replaying fixed time Intraday chart bars, market depth updates which have a timestamp after the ending time of the current bar will not be seen 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.
Market Depth Historical Graph Updating During Replays and with Variable Timeframe Chart Bars
During a chart replay the Market Depth Historical Graph will only update with recorded market depth data that has a Date-Time stamp which is less than or equal to the timestamp in the last trade of the last bar. Therefore, the updating will not be exactly as it is in real-time. It can seem to be more "jumpy" in that there will not be any updating until there is a new trade and then suddenly a lot of market depth updates will be processed which occurred between the newest trade and the trade before. This may be improved upon in a future release.
During real-time updating of a chart that uses variable timeframe chart bars which include Number of Trades, Volume, Range, Reversal, Renko, Delta Volume, Price Change, Point and Figure Bars, the same rule applies as is explained in the prior paragraph. Although it is not reasonably possible for there to be any improvement when using variable timeframe chart bars.
When using fixed timeframe bars, the Market Depth Historical Graph for the last bar in the chart will always be up-to-date with the latest market depth data unless that last bar has closed. If it has closed, the updating will not begin until a new bar begins which happens when there is a new trade.
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.(Need image)
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 Monday, 16th July, 2018.