I am trying to create a horizontal trend line indicator based on my forex trading strategy.
The idea is to check on the hourly chart the daily closes back for a year.
1) Loop through daily closes for 1 year.
2) check if they closed within the same area more than 3 times
3)Draw a horizontal line at that point.
I have started the code but not sure if its even possible to do what I want as you can use a daily indicator on a hourly chart.
Thats why I am looping through the Dhigh() Dlow() DClose() functions.
I dont think you can use summation as that period will be 365 hourly periods.
I was thinking about using a nested For Loop with a counter if counter is greater than 3 then draw line.
I have attached images of what I am trying to do.I added the lines to daily chart and when you switch to the hourly chart those lines still act as major support and resistance lines.