Announcement

Collapse
No announcement yet.

drawTextRelative drift

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

  • drawTextRelative drift

    Hi,

    I am using

    drawTextRelative(lowBar, 50, "l", Color.red, null, Text.CENTER | Text.BOLD | Text.RELATIVETOTOP,"Wingdings", 16, "lowBarDot");

    on 1 min bar charts and am noticing a drift in the dot displayed. The variable lowBar is fixed at a value that does not change
    The draw statement sits inside

    if(getBarState() == BARSTATE_NEWBAR) {
    ......
    }

    Am I missing something here? The drawTwxtRelative is behaving like drawTextAbsolute. Any suggestions for a fix? Any help would be greatly appreciated. I am running the latest version of eSignal.
    Regards,
    Jane

  • #2
    Re: drawTextRelative drift

    Jane
    That is happening because the tagID parameter you are using in the drawTextRelative() command is the same for all the graphic objects being drawn by that command and since there can only be one graphic object per tagID only the last one remains on the chart [the other ones are removed]. You need to use a tagID that will be unique to each graphic object you want to draw
    Alex


    Originally posted by jg
    Hi,

    I am using

    drawTextRelative(lowBar, 50, "l", Color.red, null, Text.CENTER | Text.BOLD | Text.RELATIVETOTOP,"Wingdings", 16, "lowBarDot");

    on 1 min bar charts and am noticing a drift in the dot displayed. The variable lowBar is fixed at a value that does not change
    The draw statement sits inside

    if(getBarState() == BARSTATE_NEWBAR) {
    ......
    }

    Am I missing something here? The drawTwxtRelative is behaving like drawTextAbsolute. Any suggestions for a fix? Any help would be greatly appreciated. I am running the latest version of eSignal.
    Regards,
    Jane

    Comment


    • #3
      Re: Re: drawTextRelative drift

      Hi Alex,

      Thank you very much for your fast reply. I understand what you are saying but in a way that is exactly what I want - I think. Here is the issue. If I use a unique tag then I will get a sequence of dots. I only want one dot, at the bar it was first created, and I want it to remain there. My thinking was that using the same tag would mean that the dot would be erased and redrawn at the original location on each new bar. Since it is not, this then leads me to the question, how do I place a dot at a bar and have it remain there permanently? Thank you very much for all your help Alex. It is much appreciated and I have learned a lot from you.
      Regards,
      Jane


      Originally posted by Alexis C. Montenegro
      Jane
      That is happening because the tagID parameter you are using in the drawTextRelative() command is the same for all the graphic objects being drawn by that command and since there can only be one graphic object per tagID only the last one remains on the chart [the other ones are removed]. You need to use a tagID that will be unique to each graphic object you want to draw
      Alex

      Comment


      • #4
        Re: Re: Re: drawTextRelative drift

        Jane

        My thinking was that using the same tag would mean that the dot would be erased and redrawn at the original location on each new bar.
        That will not happen if the command that draws the dot is executed also on subsequent bars and uses the same tagID

        Since it is not, this then leads me to the question, how do I place a dot at a bar and have it remain there permanently?
        Enclose the command that draws the dot in a condition that is unique to that bar
        Alex


        Originally posted by jg
        Hi Alex,

        Thank you very much for your fast reply. I understand what you are saying but in a way that is exactly what I want - I think. Here is the issue. If I use a unique tag then I will get a sequence of dots. I only want one dot, at the bar it was first created, and I want it to remain there. My thinking was that using the same tag would mean that the dot would be erased and redrawn at the original location on each new bar. Since it is not, this then leads me to the question, how do I place a dot at a bar and have it remain there permanently? Thank you very much for all your help Alex. It is much appreciated and I have learned a lot from you.
        Regards,
        Jane

        Comment


        • #5
          Re: Re: Re: Re: drawTextRelative drift

          Hi Alex,

          Thank you very much for your reply and solutions. I understand what you are saying and the solution. I did not try doing this because I thought that if the dot was drawn only once, it would get erased on a subsequent bar. What I understand now is that I need to draw the dot once and then not execute the draw command again. The dot will then persist at the location at which it was originally drawn.

          The solution I had arrived at was to recode my study so that the offset to the dot was updated on each bar and consequently even though the draw command was executed on each bar, the dot remained in the correct place. Your solution however is far more efficient.

          Thank you very much for all your help Alex.
          Regards,
          Jane

          Originally posted by Alexis C. Montenegro
          Jane



          That will not happen if the command that draws the dot is executed also on subsequent bars and uses the same tagID



          Enclose the command that draws the dot in a condition that is unique to that bar
          Alex

          Comment

          Working...
          X