Announcement

Collapse
No announcement yet.

Draw Shape Problems

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

  • Draw Shape Problems

    Hi,

    Can somebody help me with the attached ? Although it appears to print my entry Arrows without a problem, I get mixed results with the exit circles, sometimes they just print constantly and sometimes the won't remove themselves when the conditions have changed before the bar closes.

    Any advice would be good its currently optimised for 6e, you can adjust things with the multiplier if you need to.
    Last edited by rogerha; 01-29-2005, 03:51 AM.

  • #2
    I have been banging my head with this for 3 days now. As you can guess, I am no programmer, and frankly you can't help and think its something stupid.

    A big appeal to all the programmers amongst you !!

    Comment


    • #3
      Hello rogerha,

      Your EFS was not attached, just FYI.

      Sounds like you are testing a condition on each trade and then drawing objects when that condition is true. One option is to use the corresponding removeXXX() function (i.e. removeShape(tagName)) before you test the condition. That way you will end up with the image present if the condition was true on the last trade for the bar. If you decide to use this method you should also make sure you are using a collection of unique tag names for the images. Create a global counter variable and increment this by 1 at each new bar. Use that variable in your tag names for the drawing functions, "myShape"+nGlobalCounter. It's a good idea to keep the total number of images limited to a manageable size by resetting the global counter to 0 once it reaches a certain number.

      PHP Code:
      if (getBarState() == BARSTATE_NEWBAR) {
          
      nGlobalCounter += 1;
          if (
      nGlobalCounter 100nGlobalCounter 0;

      Another option is to change your formula logic to look at the previous bar to test the condition at BARSTATE_NEWBAR, or the open of the new bar. Reference the -1 bar in your condition and if it evaluates to true then draw your objects on the -1 bar.

      And lastly, you could try adding setComputeOnClose() to your formula.
      Jason K.
      Project Manager
      eSignal - an Interactive Data company

      EFS KnowledgeBase
      JavaScript for EFS Video Series
      EFS Beginner Tutorial Series
      EFS Glossary
      Custom EFS Development Policy

      New User Orientation

      Comment

      Working...
      X