Home >> (Table of Contents) Studies and Indicators >> Technical Studies Reference >> Bid Ask Depth Bars
Technical Studies Reference
- Technical Studies Reference
- Common Study Inputs (Opens a new page)
- Using Studies (Opens a new page)
Bid & Ask Depth Bars
The Bid and Ask Depth Bars study creates Candlestick bars below the main Chart Region on the chart based upon the Bid Market Depth quantity totals and Ask Market Depth quantity totals which occur during the formation of each chart bar.
This study has been updated as of version 1949. When using this study, use version 1983 or higher. This study is very accurate since these new versions. This study is only assured to be accurate when using Sierra_Chart provided data feeds which includes the Real-time Exchange Data Feeds. With other data feeds, the accuracy is going to be less.
The Bid and Ask Depth Bars study is calculated using the market depth data for the specified number of levels.
The Chart >> Chart Settings >> Market Depth >> Number of Levels for Bid/Ask Depth Calculations setting controls the number of market depth levels used in the calculations for this study.
The Max Depth Levels setting in the Global Settings >> Data/Trade Service Settings >> SC Server Settings needs to be set to 0, or equal to or greater than the Number of Levels for Bid/Ask Depth Calculations setting. Reconnect to the data feed after changing that setting.
The calculations are performed when the market depth book has been updated with a batch of changes from the data feed. These are not snapshot updates. The batch of changes is based upon standard processing according to the original source data feed from the exchange.
So once all the levels are updated from an exchange update message and the market depth order book is in a complete and accurate state, then the calculations are performed. It is important to understand, that as an order book is incrementally updated level by level, it is momentarily not in a complete and accurate state until the batch of messages from the exchange is processed. The calculations are only done when the book is in a complete and accurate state.
The Bid & Ask Depth Candlestick bars display the highest and lowest values of the calculated formulas as specified by the Mode Input, for the time duration of the chart bar.
The study relies on the recorded market depth data. This data is only recorded when connected to the data feed and a study including this one is being used which requires historical market depth data, or the symbol is set to record historical market depth data. The symbol must support market depth data as well.
This recorded market depth data is permanently saved and is persistent.
When using the CQG data feed, this study is not accurate with a large number of market depth levels. Refer to CQG Market Depth Data. Furthermore, we do not provide any technical support when using this study with CQG.
When using the study we recommend using version 1989 or higher. A careful analysis has been done with the Bid and Ask Depth Bars study and it is verified to be accurate.
The Mode Input specifies the formula to use. The following formulas are available:
- Ratio: ((Total Ask Quantities - Total Bid Quantities) / (Total Ask Quantities + Total Bid Quantities)) * 10.
- Difference (Ask - Bid): Total Ask Quantities - Total Bid Quantities.
- Sum: Total Ask Quantities + Total Bid Quantities.
- Number Bid/Ask Records: This calculation mode is no longer used effective version 1983 and higher.
- Bid Depth vs Ask Depth: Total Ask Quantities - Total Bid Quantities. The Bid Depth vs Ask Depth Mode does not display Candlestick bars, and instead displays the Bid market depth and Ask market depth as histogram bars, and the difference as a line.
- Sum Bid Side: Total of the Bid side market depth quantities.
- Sum Ask Side: Total of the Ask side market depth quantities.
- Difference (Bid - Ask): Total Bid Quantities - Total Ask Quantities.
- Cumulative Difference (Ask - Bid): Running sum of (Total Ask Quantities - Total Bid Quantities).
- Cumulative Difference (Bid - Ask): Running sum of (Total Bid Quantities - Total Ask Quantities).
The Cumulative Difference calculation options maintain a cumulative running sum of the depth difference.
On the Subgraphs tab of the Study Settings window for this study, the color settings for the first 4 Subgraphs control the Candlestick colors. You can also choose another Graph Draw Type such as OHLC Bar if you do not want to use Candlesticks.
Improving Performance of this Study
Potentially the Bid and Ask Depth Bars study can present a significant amount of processing to the primary thread of Sierra Chart. This is especially true when there are more than 50 levels of market depth for the symbol of the chart, potentially hundreds of levels of market depth, and the market depth is not being limited in the chart through the Maximum Market Depth Levels Chart Setting.
Do the following to reduce the CPU usage of this study.
- Increase the Chart Update Interval in the Chart Settings. For a chart that is using Bid and Ask Depth Bars we recommend 1000 ms. Although the benefit of this for this particular study is limited because it does not really reduce the total amount of calculations that has to be done over a one second period.
- Reduce the Number of Levels for Bid / Ask Depth Calculations Chart Setting to a nonzero value which is lower than 100.
- Reduce the number of instances of the Bid and Ask Depth Bars study you are using among the charts in your Chartbook. You should not have it on too many charts. If you can use it on just one chart that would be best.
- Use one of the Sierra Chart Real-time Data Feeds.
- Calculation Mode: This Input controls the formula that is used for the data. See above for explanations of the options available.
- Automatically Set Draw Styles: When this Input is set to Yes, then when the Calculation Mode Input is set to Bid Depth vs Ask Depth then the Subgraph Draw Styles for the Bid Depth and the Ask Depth will be automatically set to Bar, and the Subgraph Draw Styles for Zero Line and Difference will be automatically set to Line. Otherwise, if this Input is set to No these draw styles will not be automatically changed when selecting the Bid Depth vs Ask Depth mode.
Note that when using any other Calculation Mode the Subgraph Draw Styles Input is controlled by the selection of the Graph Draw Type.
*Last modified Tuesday, 31st January, 2023.