Announcement

Collapse
No announcement yet.

drawShapeRelative Help ???

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

  • drawShapeRelative Help ???

    I'm using the "drawShapeRelative" to place a diamond above the high of a bar that meets my criteria. This works fine EOD but is not working correctly with interday / streaming data for 5, 10, 30 minute charts etc..

    I have to reload my efs after almost every bar to get the correct results.

    What do I have to add to the "drawShapeRelative" statement so that the diamond will only draw or redraw when the bar is done.

    For Example:
    Now during / while a 5 minute bar is developing a shape (diamond) is being drawn with each data update and results in multiple shapes being drawn all over the bar. Sometimes the bar can meet my criteria initially while the bar is developing but then no longer meets the criteria by the time the bar is complete. In this case there should be no shape associated with the bar but because shapes were drawn initially they do not get removed.

    What should happen is that as new data is received all data for that bar should be re-evaluated and a single shape should be drawn if the criteria is met.

    So, what do I have to add to the "drawShapeRelative" statement so that only one diamond will appear as new data is accumulated during the bar development and at the end of the bar if the criteria is met???
    OpaBert

  • #2
    You need to take advantage of the Tag Variable.. add a

    , 99

    just before the closing parentheses and only one symbol will be drawn per bar.

    Comment


    • #3
      Draw shape Chance ???

      Thanks David,

      Is this the change I make???

      Original:

      drawShapeRelative(0, low()-1, Shape.DIAMOND, "", Color.RGB(255,0,0), Shape.LEFT);

      Edit to read:

      drawShapeRelative(0, low()-1, Shape.DIAMOND, "", Color.RGB(255,0,0), Shape.LEFT,99);

      Please confirm,

      Thanks again.
      OpaBert

      Comment


      • #4
        that is correct

        Comment

        Working...
        X