DRAWSEGMENT assistance

Forums ProRealTime English forum ProBuilder support DRAWSEGMENT assistance

Viewing 15 posts - 1 through 15 (of 28 total)
  • #39523

    Hi Nicolas and other forum members,

    The attached code draws high and low points on the chart.

    How do I amend it using drawsegment command so that:

    1. it connects the last 2 high points and the last 2 low points on the chart ONLY.
    2. every time a new 2 high and low points are formed, these new points are connected and the 2 old segment lines are automatically removed (i.e. code basically draws the latest 2 high and 2 low points continually)

    Any assistance is appreciated.

    Walid

     

     

    #39525

    Would you mind add the code in readable format in your next post please? Should be easier to help.
    If a graphical component has been plotted, it cannot be erased. But there are some tricks to do it, that’s why I need to explore your code, but preferably on the forum, thank you.

    #39527

     

    #39595

    Do you want the lines to be plotted also in the price history or only about the current supply and demand zones?

    #39611

    No only the current supply and demand zones (i.e. always lines connecting the highs and lows of latest 2 supply lines and 2 demand lines only.

    #39655

    This is how it looks now. Segments are plotted between the 2 last tow detected Highs and Lows. As I said previously, the plotted lines can’t be erased.

     

    #39971

    Hi Nicolas,

    Thank you for posting amended code.

    You are almost there.

    One final change that needs to be made: the segment lines need to connect the current HiPoint with the first preceding HiPoint before it that is HIGHER than the current HiPoint and same for LoPoint segment, the segment lines need to connect the current LoPoint with the first preceding LoPoint before it that is LOWER than the current LoPoint

    #39995

    So you want to draw triangle, right?

    #39998

    Yes you can call it a triangle if you like. Basically I want to connect the high of the most current HiPoint on the chart with the high of the first Hipoint before it that is higher than it. It must be higher than it. Same for lopoints

    #40000

    Ok but the “first preceding HiPoint” is not necessarily the previous one, it could be the 3rd ones from now, right?

    #40003

    yes absolutely.

    #40013

    ok that’s a bit tricky, we’ll have to make a loop through history. Let’s see what can I do!

    #40014

    This is what I made so far. It works, but as you can see, sometimes the last high or low points in the past are used several times. In this code we are not fetching through the whole history but only in the last “length * 5” bars, you can change this factor of course.

     

    #40047

    Looks good but you forgot to post the code 🙂 can you post the code please for the changes you made?

    #40165

    Before posting it I wanted to be sure this was in accordance with your query, here is the code:

     

Viewing 15 posts - 1 through 15 (of 28 total)

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