Horizontal Trend Line Indicators

Forums ProRealTime English forum ProBuilder support Horizontal Trend Line Indicators

Viewing 5 posts - 1 through 5 (of 5 total)
  • #33729

    Hi There

    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.

    Any guidance would be greatly appreciated.

    Thanks

    #33746

    A nested loop would be the solution, but you may be stuck with the infinite loop bug limit. Repeat after me : ” we NEED arrays !!” 🙂

    #33755

    Getting slightly better but the results are still not ideal. run in hour timeframe

     

    #33760

    Is it possible to create dynamic variables.

    IE

    for i=1 to 20 do

    l(i) = i

    next

    And Yes Arrays would be fabulous. PLEASE PLEASE PLEASE.

     

    #33776

    No that’s what are arrays 🙂

     

Viewing 5 posts - 1 through 5 (of 5 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login