Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple StrategyPlot()

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

    Multiple StrategyPlot()

    Hi

    I'm using StrategyPlot() to plot inside a strategy.

    I built my StrategyPlot(0) and had no issues. Now I wanted to add StrategyPlot(1) which is simply the 11 period SMA of StrategyPlot(0).

    StrategyPlot(1).Value.Set(SMA(StrategyPlot(0), 11)[0]);

    I keep on getting overflow error. I tried to add

    if(CurrentBar < 11)
    return;

    with no success. Since I'm not dividing anything by zero, I don't see what else it can be.

    Thank you

    #2
    What is the exact error message?
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Error on plotting indicator 'StrategyPlot'. Please check the 'OnBarUpdate' or the 'Plot' method: Error of overflow.

      Comment


        #4
        Works fine on my end. You will need to debug and isolate where your code is failing.

        See attached.
        Attached Files
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Well, my strategy is more complicated than your sample.
          Sometimes it plots correctly, but then when I scroll back the chart, the plots disappear. Other times, like now, it plots just the second and third plot, but not the first one.
          All I get in the Log is only the usual "Overflow Error".
          May I send you my file to try it on your machine?
          My data provider is IB.

          Thank you

          Comment


            #6
            stefy,

            Unfortunately I just don't have the bandwidth to be evaluating complex systems. If it works from the base case scenario I provided earlier than we know it is some level of complexity introduced that is causing the issues. You will just need to slowly go through and debug it.

            Also, StrategyPlot() comes with its limitations and is provided as an as-is solution. If it does not meet your needs, NT7 will provide a more elegant solution for multi-series charting.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Is NT7 going to be your standard response for any question now? ;-)

              Comment


                #8
                Michael,

                There is no information I can provide you guys for StrategyPlot(). It is provided as an as-is intermediate workaround. If it does not fit the bill for your requirements there is nothing more we can do.

                NT6.5 does not support multi-series charting. NT7 will fill the gap.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  I found the issue: in my second StrategyPlot(), if I just use the DataSeries I previously calculated, it plots fine. If I smooth it, the "Error overflow" comes up. I simply do:

                  signal1.Set(SMA(zscore, w1)[0]);

                  but if I do

                  signal1.Set(zscore[0]);

                  it plots fine.

                  Why this happens? Does it have anything to do with SMA? Is there any other way to calculate an average in NT?

                  Thank you

                  Comment


                    #10
                    Likely because you did not sync the DataSeries to the correct time frame.
                    Note: In NinjaTrader 8 It is no longer needed to use an indicator to sync a secondary series. This can be done directly from the Series&lt;T&gt; (https://ninjatrader.com/support/helpGuides/nt8/NT%20HelpGuide%20English.html?seriest.htm) constructor. This post is left for historical purposes. Series objects are useful for
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      I added two bar objects with 1min bars.
                      I'm trying to plot with StrategyPlot() both at 1min and 5min (for the main instrument) and they both don't work.

                      Comment


                        #12
                        You are using DataSeries. Please sync it to the time frame you are trying to use it on as per my last post.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          Josh

                          I assume you only need to sync if you are trying to plot the added series from your strategy?

                          Please confirm

                          I add several timeframes to my cs and have never synced...just use the values for calcs...is this possibly causing problems/errors I do not know about?

                          thanks

                          Comment


                            #14
                            I understand that if I added another instrument with 1min bars I will need to use it on a 1min bar strategy, otherwise it won't plot. Correct?
                            As I wrote already though, I encounter the same problem even after adding 1min bars and running a 1min strategy.

                            Thank you

                            Comment


                              #15
                              ATI user,

                              You only need to sync DataSeries if you want the series to hold continuous values of your secondary bar series.


                              stefy,

                              As discussed, StrategyPlot comes with its limitations. What is shown in the reference sample is what it can do and that is it. I cannot assist you further since it is an as-is solution. NT7 will provide multi-series charting.
                              Josh P.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              648 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              369 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              108 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              572 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              574 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X