Draw support line until it is broken by subsequent price action

Forums ProRealTime English forum ProBuilder support Draw support line until it is broken by subsequent price action

  • This topic has 7 replies, 4 voices, and was last updated 1 year ago by avatarBel.

Tagged: 

Viewing 8 posts - 1 through 8 (of 8 total)
  • #202677

    Dear Members of the Forum,

    I want to draw a support line on the lowest low of an umbrella line (significant candle in hammer and hanging man patterns).
    My code so far is:

    In the code above I have hardcoded the length of the support line as being 10 bars long, ideally I would like the length of the line to be determined by subsequent price action breaking it.
    That is, if a subsequent candle’s low is below the line, then, and only then, the line should end.

    Does andybody know how this can be done? If the solution involves arrays, I would be happy if you could also provide some code showing how this would work in this case, since I have tried it but couldn’t wrap my head around it.

    I thank you in advance!

    Greetings,
    Nils

    #202686

    Yes it would involves arrays, much better and faster to check an array than to loop the whole history on each candle.. anyway, I’ll try something.

    1 user thanked author for this post.
    #202688

    Please find below a rough solution that work ok to me. Please confirm 😉

     

    1 user thanked author for this post.
    #202693

    Dear Nicolas,

    Thank you so much for your fast response.

    The code does draw support lines if the price action has not been broken (as rays starting from the umbrella line’s lows). What it does not, is draw the support lines that have been broken (until they are broken; likely via DRAWSEGMENT).
    I attached two screenshots. All umbrella lines are highlighted with a grey background. The first screenshot shows the result of your code, the second one shows where support lines should be drawn as well (I just put them in by hand).

    I hope there is a solution for this. Thank you again for helping me with this!

    Greetings,
    Nils

    #202702

    Ok, that new version should be what you required:

     

    2 users thanked author for this post.
    #202705

    Dear Nicolas,

    Thank you so much! This works perfect. You are legendary.

    Greetings,
    Nils

    #209096

    Hello, thank you for this interesting topic. I have an error see PJ. Cordially.

    #209992
    Bel

    @Nicolas,

    won’t create new topic as it seems quite similar but would like to ask if creating something like you did here only to draw line from particular closing time, which we have an option to select, towards in time till it meets the session, which open and close time we also have an option to select, would involve arrays as well, or is there an easier way to go around it?

     

    Thank you.

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

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