DYO: Forecast of bar's final volume
|
Q: With a DYO I'd like to show a projected volume based on the current "run rate" on top of the current building volume bar. For example, say once a minute (tick or what ever) the DYO would take the volume so far on the current bar divide by the number of minutes so far and then multiply by 60 to get a projected volume for that 60 minute bar at the current rate. Put another way 18 minutes into the 60 minute bar the volume is 550. 550 divided by 18 minutes is an average volume of 30.55 per minute. Multiplied by 60 minutes gives a projected volume for that bar of 1,833. Then ideally I could have a different color bar placed on top of the current volume bar as an extension of the current volume bar. Again any help would be greatly appreciated.
A: Here is the solution for the request for the Volume Predictor.


Actual volume is plotted in blue, and the forecast for the last bar's final volume is plotted in Red. The two lines will come together as the bar reaches 100% of its time.
Line A plots the bar's volume. Line B reads the bar's time period, such as a 5 for a 5-minute chart, and converts this to seconds. Line C and D calculate the number of seconds into this time period for the current time. When the study is on the last bar of the chart, the current volume is amplified by the ratio of the bar period divided by the time portion completed.
Template: 1357-VolPredictor
Q: I'm wondering how to get your Volume Predictor to work on a five minute chart. It was developed for a 60 minute chart and because the functions of lines E, F, and G aren't described, the predictor is not functioning correctly in my charts. For example, it's not giving a prediction each second of what volume should be at the end of the bar, nor do the two lines (Volume and Predicted Volume) come together as the volume bar reaches 100% of the time.
Ideally, if the volume level is showing a level of 100 thirty seconds into the bar, the predictor should be showing 1000 at that moment as a prediction. (100 Volume X 2 thirty second periods per minute X 5 minutes = 1000 volume). Anything you can do to help is greatly appreciated.
A: There is nothing about this template that is fixed on being for a 60-min bar. It is intended for any intra-day bar size and 5-min is just fine. The 60 you see on Line B is the number of seconds in a minute, and unrelated to a 60-min bar chart.
Line B gets the bar time frame such as 5 for a 5-min bar and converts this to 300 seconds. Line C gets the seconds from midnight and is used with Line D to know how many seconds into the current bar the current time is. So in your example it will determine a value of 30. The final calculation on Line G would be 300 * 1000 / 30 = 10,000 using your example. All is well and works as intended in spite of your not understanding the example's design. No fix is needed.
Last modified 9/10/09 2:48 PM
|