Announcement

Collapse
No announcement yet.

drawShapeRelative

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

  • drawShapeRelative

    hey guys,
    I am trying to code a little non-price pane indicator using just dots in a flat line. But I can't seem to get it to work - only the last series appears. I thought I was controlling the "y-value" but there is no scale appearing...?

    Also the "shapes" are appearing like little blobs - can I control their size (=thickness?)

    Any help greatly appreciated -
    here is the sample code:

    var Symbol = null;
    var Interval = null;

    function main() {


    if(Symbol == null) Symbol = getSymbol();
    if(Interval == null) Interval = getInterval();
    var vSymbol = Symbol+","+Interval;


    if (rsi(14,close(sym(vSymbol)))>=50){
    drawShapeRelative( 0, 1, Shape.CIRCLE, null, Color.lime, Shape.TOP);
    }
    else drawShapeRelative( 0, 1, Shape.CIRCLE, null, Color.red, Shape.TOP);

    if (rsi(34,close(sym(vSymbol)))>=60){
    drawShapeRelative( 0, 2, Shape.CIRCLE, null, Color.lime, Shape.TOP);
    }
    else drawShapeRelative( 0, 2, Shape.CIRCLE, null, Color.red, Shape.TOP);


    }

  • #2
    mitboy,

    Try the following. Outside of main add a line:
    var tag = 0;

    Then change all your drawShapeRelative calls by adding tag++ after the Shape.TOP parameter. For example:
    drawShapeRelative( 0, 1, Shape.CIRCLE, null, Color.lime, Shape.TOP, tag++);

    This will assign a unique tag number to each circle. If you don't include this it will assign null as the tag, and when you draw another shape with a null tag it assumes you want to erase the first one. That's why you only saw the last series being drawn.

    You should also see a scale with this change. You didn't see a scale before since you were only displaying a single line.

    The circle size is controlled by the chart bar spacing. Increase the chart bar spacing using the eSignal toolbar and you will get larger circles.

    Steve

    Comment


    • #3
      Steve,
      thanks for the help - your programming style is excellent, very efficient. I appreciate your assistance greatly!
      Thanks again,
      mitboy

      Comment


      • #4
        mitboy,

        You're very welcome. That's what we're all here for, to help one another.

        Steve

        Comment

        Working...
        X