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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        56 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        143 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        160 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        96 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        276 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X