Announcement

Collapse
No announcement yet.

Draw line question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Draw line question

    Is there a way to draw a horizontal line from, for example, a high or low pivot point, and have it extend until it is broken by a subsequent bar.

    I can do it with a remove line command, but I would like to keep the line on the chart and to simply have it stop once broken.

    Thanks,

    Steve

  • #2
    In your EFS which draws the lines, notice that the last parameter in the drawLineRelative() / drawLineAbsolute() functions is an optional "tagID". The tag allows you to name lines with either a string or a number so you can keep track of it separately from all other lines you have drawn.

    When you detect that a price bar has penetrated a horizontal line, you know the (x2, y2) coordinate where this occurred for a specific line (which you already know the tag id of). The last redraw of that particular horizontal line in your list of lines that you're drawing will have its last (x2, y2) coordinate position stop at that y2 penetration position.

    At this point, you're probably going to generate a new tag id to draw a new line some time in the future.

    If I'm not getting your question right, then post some sample code, describing how it's not currently working for you.

    Other note:

    Since there are tag ids to name/keep track all of these drawn objects on the screen, it would have been nice if eSignal had provided a function to return the (x, y) coordinate(s) for a specific tag id.

    There could be a whole set of functions centered around retrieving/updating the various properties you originally entered associated with a tag id (e.g., font, font size, foreground color, background color, etc.) simply based on knowing the tag id.

    Finally, with the tag id, they could return to you what "type" of object you're dealing with. Then, you could have a loop in your program which says, "for all tag ids which identify a 'line' type, change the foreground color to Color.red or change the y2 coordinate to y2 + n, etc. etc.
    Last edited by SteveH; 09-17-2011, 10:49 PM.

    Comment


    • #3
      SteveH,

      Thanks so much for your reply. It points me in the right direction.

      Comment

      Working...
      X