|How to plot HLC monthly/weekly etc bars with a DYO on another Time Frame|
18:20 Ensign Howard: The chart shows monthly High and Low as the daily bars develop the monthly range during the month. Then on the first day of the new month, the monthly range resets to the range of the first daily bar, and we show a > in pink where the month just finished closed at. The DYO for this visual is below the chart, which I will discuss.
18:21 Ensign Howard: Line A and B get the month value for two adjacent bars so I can discover when the month change to a new month by the test on Line C. So the flag in GV is True when we are on the first bar of the new month.
18:22 Ensign Howard: Line D uses this flag to reset a private GV counter in  to zero.
18:22 Ensign Howard: Line E increments this counter which is counting the number of bars in the current month.
18:23 Ensign Howard: Line F and G use the counter to know how many bars back to scan for the Highest and Lowest values, which have to be the current month's high and low values. And we plot the horizontal lines at these max high and max low values.
18:24 Ensign Howard: Line H is just testing the flag for 1st bar of the month again and Line I is getting the close of the prior bar to put on a marker at the close value, which is where the prior month just closed at.
18:25 Ensign Howard: I think the example is sufficient for you to use as is, or run with it and modify the concepts to do what you want. But is does show a clever way to count the number of bars in the current month as the program scans across the bars in its evaluation from left to right,
18:26 Ensign Howard: Then this count is used by Line F and G to harvest the values wanted from just this set of bars in the same month as the current bar.
18:28 Ensign Howard: The way the DYO is written it would also work if applied ot a 60 min chart, etc. as long as the chart has all the data for the month, it will find the high and low in that month on any time frame chart. The counter resets on the first bar of a new month.
18:29 Ensign Howard: Does not matter to me if the data is daily, 5-minute, 60-min, or even tick, range, or volume chart..... idea still works. Note the bar offsets of -1 to reference the prior bar and 0 to reference the current bar as the chart is evaluated across all bars. This same idea would be applicable for the user who asked about S&R lines on a weekly chart
18:33 Ensign Howard: Use the DYO to harvest the weekly High and Low and Close from the chart, and use the 3 values to plot S&R lines. Combine this example with the idea in the Dynamic Fib Levels DYO example which can be found on the Help page of our web site and then the user would have Dynamic S&R levels based on prior week's HLC and the DYO could be used on 60-min chart as he requested
18:35 Ensign Howard: Too bad if that user who asked for weekly S&R is not still here to see the progression made in our discussion and this example which is on topic for him.
18:35 Ensign Howard: gn
18:35 fibzones: I'm here, Howard, thanks will try your suggestion
18:28 ticks: thanks Howard gn
18:36 Ensign Howard: ok fibzones, great.