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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        54 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        72 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        38 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        99 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        60 views
        0 likes
        Last Post PaulMohn  
        Working...
        X