Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

second data set wont plot

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

    second data set wont plot

    I know I am probably missing something obvious, but when I try to plot

    Add(new Plot(Color.Pink, "IchiLowSpread"));
    Add(new Plot(Color.Orange, "IchiCloseSpread"));

    only one of them actually plots...is there something I have to initialize to get the second plot to show up? (also, I didn't create a data series for either, is that something I must do? or can I just plot the data? )

    thx

    #2
    Hello nightriderx,

    In addition to the statement you wrote, you need code in the properties region for each plot. The Values[] index increases by one for each plot you add.

    [Browsable(false)]
    [XmlIgnore()]
    public DataSeries IchiCloseSpread
    {
    get { return Values[1]; }
    }
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Yeh, I got those too, but its a no go.

      the rest of my code is very simple:

      protected override void OnBarUpdate()
      {

      if (CurrentBar < 5)
      return;


      IchiLowwSpread.Set(Low[1] - Ichimoku(BarsArray[0], 9, 26, 52).TenkanSen[1]);
      IchiCloseSpread.Set(WMA(2)[0] - Ichimoku(BarsArray[0], 9, 26, 52).TenkanSen[0]);

      }

      Comment


        #4
        Is there any particular need to use BarsArray[0] here rather than Close[0]? BarsArray is typically used with multiple series indicators.

        Are there any error messages in log tab of the control center?
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          I removed the barsArray statement, but still no go.

          Comment


            #6
            Check the log tab of the control center for any error messages. If you post the complete code or share the file we can try on our side.
            Ryan M.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by AaronKoRn, Today, 09:49 PM
            0 responses
            11 views
            0 likes
            Last Post AaronKoRn  
            Started by carnitron, Today, 08:42 PM
            0 responses
            10 views
            0 likes
            Last Post carnitron  
            Started by strategist007, Today, 07:51 PM
            0 responses
            11 views
            0 likes
            Last Post strategist007  
            Started by StockTrader88, 03-06-2021, 08:58 AM
            44 responses
            3,980 views
            3 likes
            Last Post jhudas88  
            Started by rbeckmann05, Today, 06:48 PM
            0 responses
            9 views
            0 likes
            Last Post rbeckmann05  
            Working...
            X