Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

indicator does not behave as expected

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

    indicator does not behave as expected

    Hello

    I have a simple indicator where I want to have RSI line colored in one color or another depending on slop up or down. Why do I get line brakes as in attached figure in the lower indicator window. Here is my code:

    protected override void Initialize()
    {
    Add(new Plot(Color.FromKnownColor(KnownColor.ForestGreen), PlotStyle.Line, "PlotUp"));
    Add(new Plot(Color.FromKnownColor(KnownColor.Tomato), PlotStyle.Line, "PlotDown"));
    Add(new Plot(Color.FromKnownColor(KnownColor.SlateGray), PlotStyle.Line, "Plot0"));
    Add(new Plot(Color.FromKnownColor(KnownColor.SlateGray), PlotStyle.Line, "Plot100"));
    Add(new Line(Color.FromKnownColor(KnownColor.DarkOrange), 50, "ZeroLine"));
    Overlay = false;
    CalculateOnBarClose = false;
    }

    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {
    // Use this method for calculating your indicator values. Assign a value to each
    // plot below by replacing 'Close[0]' with your own formula.

    if (CurrentBar<PeriodRSI) return;

    if (RSI(Input,PeriodRSI,1)[0]>=RSI(Input,PeriodRSI,1)[1])
    PlotUp.Set(RSI(Input,PeriodRSI,1)[0]);
    else
    PlotDown.Set(RSI(Input,PeriodRSI,1)[0]);

    Plot0.Set(0);
    Plot100.Set(100);
    }
    Attached Files

    #2
    Hello sergeysamsonov,

    There is a new approach to multi color plots in version 7. Please see this post for details on this:
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Sorry, it is latest update of version 7

      Comment


        #4
        Thanks - I edited the post once I looked closer at the chart. Please see this thread for the multi color approach used in version 7:
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Thank you, this helped!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          571 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          330 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
          548 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          548 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X