DYO: Bars per period speedometer
|
Q: I am trying to develop a study for my tick charts that gives me some information about the speed of the move. I have seen the speedometer study in the archives and have tried to develop something myself but albeit starting to understand the structure of DYOs to some extent, I have been unable to come up with anything usable.
Ideally, I am looking to create a study that plots a line that indicates high levels when the activity is high and low when the market is calm. To be precise, I would like it to use the number of bars per unit of time. So, the more bars there are, the more active is the market. Another interesting thing would be a study that does the same thing with the amplitude of movement and time.
I have been playing around with functions like "minutes since midnight" which draws a nice graph the slope of which decreases when activity is high and "bar index" but I haven't been able to come up with anything that does exactly what I want, as I believe the study would have to reinitialize at every open in order to avoid it being disturbed by gaps, but maybe I am wrong. Do you have any idea on how I could translate that idea into a DYO?
A: You might consider some of these ideas for your speedometer.
Template: 1308-BarsPerPeriod
Line A reads the Bar's timestamp in Minutes and divides by 5. Line B truncates the fractional part. Line C and D do the same thing for the prior bar's timestamp.
When the two bars have the different time groups, a counter in [250] is reset to zero by Line F. Line G increments the counter once per bar and plots it. Note that the Close Only box is checked so the current bar updates the counter once instead of with every tick.
The histogram visual shows ramps for each 5-minute period. If a bar is in the same 5-min time chunk as its left side neighbor, then the ramp will be one step higher. When a new 5-minute period begins, the ramp starts from the bottom again. The Higher the ramp, the more active the market is because there are more constant tick bars in this time chunk. You can adjust your time chunk size in minutes in the Number fields on Line A and Line C.
Template: 1308-BarsPerPeriod
Last modified 1/17/08 5:21 PM
|