Announcement

Collapse
No announcement yet.

Drawing two shapes on one bar

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

  • Drawing two shapes on one bar

    Hi All,

    I'm trying to work out how to draw two shapes on one bar. They are on different positions on the bar, but for some reason only one shows up.

    I'm using the drawShapeRelative function.

    e.g. this only shows one of the shapes:

    drawShapeRelative(0, close(0), Shape.UPTRIANGLE, "", Color.RGB(0,255,0), Shape.UPTRIANGLE);
    drawShapeRelative(0, open(0), Shape.SQUARE, "", Color.RGB(128,0,0), Shape.SQUARE);

    Any ideas?

    Cheers,
    - Will

  • #2
    Re: Drawing two shapes on one bar

    Will
    You need to add a tagID that is unique to each shape. An example of how to do this is enclosed below
    Note that the example assumes you want to draw those shapes on each occurrence. If you instead want to draw them only on the most recent occurrence then remove the +rawtime(0)
    Alex

    PHP Code:
    drawShapeRelative(0close(0), Shape.UPTRIANGLE""Color.RGB(0,255,0), Shape.UPTRIANGLE"ShapeA"+rawtime(0));
    drawShapeRelative(0open(0), Shape.SQUARE""Color.RGB(128,0,0), Shape.SQUARE"ShapeB"+rawtime(0)); 

    Originally posted by willk
    Hi All,

    I'm trying to work out how to draw two shapes on one bar. They are on different positions on the bar, but for some reason only one shows up.

    I'm using the drawShapeRelative function.

    e.g. this only shows one of the shapes:

    drawShapeRelative(0, close(0), Shape.UPTRIANGLE, "", Color.RGB(0,255,0), Shape.UPTRIANGLE);
    drawShapeRelative(0, open(0), Shape.SQUARE, "", Color.RGB(128,0,0), Shape.SQUARE);

    Any ideas?

    Cheers,
    - Will

    Comment


    • #3
      Re: Re: Drawing two shapes on one bar

      Thanks Alex!

      Comment


      • #4
        Re: Re: Re: Drawing two shapes on one bar

        Will
        My pleasure
        Alex


        Originally posted by willk
        Thanks Alex!

        Comment

        Working...
        X