Announcement

Collapse
No announcement yet.

DrawShape Relative to high() or low()

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

  • DrawShape Relative to high() or low()

    Using high() or low() as the yValue, the shape is drawn centered on the high or the low of the price bar. What additional code is needed to move the shape a set increment away from the high() or low() so that the shape and the price bar are not touching?

    For example:

    drawShapeRelative(0, high(), Shape.CIRCLE, "", Color.yellow, Shape.TOP);

    How is this modified to place the circle above the high() a distance equal to about the radius of the circle?

    And:

    drawShapeRelative(0, low(), Shape.CIRCLE, "", Color.yellow, Shape.TOP);

    How is this modified to place the circle below the low() a distance equal to about the radius of the circle?

  • #2
    Lancer,

    Since the radius of the circle is based on the thickness of the bars and this thickness is not accessible by EFS, this wouldn't be possible to do.

    A few options exist to either set a fixed amount above/below a bar, or a relative amount based on the high or low.
    Regards,
    Jay F.
    Product Manager
    _____________________________________
    Have a suggestion to improve our products?
    Click Support --> Request a Feature in eSignal 11

    Comment


    • #3
      Jay, I was using the radius of the circle just as an example of a small distance of separtion between the shape and the high() or low(). That reference confuses the question, so disregard. Use any small distance relative to the high() and low().
      Last edited by Lancer; 06-23-2003, 02:30 PM.

      Comment


      • #4
        My apologies for misunderstanding. Try this out...

        PHP Code:
        function main(nFactor) {

        if (
        nFactor == nullnFactor 0.01;

        ...

        drawShapeRelative(0high() + nFactorShape.CIRCLE""Color.yellowShape.TOP);
        drawShapeRelative(0low() - nFactorShape.CIRCLE""Color.yellowShape.TOP);

        ...


        Then adjust the factor as needed.
        Regards,
        Jay F.
        Product Manager
        _____________________________________
        Have a suggestion to improve our products?
        Click Support --> Request a Feature in eSignal 11

        Comment


        • #5
          Thanks Jay.

          I did not use this part:

          function main(nFactor) {

          if (nFactor == null) nFactor = 0.5;

          and instead used this:

          var nFactor = .5;

          otherwise, I got a "nFactor is not defined" formula error.

          One other note, this nFactor solution is not documented in the EFS Help Center & Library.

          Comment

          Working...
          X