Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawText But only Once

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

    DrawText But only Once

    Hello,
    I developed a little strategy to tell me whether it is overbought or oversold and when triggered to draw a up/down arrow and to have the text "Overbought" or "Oversold".

    The Arrows come up every time the indicator trigger but the text only happens in the last trigger but not any of the times it happened before.

    How can I correct this issue to where every time the Arrow appears, so does the Text?

    This is the code below:
    // Condition set 1 - Overbought Short
    if (CCI(CCIFast)[0] > 150
    && CCI(CCISlow)[0] > 150)
    {
    BackColorAll = Color.Pink;
    DrawArrowDown("MyTag"+ CurrentBar, true, 0, High[0] + TickSize, ArrowsDownColor);
    DrawText("Mytag","Overbought", 0, High[0] + TickSize*16, Color.Red);

    Thanks

    NickF

    #2
    Originally posted by NickF View Post
    Hello,
    I developed a little strategy to tell me whether it is overbought or oversold and when triggered to draw a up/down arrow and to have the text "Overbought" or "Oversold".

    The Arrows come up every time the indicator trigger but the text only happens in the last trigger but not any of the times it happened before.

    How can I correct this issue to where every time the Arrow appears, so does the Text?

    This is the code below:
    // Condition set 1 - Overbought Short
    if (CCI(CCIFast)[0] > 150
    && CCI(CCISlow)[0] > 150)
    {
    BackColorAll = Color.Pink;
    DrawArrowDown("MyTag", true, 0, High[0] + TickSize, ArrowsDownColor);
    DrawText("Mytag","Overbought", 0, High[0] + TickSize*16, Color.Red);

    Thanks

    NickF
    Remove currentbar. That is making it unique and therefore drawing on every bar.

    Comment


      #3
      Originally posted by NickF View Post
      Hello,
      I developed a little strategy to tell me whether it is overbought or oversold and when triggered to draw a up/down arrow and to have the text "Overbought" or "Oversold".

      The Arrows come up every time the indicator trigger but the text only happens in the last trigger but not any of the times it happened before.

      How can I correct this issue to where every time the Arrow appears, so does the Text?

      This is the code below:
      // Condition set 1 - Overbought Short
      if (CCI(CCIFast)[0] > 150
      && CCI(CCISlow)[0] > 150)
      {
      BackColorAll = Color.Pink;
      DrawArrowDown("MyTag"+ CurrentBar, true, 0, High[0] + TickSize, ArrowsDownColor);
      DrawText("Mytag","Overbought", 0, High[0] + TickSize*16, Color.Red);

      Thanks

      NickF
      Correct the tag for DrawText() to make it unique in the same manner that you have for DrawArrowDown(). Your current code is using the same tag, so your text will appear only once on the chart, as that tag will always be the only tag.

      Comment


        #4
        Originally posted by koganam View Post
        Correct the tag for DrawText() to make it unique in the same manner that you have for DrawArrowDown(). Your current code is using the same tag, so your text will appear only once on the chart, as that tag will always be the only tag.

        Oops, I had that backwards

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        649 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        370 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        109 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        573 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        576 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X