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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        65 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        35 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        59 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        51 views
        0 likes
        Last Post CarlTrading  
        Working...
        X