Announcement

Collapse
No announcement yet.

Problem Displaying Arrows on Chart

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

  • Problem Displaying Arrows on Chart

    Am trying to print up and down arrows on a chart with an efs. I have several efs, either written or adapted by me, where I am doing this quite successfully.

    This time, if I use the statement as I have always used:
    drawTextRelative(0,low(0),"é",Color.yellow,null,Te xt.BOTTOM|Text.CENTER|Text.BOLD,"Wingdings",11,"Up "+BarCount)

    the arrow appears on the bar it is supposed to while the bar is printing but disappears when the chart finishes the bar and moves on to the next bar. No previous arrows are displayed on the chart as they should be.

    If I change the statement to read:
    drawShapeRelative(0,low(0),Shape.UPARROW,null,Colo r.yellow,Shape.BOTTOM,"Up"+BarCount)

    the arrows print correctly on previous bars and do not disappear on the current bar when it completes.

    This is the only change I make and if I alternate between the two statements the arrows disappear and appear with them respectively!

    The full efs is too long to print here but can anybody suggest why the arrows may be disappearing with the original statement above that I have always used successfully before and have several efs' with them currently displaying the arrows successfully? I want to use the drawTextRelative statement since it gives me control over the size of the arrow whereas the drawShapeRelative statement does not appear to give me this size control.

    I have reviewed Alexis' various arrow efs' with the drawTextRelative statement and can find nothing different to mine.

    Rob

  • #2
    Rob
    FWIW I copied the drawTextRelative() command you posted and it appears to work without any problems in the context of the efs(s) I tried it with.
    If the script is too long you can attach the efs to the message so that someone can help you resolve this.
    Alex

    Comment


    • #3
      Thanks Alexis. I am going to have another look at this.

      Because the efs is long and complicated, I thought I would extract the relevant section that prints the arrows and just post that. At first it would not print the arrows although the efs ran. A small change to a set of open/close braces corrected it and the arrows then printed as they should. I need to go back to my original efs and study the formatting further - although it is strange because it has both the drawTextRelative and drawShapeRelative statements one after the other and I just delete or add the "//" comment notation before one or the other statements and one works, the other does not! If I cannot find a reason I will post back.

      Another question. Is it possible to leave a gap above or below the bar before the arrow is printed? Not sure how to add/subtract a few pixels to the "yValue" of the parameter so as to get the spacing from the high or low of the bar. This would then resolve my 2nd question of how to print a "2 line comment" above or below a bar - ie the arrow on one "line" and either below it it or above it a word such as "trend" or "c/trend" since the arrows can be generated from various sources? If I can control the "yValue", then I should be able to do this by adding/subtracting a few more pixels to the yValue. Just cannot seem to alter the yValue satisfactorily so what is its format please?

      Thanks
      Rob

      Comment


      • #4
        Rob
        With regards to placing graphics or text above/below a bar EFS2 - currently in the last stages of beta testing - will greatly simplify this task as it includes a new and very easy to use location parameter (AboveBar1, AboveBar2, BelowBar3, etc) that saves you from having to compute the "spacer" yourself
        Alex

        Comment

        Working...
        X