Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AddPlot and Value(s)

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

    AddPlot and Value(s)

    Hello,

    There is 2 moving average in my indicator. I want to create a line in the chart for both with AddPlot.

    But only one line show up.

    In if (State == State.SetDefaults) there is AddPlot(Brushes.Yellow, "CMAmultiple0");
    AddPlot(Brushes.Aqua, "CMAmultiple1");

    In OnBarUpdate()

    Value[0] = cma0; and Value[1] = cma1; if i print them both it return the right answer and both cma's.

    But only Value[0] = cma0; produce a line in the chart.

    Whats wrong? I did like in the tutorial https://ninjatrader.com/support/helpGuides/nt8/ Indicator which adds three value series

    Thank you

    #2
    problem solve , ignore the message

    sorry

    Comment


      #3
      Hello frankduc,

      Thanks for your question.

      Value[0] represents the current plot value for the first plot. Value[1] represents the plot value for the last bar for the first plot.

      Values[0][0] represents the current plot value for the first plot as well. Values[0][1] represents the plot value for the last bar for the first plot as well.

      Values[1][0] represents the current plot value for the second plot. Values[1][1] ​​​​​​​represents the plot value for the last bar for the second plot.

      If this is not clear, I suggest reading further into multidimensional arrays from educational C# resources as the concepts for multidimensional arrays would apply here. A publicly available resource can be found below.

      C# allows multidimensional arrays, which are also called rectangular arrays. If you want to insert the data into a tabular form, similar to a table with rows and columns, it's important to understand how to work with multidimensional arrays.


      We look forward to assisting.

      Comment


        #4
        thanks for the link

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        670 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        379 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        111 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        575 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        582 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X