Specific length on Drawhline

Forums ProRealTime English forum ProBuilder support Specific length on Drawhline

Viewing 6 posts - 1 through 6 (of 6 total)
  • #105336

    Hello,

    I am trying to make an indictaor with lines, but I dont want the lines to go on forever to the right of the screen. Is it possible to determine the length of “Drawhline”? For example 40bars. My screen gets all messy with all the lines and I am only interested in the recently drawn levels.

    Thank you!

    #105340

    You can use DEFPARAM DISPLAYONLSTBARONLY=TRUE to only plot the last one (constantly displaying it again and again each new candle, until a new one replaces it). If you are interested in the last 3-4 lines you need to save them and shift them as soon as a new one occurs.

    You can use segments to draw lines having a start and an end, see https://www.prorealcode.com/prorealtime-indicators/pivot-support-resistance-zones/.

     

    #105346

    roberto means DRAWONLASTBARONLY and not DISPLAYONLSTBARONLY!

    https://www.prorealcode.com/documentation/drawonlastbaronly/

    2 users thanked author for this post.
    #105575

    Hello,

    Thank you Roberto and Vonasi. I have managed to Get a indicator that looks ok now 🙂

    However, I made this indicator to visually see if one of my trading idea was worth proceeding with. Now, I am starting to code a system and got stuck directly. My “levels” that are drawn in the indicator is easy to find but I want them to still be there in X bars regardless if a new level forms. That is my problem. The level changes as soon as a new level forms. I tried to have a counter and I tried barindex, but I just cant get it to work. My basic code for the level is copied here as well as a picture of the levels from the indicator.

     

     

     

    #105579

    We need thw full working code to be of some help.

    #105608

    Hi Roberto,

    Thank you for your reply. I understand, I will try to do something about that this week. The thing is, my code doesnt work :), but I will do as much as I can and then hopefully you can help me to get further. I will also attach my indicator file. As always, thank you for your prompt respond! I wouldnt have got a single system without your help.

    1 user thanked author for this post.
Viewing 6 posts - 1 through 6 (of 6 total)

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