Announcement

Collapse
No announcement yet.

Trouble showing arrows in 3 minute chart

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

  • Trouble showing arrows in 3 minute chart

    I am running beta 6. I have an advanced chart with 3 minute ES #F.

    I am trying to get my program to show up and down arrows when certain conditions are met. I have it show the arrow when the conditions are true and remove the arrow when false, so if the condition was true at the end of the bar, the arrow should still be showing when it moves on to the next bar.

    The up arrow works pretty well, but doesn't show every time it should (according to the formula output history). The down arrow doesn't display at all. I started with seperate functions for drawing the up and down arrows and changed to putting the draw command for the down arrow in the body of the code, but it still doesn't draw it. The accompanying debugPrintln command shows that the drawing section of the code is executing.

    The only way I can get the down arrow to show up is to replace the tag name with a zero. But, of course, then it only shows the most recent arrow and doesn't erase when the conditions are false.

    I hope somebody will take a look at the code I have attached and let me know if there is a bug here or if I'm just doing something stupid. I hope its the former, but I suspect the latter.

    Dale Sullivan
    Attached Files

  • #2
    Hello Dale,

    I made a few changes to your formula that should fix your issues. The problem was a combination of your tag name logic and order of process. The solution was to use unique set of tag names for both the up and down arrows. You'll notice I set vTagName to be a number that increments by one at each instance of a new bar. The tag name parameter in your draw statements was changed to "Up"+vTagName and "Dn"+vTagName. What was happening in your original code, was that the formula was looking for a down arrow first. It would find the condition to be true and draw the down arrow with vTagName, which was set to something like, 11/4_9:12. Immediately following the code block for the down arrows is a code block for finding up arrows, which if found to be false would then remove the down arrow just drawn due to removeShape( vTagName ). That was the same tag name that was just used to draw the down arrow. Thus you never saw any of your down arrows. I made a few other minor changes in preMain() where you were defining your formula parameters. You probably meant to have two separate ones, fp1 and fp2. Try the attached and let me know if this works for you.

    Attached Files
    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


    • #3
      Thanks for your help Jason. That is exactly what I needed.

      Once I saw your reasoning behind the problem it was so obvious that I feel like a dunderhead. I guess it's just so easy to get stuck thinking one way that you don't see the real reason. It helps to get someone else's perspective on it.

      Thanks again for your help. I appreciate it.

      Dale

      Comment

      Working...
      X