/******************************************************************** Title: BVP (Bar Volume Profile) Scripts for eSignal 7.x By: Chris D. Kryza (Divergence Software, Inc.) Email: c.kryza@gte.net, ckryza@sr-analyst.com Web: http://www.sr-analyst.com Incept: 04/01/2004 Version: 1.0.0 ===================================================================== Fix History: 04/01/2004 - Initial Release 1.0.0 ===================================================================== Specifications: BVP-POC.EFS - Calculates the POC for a selected number of bars in your viewing time frame. The viewing time frame can be any interval that is less than Daily and greater than or equal to 1-min. This study does not operate with Tick data.... 1-min is the smallest valid interval. The general idea is to run this study on a 15-min, 30-min or 60-min bar interval to get a feel for where the current price action is in relation to the price level where the most shares/contracts were traded. See the Project Description below for more information on how this script operates. BVP-ValueArea.EFS - Calculates the Value Area for a selected number of bars in your viewing time frame. The Value Area is displayed in the form of two lines (bands). The upper band represents the Upper Value Area (UVA) and the lower band represents the Lower Value Are (LVA). The viewing time frame can be any interval that is less than Daily and greater than or equal to 1-min. This study does not operate with Tick data.... 1-min is the smallest valid interval. The general idea is to run this study on a 15-min, 30-min or 60-min bar interval to get a feel for where the current price action is in relation to the Value Area as determined through Volume Profile analysis. The Value Area will be based upon a standard deviation factor that you input via the study's Parameter Menu. See the Project Description below for more information on how this script operates. Project Description: The BVP scripts (POC and Value-Area) are a little different than the traditional Volume Profile studies in that they calculate the Volume Profile for individual intraday bars rather than for an entire day (or range of days). So, if you are viewing a 30-min chart of the SP Emini and you load the BVP-POC study, for each 30-min bar it will show you the price level at which the most trades took place during that 30-min period. This price level is commonly referred to as the "POC" or Point of Control. When you first load the study, it will calculate this POC level for a predetermined number of historical bars on your chart. Then, as new realtime data comes in, the study will update as necessary. The BVP-ValueArea study operates in the same fashion as the BVP-POC study but instead calculates and plots the Value Area for each bar in your viewing time frame based upon a standard deviation factor that you supply. Both of the BVP studies operate by creating a 'Volume Profile' for each bar that they are analyzing. They do this by retrieving data from a lower time frame and they use this more granular data to create an estimate of the number of shares/contracts that were traded at each of the price levels that comprise the bar in your viewing time frame. If you are viewing a chart that is displaying 30-min bars (your viewing time frame) and you set the Vol Profile Interval in the BVP-POC script to 1 (meaning 1-min bars, this would be the lower time frame) then for each 30-min bar in the chart you are viewing, the study will go out and grab all of the 1-min bars that comprise the 30-min bar and will use those smaller time frame bars to perform the Volume Profile calculation. Both BVP scripts have a Parameter Menu (once you load either script, use the Edit Studies option to access this Parameter Menu) that contain several parameters to customize study operation. However, both scripts have 3 parameters that require an in-depth explanation so you can understand how the studies operate (and also be aware of their limitations). Lookback Bars Lookback Bars is simply the number of historical bars over which you want the study to perform its calculations when one of the BVP scripts is first loaded. The default value in both studies is 20 (20 bars). So, if you load the BVP-POC script into a 60-min chart of XYZ that has 300 bars displayed on the screen, the script will only calculate the POC for the most recent 20 bars and will ignore the bars that precede them. Why do we limit the number of historical bars? It is primarily a resource/processing issue. Remember that for each bar in your viewing time frame (in this case 60-min bars) the study will go out and grab all of the bars from a lower time frame to calculate the Volume Profile. So, if we set the number of Lookback Bars to 100 and we set our Vol Profile Interval to 1 (e.g., 1-min bars), the study would need to go out and grab 6000 1-min bars (60 x 100) to do its job. The retrieval of this data, as well as the subsequent processing of the same data, takes time and computer resources. The higher you set the Lookback Bars value, the longer it will take for the study to load initially. The valid range for this parameter is between 1 and 500 lookback bars. Vol Profile Interval This parameter is used to specify the lower time frame interval that the study will use when creating the Volume Profile for each bar in your viewing time frame. The valid range for this parameter is from 1 (e.g, 1-min bars) all the way up to the interval in your viewing time frame. So, if you were viewing a 15-min chart, the valid range for Vol Profile Interval would be any whole number from 1 up to 15. If you were viewing a 60-min chart, the valid range would be any whole number from 1 all the way up to 60. The default value is 1 which means that the script will use 1-min bars when creating the Volume Profile for your viewing time frame. Remember that the lower the Vol Profile Interval setting, the more granular (e.g., accurate) the Volume Profile study will be so in most cases you should just leave this parameter set to its default value of 1. Price Increment The Price Increment parameter is a tricky one and you need to understand its purpose before you can use the BVP studies effectively. The Price Increment is basically the spacing between price levels that will be used when the study creates the Volume Profile. A couple of examples will probably help to make this clear. If you are viewing a 30-min chart of the SP Emini, the Price Increment that makes the most sense would be 0.25. Why? Because the EMini trades in 0.25 increments... price moves from 1126.00 to 1126.25 to 1126.75 and so on. While you certainly could use a smaller price increment in this scenario, it would not result in a more accurate Volume Profile calculation because, again, the SP Emini trades in 0.25 price increments. Now, if you were viewing a 30-min chart of IBM, you would need to make a different selection for Price Increment. Why? Because IBM trades in increments of 0.01 (1 penny) so a Price Increment setting of 0.01 probably makes the most sense in this case. You certainly could leave the Price Increment parameter at its default value of 0.25 but, in the case of a stock like IBM, you would sacrifice some granularity/accuracy in the Volume Profile calculation. That being said, there are times when you might want to use a Price Increment that is higher than normal. The basic rule of thumb is that the lower the Price Increment, the more time (and processing power) it will take for the study to create the Volume Profile. So, in the case of IBM, perhaps it would make more sense to set the Price Increment to 0.05 (5-cents) instead of of 0.01. This will provide you with faster study operation but will still give you results that are very close to the results you would obtain using a setting of 0.01. Ultimately it is up to you to experiment to find the best Price Increment setting for the securities that you are charting. But remember to use the security's tick value as the starting point... going below the tick value will just waste time and processing power. Both studies have additional parameters available that are primarily cosmetic in nature (e.g., line colors, thickness, etc.) BVP-POC Parameters Lookback Bars - discussed above. Vol Profile Interval - discussed above. Price Increment - discussed above. Plot Color - The color to be used when drawing the POC line on the chart. Plot Thickness - The thickness of the POC line. Use Background Colors? Set to either "T" (True) or "F" (False). When set to True, the study will color the bar background green when price is above the POC and red when the price is below the POC. The colors can be adjusted using the two parameters below. Price Above POC - Set the color for the chart background when price is above the POC. Price Below POC - Set the color for the chart background when price is below the POC. BVP-ValueArea Parameters Lookback Bars - discussed above. Vol Profile Interval - discussed above. Price Increment - discussed above. Value Area Std Devs - Number of Standard Deviations to use in the Value Area calculation. The default is 1 Standard Deviation. UVA Color - Color to use when plotting the UVA (Upper Value Area) line. LVA Color - Color to use when plotting the LVA (Lower Value Area) line. UVA Thickness - Line thickness to use when plotting the UVA line. LVA Thickness - Line thickness to use when plotting the LVA line. Time Templates To reiterate, the BVP studies operate by grabbing data from a lower time frame and then using that lower time frame data to create a Volume Profile for each bar on the time frame that you are viewing. If the study cannot retrieve enough lower time frame data (based on the Lookback Bars value that you specified) then an error will be generated. The amount of lower time frame data that will be available to the study is controlled by your eSignal Time Template. By creating a Template Item for the Time Template that you are using in conjunction with the BVP studies, you can ensure that enough data will always be available. Example: Assume you are viewing a 60-min chart of a security. You want to load a BVP study and you decide that you want to use 1-min bars as the lower time interval. Also assume that you set the Lookback Bars parameter to 50 which means that you want the BVP study to evaluate the 50 most recent 60-min bars. To do the job, the study will require 3000 1-min bars (50 x 60) which roughly equates to 8 days worth of 1-min bars. 1. Right-click in your chart and select the Time Templates option. 2. Select Edit from the next menu (we want to edit the Time Template that is currently associated with this chart). 3. The Time Template you are using should be highlighted in the Time Templates dialog. 4. Look in the Template Items area of the Time Templates dialog. We are going to add a new Template Item that will instruct our eSignal chart to keep 8 days worth of 1-min data on hand. 5. Use the list box to change the Type: parameter from Intraday Default to User Defined. 6. In the Interval edit box, type in the number 1 (e.g., 1-min bars) 7. In the # Days edit box, type in 9 (we need 8 days worth, to be safe set it to 1 more). 8. Make sure that the "Days" radio button is selected. 9. Click on the Update/Add button to the right of the Type field and this Time Template Item will be added to the Time Template associated with this chart. Our Time Template is now configured so that, whenever 1-min bars are requested by a chart or by a study running in a chart, 9 days of 1-min data will be made available to that chart or study. If you are interested in more traditional Volume Profile studies, please visit our Specialty Scripts formum in the File Share section of the eSignalCentral web site. There you will find a Volume Profile folder that contains a variety of Volume Profile-related scripts. Dislaimer: For educational purposes only! Obviously, no guarantees whatsoever and use at your own risk. **********************************************************************/