Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator only plots on one instrument

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

    Indicator only plots on one instrument

    Hi,

    I have a “simple” indicator that will plot “B” and “S” When the moving average over CCI is crossed.
    The signal works fine ONLY ON ONE INSTRUMENT! (6E)
    When I switch instruments it will not plot.

    Also, is there a way to may the "B" and "S" font size bigger when it plots?

    Please help…. In layman’s terminology.

    Thanks.
    J

    protectedoverridevoid Initialize()
    {
    Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
    Overlay = true;
    }

    ///<summary>
    /// Called on each bar update event (incoming tick)
    ///</summary>
    protectedoverridevoid OnBarUpdate()
    {
    // Condition set 1
    if (CrossBelow(SMA(CCI(14), 20), CCI(14), 1))
    {
    DrawText("My text" + CurrentBar, "B", (int) (Close[0]), Low[0]+ -6 * TickSize, Color.DarkGreen);
    }

    if (CrossAbove(SMA(CCI(14), 20), CCI(14), 1))
    {
    DrawText("My text" + CurrentBar, "S", (int) (Close[0]), High[0] + 6 * TickSize, Color.Red);
    }
    // Use this method for calculating your indicator values. Assign a value to each
    // plot below by replacing 'Close[0]' with your own formula.
    // Plot0.Set(Close[0]);
    }

    #2
    Joshua,

    I see nothing in your code to indicate why this issue would occur. If you would like me to look into it further, please send your indicator to [email protected].
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Hi Adam,

      I didnt think there was anything wrong as well... Compliled o.k.
      I just emailed the indicator Support@NT.

      Thanks for taking a look.
      J

      Comment


        #4
        Originally posted by Joshua 1:8 View Post
        // Condition set 1
        if (CrossBelow(SMA(CCI(14), 20), CCI(14), 1))
        {
        DrawText("My text" + CurrentBar, "B", (int) (Close[0]), Low[0]+ -6 * TickSize, Color.DarkGreen);
        }

        if (CrossAbove(SMA(CCI(14), 20), CCI(14), 1))
        {
        DrawText("My text" + CurrentBar, "S", (int) (Close[0]), High[0] + 6 * TickSize, Color.Red);
        }
        the red as highlighted is the erroneous code. replace it with a 0 (zero).

        Comment


          #5
          Woohoo!! That worked!

          Thank you very much Bukkan!

          J

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          574 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          332 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          553 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X