Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

2 plots, only one prints on chart

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

    2 plots, only one prints on chart

    I'm trying to plot a calculation on two different types of volume: level 2, non-historical volume calculated in OnMarketData, and regular historical (GetCurrentAskVolume() + GetCurrentBidVolume() volume.

    I'm trying to print both in a new panel using 'AddPlot(new Stroke(Brushes.Cyan), PlotStyle.Line,' for both, but only the historical, (GetCurrentAskVolume() + GetCurrentBidVolume(), prints. The other is ignored.

    The output window is giving me all the correct results, it just won't print.

    Do you know what I'm doing wrong?
    NT8, 8.0.2.0

    Thank you.

    #2
    Hello imalil,

    Thank you for your post.

    You would need to instead use the AddDataSeries() function to add additional bid and ask market data types. Then call those bar series for the values you need.

    For information on multiple bar series in your script please visit the following link: http://ninjatrader.com/support/helpG..._ask_serie.htm

    The syntax used from AddDataSeries() is as follows: AddDataSeries(string instrumentName, BarsPeriodType periodType, int period, MarketDataType marketDataType)

    Comment


      #3
      Thanks for the info, but I think I made the issue sound more complex than it actually is. I'll be more specific.

      An example: I made a simple indicator in NT7, which transferred to NT8. It has one data series. It calculates a number, then calculates a MA on that number. I have two plots in initialize for each result. It prints both lines fine.

      My new indicator has only one data series as well. I am simply getting two results, both of which are now calculated in OnMarketData. I have two plots, one for each result. The output window clearly shows everything is working as it should. Initialize and OnStateChange() are the same in both the MA and my new indicator. I am just not getting both outputs to print in my panel. Under OnStateChange() for both indicators I have:

      protected override void OnStateChange()
      {
      switch (State)
      {
      case State.SetDefaults:
      Name = "xxxx";
      Description = "xxxx";
      Initialize();
      break;
      }
      }
      I have no idea why it is like this. All my custom indicators seem to have this, which doesn't match NT indicators at all.

      Thank you for the help.

      Comment


        #4
        This has been fixed.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        577 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 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